5

I am attempting to patch a binary in IDA using the "Assemble" option, and every time I enter an instruction with some arithmetic to calculate the offset, I receive an Invalid Operand error. For example:

mov [bp-4], bx       

returns Invalid Operand, while

mov ax, bx

works.

I've attempted playing around with the format of the instruction (eg include word ptr, use 4h, etc) but nothing seems to work. Is there any way about this error, or is entering byte code for patching the only option?

Seki
  • 11,135
  • 7
  • 46
  • 70
user3712482
  • 103
  • 1
  • 8

2 Answers2

6

according to Hex Rays:

The assembler command is supported for only a few processors, only a few instructions. We do not plan to extend this feature, sorry

Lame, I know.

Orwellophile
  • 13,235
  • 3
  • 69
  • 45
1

A bit late, but although the Assemble dialog says "Invalid operand" if you know the bytecode you can use the Change byte... menu option instead. You could use OllyDbg to assemble to bytecode (select anywhere and hit space), then copy that into IDA's Change byte dialog as a workaround.

tomysshadow
  • 870
  • 1
  • 8
  • 23