UPX or Other Compression Tools

282 views
Skip to first unread message

Javier Ibañez

unread,
Jan 31, 2012, 8:45:00 AM1/31/12
to google-brea...@googlegroups.com
Hi, 

Did anyone manage to get breakpad and UPX (or similar) play nicely? I found that if I compress the binary, even after I got the symbols, the minidump is not really useful. Is there a way to make this work? 

Thanks,
-Javier

Ted Mielczarek

unread,
Feb 1, 2012, 8:01:26 AM2/1/12
to google-brea...@googlegroups.com

I haven't heard of anyone doing this. I assume that UPX is rearranging
the binary somehow and doesn't rearrange the PDB files to match, so
the resulting symbols no longer match the actual binary. I don't
really know enough about UPX to say anything more.

-Ted

Matthew Endsley

unread,
Feb 22, 2012, 5:59:03 PM2/22/12
to google-brea...@googlegroups.com

TL;DR: possible but requires you to patch the dmp file slightly.

It's definitely possible to use crash dumps from UPX compressed binaries, it just requires a bit of magic.  The addresses in the dump file will match the uncompressed exe/pdb but when the dump file is created the UPX module checksum is written.

We use UPX to compress all shipping binaries, and we keep a copy of the uncompressed pdb/exe.  Our crashes are annotated with version information so we can match these up to the uncompressed files. We then use this small tool to patch up the dmp checksum to match the uncompressed executable.  This lets something like Visual Studio work with the dump as it would if the shipping binary wasn't compressed.

I uploaded the code for the tool to github in case you're interested: https://github.com/mendsley/remapPDB

Caveats:  It has windows specific code (sorry) and it assumes there's one, and only one, .exe file in the dmp file, and that the exe is the first entry in the module list (again windows specific, and again sorry).  Although it was written specifically to our needs at the time, I'm sure you could modify it to any strange requirements you have.  Feel free to do whatever you want with it.

Javier Ibañez

unread,
Jun 11, 2012, 10:58:01 AM6/11/12
to google-brea...@googlegroups.com
Hey Matthew, 

I just saw your reply. I didn't move forward with this yet, as I had other priorities, but now I'll give it a try. Thanks a lot for the contribution, it's very useful!

Regards,
-Javier
Reply all
Reply to author
Forward
0 new messages