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

Invalid stack depth change. #7337

Open
rugyi opened this issue Jan 1, 2025 · 0 comments
Open

Invalid stack depth change. #7337

rugyi opened this issue Jan 1, 2025 · 0 comments

Comments

@rugyi
Copy link

rugyi commented Jan 1, 2025

The stack change value is invalid on either MFC80U.DLL, or demangled functions, where the function returns a class/struct (not pointer, or reference of a class).

To reproduce the issue, just create a new project, import the attached exe, and decompile.

Three of MFC80U.DLL calls (CString::Left, CString::Right, CString::Mid) changes the stack by -8 on return, but according to the decompiler it changes only -4 (as can seen on the screenshot). Tried to change the value by hand, but the sw did not allow me to change it to -8, set it to 8 instead.
Most likely it is beacuse the return value is a class, and the compiler passes the returning class pointer as an additional parameter, and ghidra forgets about it.

  • OS: [Win 11]
  • Java Version: [JDK 23.0.1 (64 bit)]
  • Ghidra Version: [11.2.1]
  • Ghidra Origin: [official GitHub distro]

ghidra_bug.zip
ghidra_bug

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

1 participant