06 Feb

Updated Molebox unpacker

During last year, the most common complaint on this blog was "your Molebox unpacker cannot unpack this crazy big EXE of MMORPG game X, Y or Z."

Sounds like an easy problem to fix, right? Well, that's not true - but I finally did it!

TL;DR - new version of unpacker is here: https://www.mediafire.com/?t3xw46s554it5fp

In the rest of the post I'll describe the obstacles I had to overcome while solving this seemingly simple problem.

Delphi TMemoryStream limitation

First, unpacker is written using classic (non-.NET) Delphi and compiled as x86 executable. And standard Delphi streams are retarded. TMemoryStream uses GetMem - which ends up somewhere in Delphi memory manager and VirtualAlloc. That doesn't work well with 800+MB files.

I ended up with implementing custom stream backed by temporary file (CreateFile with FILE_ATTRIBUTE_TEMPORARY | FILE_FLAG_DELETE_ON_CLOSE).

Pointer magic

Since the original unpacker was using TMemoryStream, the whole file was loaded in memory as a continuous memory block and I could easily read/write each byte of file using pointers. Something like this:

Guess what? Files don't work that way.. sad I had to do a full and complete rewrite of all those methods.

Zlib conflicts

Original unpacker was compiled with Delphi 3. Delphi 3 didn't have Zlib library, so you had to supply your own Zlib implementation. But it won't compile with new versions of Delphi, giving error message

Unit Graphutil was compiled with a different version of zlib.TZDecompressionStream.

The solution was to get rid of my Zlib implementation and rewrite all methods that deal with decompression.

ANSI strings

In Delphi 3 all strings were ANSI. Starting from Delphi 2007, strings are Unicode. Since Molebox internally uses ANSI, it required changing quite a few structure definitions and rewriting several string manipulation routines. It's a lot of fun (and source of the most obscure bugs), trust me!

Conclusion

I hope you find this unpacker useful. But if it doesn't work for you, please send me an error report with all the details you can and I'll try to fix it. Have fun!

Download link: https://www.mediafire.com/?t3xw46s554it5fp

