im playing with assembly language and gdb trying to modify a memory address:
+67 00058093 0f84e8000000 je 0x00058181
id like to change the second byte that reads 84 to 85 so that the instruction becomes jne. Then i do the following in gdb after breaking on code:
set {char}0x00058094=85
but i get the following “andnps %xmm0,%xmm5” instead of jne:
(gdb)disas
0x00058093 <-[SWBConditionalImplementations checkRegistration:preferences:callbacks:]+67>: andnps %xmm0,%xmm5
Thanks for any help!
Your problem is that you are passing a decimal value, not a hex one, you should use
set {char}0x00058094=0x85orset {char}0x00058094=133to do what you wanted, alternativelyset *((char*)0x00058094) = 0x85would also work.disassembly makes this a little clearer:
vs.
85 is 0x55, which is why you get the SIMD instruction and no the JNE you wanted.
(I’m a bit disappointed that I didn’t notice that sooner…)