LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (http://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   memcpy doubt (http://www.linuxquestions.org/questions/linux-newbie-8/memcpy-doubt-944446/)

mr.cracker 05-11-2012 12:36 PM

memcpy doubt
 
What is the meaning of this code.

memcpy(&bish[512-strlen(shellcode)],shellcode,strlen(shellcode));

In my sence, &bish means address of bish. if yes by, this code can i copy my shell-code to the address of bish???

Snark1994 05-11-2012 12:42 PM

Quote:

Originally Posted by mr.cracker (Post 4676151)
What is the meaning of this code.

memcpy(&bish[512-strlen(shellcode)],shellcode,strlen(shellcode));

In my sence, &bish means address of bish. if yes by, this code can i copy my shell-code to the address of bish???

You don't say what your variables are, but assuming shellcode is a string, I would take that to mean that it copies the contents of the string shellcode to a position so that the last byte of shellcode is 512 bytes after the address of bish.

It shouts bootloader at me, but it could be something else, I suppose.


All times are GMT -5. The time now is 02:32 AM.