Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Question] The full_register32 of EIP is RIP? #430

Open
progmboy opened this issue Jul 4, 2023 · 1 comment
Open

[Question] The full_register32 of EIP is RIP? #430

progmboy opened this issue Jul 4, 2023 · 1 comment

Comments

@progmboy
Copy link

progmboy commented Jul 4, 2023

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

@wtfsck
Copy link
Member

wtfsck commented Jul 4, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants