What does the dollar symbol mean in
jz $+2
(This is IDA output.)
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.
BNE *-3
or BNE $-5
would loop to an instruction that starts 3 bytes before the BNE, while BEQ *+2
or BEQ $
would execute the same next instruction whether the condition was true or not, but take an extra cycle if the Z flag is set (note that page crossings are measured based upon the address of the instruction after the branch, so BEQ $
would never take an extra cycle for a page crossing.)
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