57 thoughts on “Updated Molebox unpacker

  1. hello!
    this unpacker helps me alot! however, i find that it can't process Japanese and chinese character correctly. it just put out some meaningless lines in logs, and the file name was replaced by underlines("____.jpg",etc.). because of this, some files was overwritten and missing, can you fix this?
    here are part of logs:

    [i] Extracting Graphics\Maps\Mazes\570_ÎåÖØÊÔÁ¶ËÀÍöÂÝÐý.png
    [i] Extracting Graphics\Maps\Mazes\571_ÁùÖØÊÔÁ¶±±·ç±ùÔ­.png
    [i] Extracting Graphics\Maps\Mazes\572_ÁùÖØÊÔÁ¶±±·ç±ùÔ­.png
    [i] Extracting Graphics\Maps\Mazes\573_ÁùÖØÊÔÁ¶±±·ç±ùÔ­.png
    [i] Extracting Graphics\Maps\Mazes\574_ÆßÖØÊÔÁ¶Ä§»ÃÉ­ÁÖ.png
    [i] Extracting Graphics\Maps\Mazes\575_ÆßÖØÊÔÁ¶Ä§»ÃÉ­ÁÖ.png
    [i] Extracting Graphics\Maps\Mazes\576_°ËÖØÊÔÁ¶¹âÖ®½×ÌÝ.png

    • Molebox 2.x doesn't support Unicode properly, so the non-English filenames are usually badly damaged anyway.

      Could you please upload your files to mega.co.nz or mediafire.com and send me the link? I will try to improve my unpacker and will let you know when it's done.

        • I wasn't able to run your file, it keeps giving error messages in some language I don't understand (Chinese?).

          Please try the hotfix version: https://www.mediafire.com/?t4acraaxas6pact - it should work "better".

          But if it still doesn't work correctly, please help me to get your file running on Windows 7 or Windows XP inside VMWare. I'm specifically interested in regional settings, installed languages, etc.

  2. Hello, Mr. Kao, thank you for the program, it works for me, it works great! * - * emm if not a lot of hassle .. can you help me with a program I have this packaged with UPX you know of ollbyg can help me thanks :)

  3. Hey Kao I just wanted to say that I've been spending a bunch of time reading your blog recently and wanted to thank you for all the info you put out there.

  4. Hello can you help me please !! I want to unpack an .exe file but it is packaged with aspacker and searched for programs all over google and not found eh and as you did for molebox I was wondering if you can create a program that will unpack aspack programs please!

    • My unpacker works only for Molebox v2.x.

      Molebox Virtualization Solution is completely different program. I have an unpacker for it but it is not public yet.

  5. Out of interest, why did you decide to use Delphi at all - is that just what you built v1 in, or is it more suitable for the task than .NET?

    • Plenty of reasons:
      * 10 years ago .NET wasn't that popular. It wasn't preinstalled on WinXP, etc, etc.
      * When you're dealing with custom data structures/encryption/compression algorithms, it's much easier to reimplement them in native code.
      * To make unpackers, you need some sort of PE file manipulation library. I happened to have written one for Delphi already. :)

  6. kao - 2017-03-16 at 09:30
    I have an unpacker for it but it is not public yet.

    hey kao You can contact me? {email_removed}
    I need unpacker in these files so I can set up my online mu server...
    I want you to help me out of unpack this main.exe

    I'm new to this cracker area xD
    {link_removed}

  7. hi,kao

    i send file to your email,please check it,thanks
    i think the file is pack with molebox virtualization solution
    can you unpack it and give me unpack files?
    thanks~

  8. Hello, Kao. I have a program now, use your program can unpack data successfully. However, there is a problem, the file name contains "_". I am sure that these underscores are Chinese characters, is there a way to solve this problem?
    Thank you

    • Read the comments above - the unpacker for Molebox Virtualization Solution is not public. I am still working on it when I get some free time (which is not a lot).. :(

  9. Hi,

    your program gets a Out of Memory Exception as soon it hits 1500MB Memory allocated.
    Is there a workaround for this?

    • This is not a place for begging.

      If you continue this way, I will have no other choice but to ban you from commenting. Please consider this your final warning.

  10. Hello, and thanks for this tool. I can´t unpack moleboxed exe with external data packages, the data is not in the executable, and I can´t scan the data files itself, have you done something with this type of "packaging"? Thanks!

    • In general, it should work automatically when unpacking main EXE. Something like this:

      If it doesn't work for you, please upload EXE + all data files to mega.co.nz or mediafire.com and send me a link. I'll take a look and try to solve the issue.

  11. Help me please unpack this .exe with your program but at the time of using this file in my game I can not log in

    Can you help me unpack it at 100% please weigh 2.5mb

    {link_removed}

    • Please don't make 10 comments with the same request. Any comment with a link inside goes to moderation queue and I need to approve it manually.

      My unpacker works just fine:
      minifighter

      Take all 4 extracted files: Client_unpacked.exe, ACDC.dat, MHPClient.dll and Minifighter.dll, put them in the folder with your game and then your game should work. If it doesn't, it's some problem with the game, not with my unpacker.

      You can try renaming file Client_unpacked.exe to Client.exe and see if that helps.

  12. Hello friend can you help me unpack a file packed with Microsoft Visual C ++ v8.0 2005 please help me !!

    {removed}

    • No. This blog post has nothing to do with Microsoft Visual C++.

      This is your final warning. If you make another off-topic comment, you will be banned.

    • If you can't write proper problem description, I can't help you.

      Make some screenshots, upload your files to mega.co.nz and then I will try to help.

  13. Hey Kao, great job

    I get a

    [+] MD5: 117ce633ceb20f570712d92eabd0c1f5
    [i] Molebox Pro v2.2570
    [i] Loading control information
    [x] Signature seems to be invalid. File is cut? (F8E95781 / B3095878)

    Is there a way to extract it?

    • If you could send me a link to the file, I'll take a look. It might be a broken file or a bug in my unpacker.

  14. {link_removed}
    I have try other pack in above site, all the same result.

    if u can not use pan.baidu , u can also use
    {link_removed}

    • Thank you, I will look at it.

      BTW, comments with links inside are hidden from public. No need to post the same comment again and again. :)

    • Latest version works fine - but it needs a lot of memory and lots of disk space:
      After finish

      Log from the torrent file: https://pastebin.com/DyE1uqhy

      If it doesn't work for you, please make screenshots, explain what exactly you did and send me an email (see bottom of the page). I will try to find and fix your problem.

  15. sorry , it seems that it is ok now. It work on local driver ,
    but in remote dirver like samba or virtualbox share folder it reports [x] EXCEPTION EWriteError
    I move the exe to local drivers , it works ok.

    • I'm happy that you have solved it now. :) Later I'll check my unpacker with the network drive and see if I can find and fix the problem.

Leave a Reply

Your email address will not be published.