I've got an assignment and i have to use ptrace to trace the system calls of an application. The problem is that when i am running the program it gives me some uncommon values, that i obtain from the registers, as output. Some of those values are negative numbers.
Here is the code: http://pastebin.com/iMXYmqG6 And here is some sample output: http://pastebin.com/bVa5vnWT
If anyone could give me some directions on what i am doing wrong i would be really grateful.
P.S. I am working on a 64-bit OS but i am building a 32 bit application(that was a restriction for the assignment.)
As you are using 64 bit os you have to use registers used in 64 bit compatible. i.e., RAX,ORIG_EAX,EBX,EBX.....If not you will get garbage values