translating Python to Assembler

over at thepond.com over at thepond.com
Sun Jan 27 06:23:20 EST 2008


>>
>> >ajaksu at Belkar:~$ ndisasm error.txt
>> >00000000  54                push sp
>> >00000001  686973            push word 0x7369
>> >00000004  206973            and [bx+di+0x73],ch
>> >00000007  206E6F            and [bp+0x6f],ch
>> >0000000A  7420              jz 0x2c
>> >0000000C  61                popa
>> >0000000D  7373              jnc 0x82
>> >0000000F  656D              gs insw
>> >00000011  626C65            bound bp,[si+0x65]
>> >00000014  722E              jc 0x44
>> >00000016  2E                db 0x2E
>> >00000017  2E                db 0x2E
>> >00000018  0A                db 0x0A
>>
>> >:/
>>
>> not sure what you're saying. Sure looks like assembler to me. Take the
>> '54   push sp'. The 54 is an assembler opcode for push and the sp is
>> the stack pointer, on which it is operating.
>
>go troll somewhere else (you obviously don't know anything about
>assembler and don't want to learn anything about Python).
>
>-- bjorn


before you start mouthing off, maybe you should learn assembler. If
you're really serious, go to the Intel site and get it from the horses
mouth. The Intel manual on assembler lists the mneumonics as well as
the opcodes for each instruction. It's not called the Intel Machine
Code and Assembler Language Manual. It's the bible on assembly
language, written by Intel. 

If you're not so serious, here's a URL explaining it, along with an
excerpt from the article:

http://en.wikipedia.org/wiki/X86_assembly_language

Each x86 assembly instruction is represented by a mnemonic, which in
turn directly translates to a series of bytes which represent that
instruction, called an opcode. For example, the NOP instruction
translates to 0x90 and the HLT instruction translates to 0xF4. Some
opcodes have no mnemonics named after them and are undocumented.
However processors in the x86-family may interpret undocumented
opcodes differently and hence might render a program useless. In some
cases, invalid opcodes also generate processor exceptions.

As far as this line from your code above:

00000001  686973            push word 0x7369

68 of 686973 is the opcode for PUSH. Go on, look it up. The 6973 is
obviously the word address, 0x7369. Or, do you think that's
coincidence?

Don't fucking tell me about assembler, you asshole. I can read
disassembled code in my sleep. 







More information about the Python-list mailing list