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

Error while dumping #34

Open
crypto2011 opened this issue Oct 3, 2019 · 7 comments
Open

Error while dumping #34

crypto2011 opened this issue Oct 3, 2019 · 7 comments

Comments

@crypto2011
Copy link

I have error while dumping UPX-file.
image_dump.py (line 208, fix_imports_by_rebuilding->line 170, find_iat): IndexError in lx = possible_ptrs[-1].
Before dumping I had some errors like raiseUcError(status) Invalid memory write (UC_ERR_WRITE_UNMAPPED) after message GetProcAddress:..... accept
Unfortunately I cannot place trace log here.

@Masrepus
Copy link
Member

Masrepus commented Oct 3, 2019

Can you share the sample?

@crypto2011
Copy link
Author

crypto2011 commented Oct 3, 2019 via email

@crypto2011
Copy link
Author

crypto2011 commented Oct 3, 2019

First trace callback was after log-message
GetProcAddress: module ... user32.dll,... CharToOemA
_ctypes\callbacks.c line 232
unicorn.py line 438
core.py line 231
apicalls.py lines 70, 28, 255, 408
unicorn.py line 401

And after that all hooks were failed (besides already existed)

@Masrepus
Copy link
Member

Masrepus commented Oct 3, 2019

We'll look into this

@crypto2011
Copy link
Author

crypto2011 commented Oct 3, 2019

Error (UC_ERR_READ_UNMAPPED) was while fixing imports in ASPacked file
_ctypes\callbacks.c line 232.
Also have message:
Unimplemented API call at:... HeapAlloc.
What is my actions in this case?

@Masrepus
Copy link
Member

Masrepus commented Oct 3, 2019

So the error in the import rebuilding process seems to indicate that we are not able to find the import address table inside your sample. You could change the self.dumper in the respective unpacker to ImageDump() in order to skip import fixing.

The second thing when the crash occured in apicalls.add_hook seems like your sample calls GetProcAddress so often that we did not reserve enough space in our hook region. This is something that we can fix.

The last thing about an unimplemented API call could be added, but heap handling is currently not supported, as we only saw it in an armadillo sample. But as I said in another issue, unpacking armadillo works in a completely different way, so we didn't look into heap stuff any more. It's not something that packers usually do.

@10maurycy10
Copy link

Can you share the sample?

I have the same problem unpacking this file (gziped to reduce size):
Meinkraft Server DDoS'er.exe.gz

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

3 participants