-
Notifications
You must be signed in to change notification settings - Fork 958
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
bin2llvmir produces incorrect LLVM IR when decompiling a simple function in an object file #480
Comments
I was able to reproduce the issue on my system and it seems to be a bug in |
Any update on this would be very useful. @s3rvac @PeterMatula |
Well, I can verify it is a problem, we do not handle object files very well at the moment. I have tasked one of our students to look into objects files decompilation and try to make it better. He will start with #201, but should get around to this as well. |
The problem actually looks very similar to #201. This is our DSM output:
The code of the function did not even got disassembled because of that misdetection of |
Fixed by #577. The current output is: // Address range: 0x0 - 0x6f
int32_t reverseArray(int32_t a1, int32_t result, uint32_t a3) {
// 0x0
int32_t v1; // ebp
__x86_get_pc_thunk_ax(v1);
if (result >= a3) {
// 0x6c
return result;
}
int32_t * v2 = (int32_t *)(4 * result + a1); // bp+21
int32_t * v3 = (int32_t *)(4 * a3 + a1); // bp+44
*v2 = *v3;
*v3 = *v2;
int32_t result2 = result + 1;
while (result2 < a3 - 1) {
// 0x12
a3--;
result = result2;
v2 = (int32_t *)(4 * result + a1);
v3 = (int32_t *)(4 * a3 + a1);
*v2 = *v3;
*v3 = *v2;
result2 = result + 1;
}
// 0x6c
return result2;
} Work with arrays is not very beautiful, but that could be solved in a dedicated issue. The primary problem with relocations in ELF object files was solved. Test added in avast/retdec-regression-tests@e132495. |
Hello Team,
I am trying to decompile a simple function
using
And the output I got is
I am sure that I must be missing something. Can somebody help?
My goal is to play around with the variable recovery feature (like stack variable getting lifted to
allocas ).
The text was updated successfully, but these errors were encountered: