13

I recently do some study about executable compression. When compile the test.c C language source and compress it with UPX in Linux not windows. It is list in Terminal: UPX: test.so NotCompressibleException. The source code of test.c is:

int main(){
    int i = 0;
    printf("HelloWorld\n");
    return 0;
}

What am I guessing is that the executable file is too simple to compress? Or may be I missed something? If there is anyone know about this issue, Please tell me the reason. If nobody tell me I have to read source code to find out the issue. Ah! reading source code burden.

1 Answer 1

19

There are several reasons to output a NotCompressibleException, but in your case it is simply because the size of your binary is too small. UPX cannot handle binaries under 40Kb.

The best way to workaround this problem is to compile your binary in static mode, in order to get a bigger executable file. So, just try: gcc -static -o mytest mytest.c and then upx -o mytest-upx mytest.

1

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.