the ways we get EIP in bochs

the ways we get EIP in bochs

1) bx_dbg_get_eip()

is okay but requires debugger to be compiled in

2) BX_CPU(i)->guard_found.eip

is the eip of instruction which hit a guard, not necessary current eip

3) BX_32BIT_REG_EIP

is just a enum which translates to integer with no human meaning

4) BX_CPU(0)->get_eip()

is the most correct way

5) BX_CPU(0)->gen_reg[BX_32BIT_REG_EIP].dword.erx

accessing 32-bit EIP, not the RIP or 16-bit IP through non-convenional access to CPUs internal variable. Don’t be surpised if the variable changes its name or location without telling you

read count : 4