define run_until_call_jmp is_call is_jmp while !($is_call || $is_jmp) stepi is_call is_jmp end end define is_jmp set $_op1 = *(unsigned char*)($eip + 0) set $_op2 = *(unsigned char*)($eip + 1) set $is_jmp = 0 if ($_op1 == 0xEB) || ($_op1 == 0xE9) || ($_op1 == 0xEA) set $is_jmp = 1 end if ($_op1 == 0xFF) && (($_op2 & 0x07) == 4 || ($_op2 & 0x07) == 5) set $is_jmp = 1 end end define is_call set $_op1 = *(unsigned char*)($eip + 0) set $_op2 = *(unsigned char*)($eip + 1) set $is_call = 0 if ($_op1 == 0xE8) || ($_op1 == 0x9A) set $is_call = 1 end if ($_op1 == 0xE8) || ($_op1 == 0x9A) set $is_call = 1 end if ($_op1 == 0xFF) && (($_op2 & 0x07) == 2 || ($_op2 & 0x07) == 3) set $is_call = 1 end end