1

I've spent about 6 hours debugging some code using Cheat Engine. I've come across something really weird.

crazy weird instruction

The instruction reads:

imul esi,esi0A

What does this mean?

ESI = 5 before the instruction After the imul instruction it becomes 32.

Peter Cordes
  • 328,167
  • 45
  • 605
  • 847
Mugen
  • 1,417
  • 5
  • 22
  • 40

1 Answers1

3

TL;DR

The instruction in question was probably intended to be

imul esi, esi, 0x0A

, but Cheat Engine probably forgot to print the comma ,.


Longer Version

The mathematical result you describe is consistent with 0x00000005 = 5 being multiplied by 0x0A = 10 to produce 0x00000032 = 50.

The Intel Software Developers' Manual, Volume 2A, §3.2 - IMUL - Signed Multiply documents the instruction's function and valid forms. Of the ones that allow immediate constants, the only available forms require specifying 1) the destination register, 2) the source register and 3) the immediate constant.

In this particular case, obviously these were intended to be respectively esi, esi, 0x0A. Cheat Engine only printed it incorrectly.

IMUL Instruction Forms

Iwillnotexist Idonotexist
  • 13,297
  • 4
  • 43
  • 66