1

Please check this screenshot of my x32dbg: image

00408951 | 3D E8030000              | cmp eax,3E8                             |
00408956 | 7F 3A                    | jg debugme.408992                       |

Since eax (8349294D) is greater then 0x3E8, why that jg is not taken? And no, I didn't change the flags.

1201ProgramAlarm
  • 32,384
  • 7
  • 42
  • 56

2 Answers2

3

jg is a for a signed comparison. As a signed 32 bit number, EAX is negative.

You should use ja (for above), which is unsigned comparison.

1201ProgramAlarm
  • 32,384
  • 7
  • 42
  • 56
2

JG is jump if signed greater than, or in other words, ZF=0 and SF=OF.

8349294D is negative and 0x3E8 is positive, so ZF=0 but SF=1 and OF=0 so SF!=OF, as visible in your flags panel (underlined). The value of CF does not matter to JG.

harold
  • 61,398
  • 6
  • 86
  • 164