Exetools

Exetools (https://forum.exetools.com/index.php)
-   Community Tools (https://forum.exetools.com/forumdisplay.php?f=47)
-   -   mupack (https://forum.exetools.com/showthread.php?t=17028)

mudlord 08-31-2015 11:21

mupack
 
1 Attachment(s)
This is a small executable packer that I have been working on and off for some time. The public build is restricted compared to the private one, but it still packs alright. There is some bugs:

Known bugs:
* Resources are not compressed in certain cases. Might redo resource compression to fix this.
* TLS callbacks with DLLs don��t work fully. TLS callback tables and ptrs need to be relocated via the relocs.
* Proxy TLS callback not implemented. I guess this is a feature as atm it works like a antidebug trick. Ideally it should handle TLS callbacks cleanly to ease debugging.
* Crash when unpacking VBA-Ms Wx build. Not sure why, need to fix the above TLS issue before fixing this. This would make debugging a lot easier.
* Digital code signing when executables are packed does not work.

Source code:
Quote:

https://github.com/mudlord/mupack

mudlord 10-05-2015 03:51

1 Attachment(s)
Updated:
* Rewrote resource compression. Fixes a known bug of not compressing executables in certain cases.

mudlord 11-09-2015 04:15

1 Attachment(s)
Updated:

* Rewrote TLS callback emulation. As a result, there is preliminary TLS callback in DLL support as well as easier debugging of EXE/DLL files with TLS callbacks. I found one case where TLS callbacks/index variables in DLLs doesn't work properly, need to debug that use case more.
* More work on handling uncompressed resources, fixes some bugs.

mudlord 11-10-2015 06:49

1 Attachment(s)
Updated:

* Fixed any TLS regressions from last build. DLL support for TLS callbacks is still preliminary, though.
* Now updates the PE file checksum.
* Added a small TLS callback on TLS using executables to fix any possible invalid TLS addresses.

giv 11-11-2015 04:43

1 Attachment(s)
Cool utility.
I guess the unpacking will not be difficult as i see into the stub:
Code:

0049A000 m>  BB 00000000          MOV EBX,0x0
0049A005    E9 03000000          JMP mupack_p.0049A00D
0049A00A    C2 0C00              RETN 0xC
0049A00D    8D83 00A04900        LEA EAX,DWORD PTR DS:[EBX+<ModuleEntr>
0049A013    53                    PUSH EBX
0049A014    50                    PUSH EAX                              ; mupack_p.0041F394
0049A015    8D83 7EA04900        LEA EAX,DWORD PTR DS:[EBX+0x49A07E]
0049A01B    FFD0                  CALL EAX                              ; mupack_p.0041F394
0049A01D    8D83 94F34100        LEA EAX,DWORD PTR DS:[EBX+0x41F394]
0049A023  - FFE0                JMP EAX                              ; mupack_p.0041F394


mudlord 11-11-2015 06:23

Yeah, my private builds focus on compression ratio, using completely different compression algorithms. I designed it to be easy to depack. Figured theres no point in trying protection since people will crack it anyway. The public build is there so there is no real loss if people misuse it, although there might still be a possibility of that happening. :( Pity the taggant scheme for packers is a crock of sh*t. (only useful for commercial stuff, not freeware) And digital signatures do nothing too.

Plus, many packers like ASPack, PESpin and mpress seem to miss crucial things like proper TLS callback support. I guess now I need to work out overlay support, and fully reentrant DLL entry points. (so it doesn't needlessly depack itself over and over)

Atm I am trying to debug a nice (as in, interesting and hard) test case with DLLs with TLS. For some reason there is one flaw there, but other DLLs with TLS callbacks work fine. Dunno if its something to do with reentrancy though.

mudlord 12-15-2015 08:44

1 Attachment(s)
Do not share outside EXETools.com, otherwise development will cease.

Updated:
* removed asmjit, replaced with Xbyak.
* added DLL reentrancy.
* saved bytes in entrypoint, down to 34 bytes.
* removed aplib (lzss based), replaced with a lz77+arithmetic coder backend:
double the depacker size (around 360 bytes compared to 160 bytes for aplib), yet a much improved compression ratio, nearing the private packer builds compression ratio in some cases, which uses LZMA.

bolo2002 12-16-2015 00:21

Quote:

Originally Posted by mudlord (Post 103310)
Do not share outside EXETools.com, otherwise development will cease.

you can't avoid it,the only way is to share it with private people that you trust with in.

mudlord 12-16-2015 18:10

True, but I can ask for some common basic human decency?

I guess that is too much to ask for? If thats the case, might as well stop dev already. So far I haven't noticed any leaks which is nice, hopefully it stays that way, otherwise development can go back to being completely private.

bolo2002 12-17-2015 00:38

Quote:

Originally Posted by mudlord (Post 103330)
True, but I can ask for some common basic human decency?
.

i'm afraid it's not anymore a world to expect that,you may trust in me as i think like you but it's not the place to expand psychology :)

regards!

giv 12-20-2015 17:13

Quote:

Originally Posted by mudlord (Post 103330)
True, but I can ask for some common basic human decency?

There are so many retarded people in the RE forums that it will sell your program in a few minutes after you put on public. The time teach me that some users are present including this site.
So NO do not ask for that.
:)

CryptXor 12-20-2015 19:25

Quote:

Originally Posted by giv (Post 103414)
There are so many retarded people in the RE forums that it will sell your program in a few minutes after you put on public. The time teach me that some users are present including this site.
So NO do not ask for that.
:)

Unfortunately that is a little too true... Brutal... But too true :(

mudlord 12-20-2015 21:14

Yep, as proven by the most recent leak and using download credits on some website (so in practise, it being sold)....
So instead, will stick to people that I know and trust, like what was done a few months ago.
At least with that, might as well experiment with taggants too down the track.

giv 12-21-2015 15:04

From past experience the "developers" will take your program and edit the resources to wipe your name and put his on credits and sell your thing as his.
Many of my scripts was selled too for hundreds of EUR even i put them on sites for free.
This happened with CodeCracker tools and many other developers work.
So for me is a strong "NO" for put for free my work because i know what will happen next.
:)

mudlord 12-21-2015 21:17

In that case, no point releasing the x64 port when its finished.

mudlord 12-24-2015 04:59

As a direct response to the leaker, I have documented the main depacker internals. I might do a static unpacker, too.

Quote:

http://www.mudlord.info/blog/?p=286
I have no intention of obfuscation at all. Being transparent should be a goal of any ethical programmer. Hopefully this stops any ideas of people using the packer to pack malware.

mudlord 01-07-2016 16:53

1 Attachment(s)
Updated:

* better error handling when handling invalid files (already mupacked files, .NET assemblies, x64 files).
* tested post packing digital code signing.

dj-siba 01-07-2016 21:52

Nice tool

Dragging an executable on mupack_pub.exe won't start packing.
Packing section take some time, at first i thought it freezes during while loop or something, it would be nice to have some text like "Wait...Packing" while packing.
Also what about merging all section into one section ? no options tab ?

About Compression ratio: Have you done some exe packer comparison with similar tools ? (uPack/XPack/MEW/..)

mudlord 01-08-2016 02:23

Quote:

Dragging an executable on mupack_pub.exe won't start packing.
Nice idea, I should add commandline support.

Quote:

Packing section take some time, at first i thought it freezes during while loop or something, it would be nice to have some text like "Wait...Packing" while packing.
Another nice idea, I'll add that.

Quote:

Also what about merging all section into one section ? no options tab ?
Merging all sections would take a rewrite, although it should help compression ratio. I didn't see the need for a options tab, what options should there be? :)

Quote:

About Compression ratio: Have you done some exe packer comparison with similar tools ? (uPack/XPack/MEW/..)
No, I should though.

evlncrn8 01-08-2016 08:29

blog seems down chief, also firefox reports the site as serving malware... if i tell it to ignore it i get a 404 on the link you posted for the 'response' ... kinda sucks someone leaked, i know what that feels like.. really makes you question the motives of some people

mudlord 01-08-2016 10:55

Yah, Google in thier infinite wisdom blocked my site thanks to some false positives on some demos & files I coded, because I used a packer. And its impossible to get them to unblock because the review process seems to be entirely automated.

I tried working around it by setting Apache settings to make http://mudlord.info/blog usable instead, but that broke Wordpress entirely.

At least now the people at the taggant team have a PDF of the depacker internals, hopefully they can spread it amongst the cabal so they can autodepack it like UPX.

mr.exodia 01-08-2016 16:21

@mudlord you could try setting a subdomain with some aliasing, but chances are google blocked your entire domain range :)

evlncrn8 01-08-2016 19:57

automated blacklisting is a recipe for disaster...

dj-siba 01-08-2016 23:35

Quote:

Originally Posted by mudlord (Post 103706)
I didn't see the need for a options tab, what options should there be? :)

There are many:
Strip TLS
Strip Reloc
Strip Debug
Strip Delphi Resources
Don't compress resource
Preserve Overlay
Merge Sections
Compression Algo
...

mudlord 01-17-2016 16:47

Quote:

Originally Posted by evlncrn8 (Post 103722)
automated blacklisting is a recipe for disaster...

I know, but I proved it happened: Managed to unblacklist my site just by password protecting ZIPs/RARs with packed files.

Quote:

Strip TLS
Some executables might need it.

Quote:

Strip Reloc
Might be needed for some executables, mandatory for DLLs.

Quote:

Strip Debug
Useful feature to strip. Will have to do some research to see which section debug data is stored in.

Quote:

Strip Delphi Resources
Could you elaborate?

Quote:

Don't compress resource
Better yet, selectable section compression.

Quote:

Preserve Overlay
Overlay preservation is a feature I must add, especially when there is plenty of Flash games around these days.

Quote:

Merge Sections
Would like to add. Would need to experiment with some things, such as the rebuilt resource section after resources compression.

Quote:

Compression Algo
Private build already does this dynamically depending on the file size. It also does better compression with the default compression algorithm. But whats in there currently thats public is already pretty good as it. It sure beats LZO/aplib/zlib/LZ4/lzss. I have some ideas to further improve the compression algorithm though, but I got a private x64 rewrite in progress though.

dj-siba 01-18-2016 17:23

Quote:

Strip Delphi Resources
Could you elaborate?
Strip VCLAL and PACKAGEINFO resources
Quote:

Private build already does this dynamically depending on the file size
Nice, so that's why it's one file drop pack and Go :)

mudlord 01-19-2016 08:22

Quote:

Originally Posted by dj-siba (Post 103878)
Strip VCLAL and PACKAGEINFO resources

Thanks for the info.

Quote:

Originally Posted by dj-siba (Post 103878)
Nice, so that's why it's one file drop pack and Go :)

Yes, the private build uses a high compression variant of whats in the public build as well as LZMA1. LZMA2 wasn't chosen since thats just 7z related, and not compression algo related. It changes on the fly since LZMA works well on files on large file sizes whereas the LZ77+range coder works well on small-medium file sizes. There is also a tradeoff when using the HC variant of LZ77+range coder, in terms of speed, so thats taken into account too. I'm quite proud of that.

CryptXor 01-19-2016 21:29

Have you tried alternatives to LZMA by any chance?

mudlord 01-20-2016 08:02

LZMA1 seemed to be one of the best, if not the best for compression ratio vs decompressor size.

mudlord 03-16-2016 05:29

1 Attachment(s)
Started work on dj-siba's requests, next version will have at least commandline support for integration into MSVC and other things.

mudlord 04-08-2016 20:08

1 Attachment(s)
Updated:

* Added commandline support.

mudlord 04-09-2016 17:25

1 Attachment(s)
Updated:

* Hack around commandline issues.
* Fixed bug on displaying depacker stub size.

Max 04-14-2016 10:16

The last 2 version does not work in windows xp.

It prompt exe is not a valid win32 application.

Storm Shadow 04-14-2016 13:34

im not on xp , but try.

Code:

D:\mupack>editbin /SUBSYSTEM:WINDOWS,5.1 mupack_pub.exe
ref
https://supportxpdotcom.wordpress.com/2012/03/30/editbins-dirty-little-secret/

mudlord 04-21-2016 10:46

1 Attachment(s)
Updated:

* Fixed compiler flags to work on XP again, sorry about that.

cybercoder 04-30-2016 09:58

Also you could change MajorLinkerVersion to 0E, MajorOperatingSystemVersion to 5, MinorOperatingSystemVersion to 01, MajorSubsystemversion to 5 and MinorSubsystemversion to 1 inside optional header to make it run on xp.. Although this solution is not really needed.. it's another way :)

mudlord 05-13-2016 05:44

To me its preferred if its done upstream, like its supposed to be. It was meant to be fixed, as it was a bug after all.

Abaddon 05-21-2016 20:08

Quote:

Originally Posted by cybercoder (Post 105072)
Also you could change MajorLinkerVersion to 0E, MajorOperatingSystemVersion to 5, MinorOperatingSystemVersion to 01, MajorSubsystemversion to 5 and MinorSubsystemversion to 1 inside optional header to make it run on xp.. Although this solution is not really needed.. it's another way :)

Setting:

[a] peHeader.MajorOperatingSystemVersion = 5;
[b] peHeader.MinorOperatingSystemVersion = 1;
[c] peHeader.MajorSubsystemVersion = 5;
[d] peHeader.MinorSubsystemVersion = 1;

would make a binary run under XP, although setting only [a] and [c] should suffice...
Having the source, however, mudlord's is the way to follow.

mudlord 07-05-2016 07:42

For those that care, released the source code to the current public and private versions of the packer.

Code:

https://github.com/mudlord/mupack
Code:

http://mudlord.info/crap/mupack.rar
Password: www.mudlord.info


jvoisin 12-11-2016 05:09

What made you change your mind about releasing the source code? I thought that you said that it won't happen.


All times are GMT +8. The time now is 23:55.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
Always Your Best Friend: Aaron, JMI, ahmadmansoor, ZeNiX