People who compress their go binaries (or any other binaries, really) - please be aware that thus doing, you stop the OS from being able to page out your executable (rarely a big loss), and also to be unable to share executable pages (not a huge loss for a 2MB executable, a huge loss for a 100MB executable). If there's only one copy of a program running, it won't matter - but if you are running hundreds of copies (ev…
> and also to be unable to share executable pages (not a huge loss for a 2MB executable, a huge loss for a 100MB executable). I don't think people care about that nowadays, seeing how popular Docker containers are. I think Docker containers already make it so that you cannot share executable memory between different containers because each one runs in its private namespace.
UPX – Ultimate Packer for Executables
61–70 of 82 posts
Re: UPX – Ultimate Packer for Executables
#62Re: UPX – Ultimate Packer for Executables
#63Re: UPX – Ultimate Packer for Executables
#64Earlier quoted context omitted.
> and also to be unable to share executable pages (not a huge loss for a 2MB executable, a huge loss for a 100MB executable). I don't think people care about that nowadays, seeing how popular Docker containers are. I think Docker containers already make it so that you cannot share executable memory between different containers because each one runs in its private namespace.
Do namespaces separate file system caches? That would surprise me.
More specifically I wouldn't expect "free -m" to produce different result depending on the namespace it's run in.
Re: UPX – Ultimate Packer for Executables
#65Just to chip in on my experience on this matter. I use UPX as one of the RE defense method on a couple of Delphi based software we build which our customer runs regularly on their servers. One of the challenge is some A/V throws a false positive upon checking the result files. Somehow this became no longer an issue after applying code-signing to the UPX output executables.
How does UPX defend against reverse engineering? The binary literally contains the code to reverse the UPX compression (otherwise it couldn't run), and I'd expect all antiviruses to be able to unpack UPX executables.
Re: UPX – Ultimate Packer for Executables
#66UPX was also good to protect the code, not only for compacting: 1. I used UPX to compact my Delphi EXE file. 2. Then I openned up any HEXA editor 3. looked for "UPX" string and changed to "222x" Doing this, the UPX unpack tool didn't work and crackers could not easily see or edit my source code with Assembly (as UPX mess with everything!) Thanks UPX :-)
As someone "on the other side ;-)", I don't think you protected much. UPX is pretty much the classic "Hello World" of unpacking manually, and tools like PEid will still be able to tell it's UPX from the decompressor stub alone. It's been years since I unpacked a UPX manually, but I still remember what it looks like: a PUSHA at the start to save all the registers, a lot of decompression code, and finally a POPA and a…
It has been years. I vaguely remember, there is always a general standard way of unpacking.
Using the debugger, you keep track of those jmp instructions until unpacking is done. And then dump the memory to a file.
Re: UPX – Ultimate Packer for Executables
#67I used it to compress a Lazarus (open source Delphi clone) executable. The results were great (executable size reduced by more than 50%, iirc from 2 mb to around 800 kB). Offering a sub MB executable in the era of 100 MB electron apps is totally pioneer :)
I've done the same thing! Shout out to Lazarus/FPC!!!
Re: UPX – Ultimate Packer for Executables
#68I do most of my web-dev in Nim these days. Meaning my ELFs are ultimately produced by GCC og Clang. Everyting statically linked - and I mean everything : For clib I use Musl. And then I UPX the bejesus out of them. It's simply nice to ship a fully working app, with SQLite* and everything, which will basically run anywhere with a Linux kernel, in a single executable far below 2 MB. *) Yes, the vast majority of the wor…
Re: UPX – Ultimate Packer for Executables
#69Earlier quoted context omitted.
> you stop the OS from being able to page out your executable (rarely a big loss) Why is this exactly?
Indeed, as jlebar notes - since the actual executable code (the thing that the CPU executes) does not exist directly in the executable file, the OS will have to write it out to the swap if it needs the memory (unlike uncompressed files, where it just reuses the memory and later reloads from the executable file). It is rarely a big loss, because executables that are in use tend to remain in memory if the program is ac…
That doesn't work for UPX because each execution decompresses anew, which makes it a "new executable" from the OS' point of view. The only thing that would help is kernel space merging, but that's really only activated for some virtual machines.
Re: UPX – Ultimate Packer for Executables
#70Surprised this still exists. A little walk down memory lane: I once ran the exe mailing list for exe packers and protection tools. There was a whole scene of people in the 90s writing such tools and writing unpackers and removal tools for such things. UPX was one of the later ones that still existed when most of this scene vanished.
I just remembered: ProcDump32! Geez, that really blew my mind at the time and in a way still does.