Saturday, 15 March 2014

memory - XOR instruction not working as thought (Intel 8086) -



memory - XOR instruction not working as thought (Intel 8086) -

i studying topic of mine fascinated with, reverse engineering. have run little speed bump. know bitwise operator xor , bits doesnt seem working correctly when watch in process in disassembler. little segement of code dealing is:

mov eax, 0040305d xor dword ptr [eax], 1234567

before xor has taken place, number resides @ location 0040305d 1234 or 31323334 hexadecimal (it represented ascii because taken user input , firmly resides 31323334 in memory). when looked xor calculator on net check create sure doing alright on paper got result of xor calculation 30117653 hexadecimal. when run operation in disassembler replaced memory location held in eax 56771035.

what happened? missing here? checked xor calculation on many calculators , not able reply of 56771035. can give me hand , tell me doing wrong?

-dan

the numbers displayed in hex , have forgotten utilize proper endianness. if user input ascii 1234 means memory contains bytes 31 32 33 34. since x86 little endian, operand 1234567 byte sequence 67 45 23 01. performing xor operation byte sequence 56 77 10 35 see.

memory assembly reverse-engineering intel xor

No comments:

Post a Comment