iced icon indicating copy to clipboard operation
iced copied to clipboard

[Question] The full_register32 of EIP is RIP?

Open progmboy opened this issue 2 years ago • 1 comments

I noticed the definition of the EIP register in "src\register.rs" as follows:

RegisterInfo { register: Register::EIP, base: Register::EIP, full_register32: Register::RIP, full_register: Register::RIP, size: 4 },
RegisterInfo { register: Register::RIP, base: Register::EIP, full_register32: Register::RIP, full_register: Register::RIP, size: 8 },

According to the usual understanding, shouldn't full_register32 for EIP be EIP instead of RIP? Or is it intentionally set this due to the special nature of the EIP/RIP registers? I'm not sure

progmboy avatar Jul 04 '23 11:07 progmboy

The full_register32() fn was added so you could pass in a GPR and get back a 32-bit register only if all you cared about is 32-bit code.

It makes sense to also return EIP here.

wtfsck avatar Jul 04 '23 13:07 wtfsck