I'm trying to learn how to create shellcode, and I need to enter a whole bunch of hex codes. However, when I give my program input with hexadecimal codes, hexadecimal codes are treated like regular ASCII characters, and the backslash is simply simply stripped.
Example:
./a.out "AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA \ x35 \ x85 \ x04 \ x08"
In this scenario, the hexadecimal codes (\ x35 \ x85 \ x04 \ x08) are treated as separate characters - that is, x = 0x75, etc.
The input method of my program is similar to the following:
int authentication(char *pass){
char password_buffer[16];
strcpy(password_buffer, pass);
return 1;
}
int main(int argc, char *argv[]){
if(authentication(argv[1])){
}
return 1;
}
Dump from memory after strcpy ():
0xbffff260: 0x41414141 0x41414141 0x41414141 0x41414141
0xbffff270: 0x78353378 0x30783538 0x38307834 0x08048400
, 0xbffff270 0x78353378, x35x , , . , 0x08048535.
?