Why register EAX, ESP and instructions sub, push and pop assemble into ASCII chars?
For example:
‘%’ means “and EAX”
‘-‘ means “sub EAX”
‘P’ means “push EAX”
‘X’ means “pop EAX”
‘T’ means “push ESP”
‘\’ means “pop ESP”
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If I’m reading the question right: Because they’re opcodes just happen to be the same as those characters in the ASCII table.
Looking at: http://ref.x86asm.net/coder32.html and go down to AND eAX, you will note that in the dark gray column on the left, it says the opcode for that mnemonic is 25 (in hex).
If you then look at an ASCII table (for example http://www.asciitable.com/), and look at what character 25 hex is, it will be
%.A further guess on why this question was asked: There are some cases where being able to provide a program in type-able ASCII might be desired. The first may be something like the EICAR antivirus test string:
which, if entered into notepad, saved as a COM file (e.g. eicar.com), and then run, it will print
EICAR-STANDARD-ANTIVIRUS-TEST-FILE!. This makes it rather simple to paste into programs, email, etc. to ensure that anti-virus is working correctly.Another use would be writing shellcode for buffer overflow based attacks, again for reasons of ease of typing and escaping. If you want more details on that, I would consult something like http://projectshellcode.com/?q=node/12 for an overview of this process.