3

What does the dollar symbol mean in

jz $+2

(This is IDA output.)

10

The dollar symbol in this instance means "current position." This is the position this instruction begins at, and then plus two bytes. This instruction is two bytes, so it jumps to the next instruction past this one. It's effectively garbage.

  • 2
    it can also be a sign of conditionally-compiled code that is not present in that configuration (maybe in debug mode, there is a message printed in some circumstances, and the branch would skip it). – peter ferrie Aug 5 '13 at 20:33
  • It's also present in a lot in non-optimized code (like 1990 16bit x86 game code) in switch statements where the last item also "jumps to the end" even though it is at the end already. – Simeon Pilgrim Oct 10 '13 at 3:57
  • Especially in older MS-DOS programs, statements like this were often used betwen inb/outb instructions, to give some time to external hardware that was slower than the processor. – Guntram Blohm Dec 28 '14 at 14:58
4

Jump two bytes forward from current position when zero flag == NULL Opcode for this 74 00 which is two bytes

seg000:00000000 74 00                    jz      short $+2
seg000:00000002 74 00                    jz      short $+2

so effectively it will jump to next instruction whether the condition is met or not garbage mostly used in obfuscation

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.