Android so UPX Packers

Source: Internet
Author: User

There is an Android so (dynamic link library) UPX Reinforcement Guide, in detail how to use UPX to Android so Shell, try to do a result OK, here only to record a few small problems encountered.

1, 40k and below so can not shell

[Email protected]:~/src$ upx.out a.out
Ultimate PackerFor executables
Copyright (C) 1996-2011
UPX 3.08 Markus Oberhumer, Laszlo Molnar & John reiser Dec 12th 2011

File size Ratio Format Name
--------------------   ------   -----------   -----------
Upx.out:a.out:notcompressibleexception

Packed 1 file:0 OK, 1 error.

Fix, add the following code

int Const dummy_to_make_this_compressible[10000] = {1,2,3};
2, no init section of so can not add shell

[Email protected]:~/src$ readelf- D a.out

Dynamic section at offset 0xe28 contains entries:
Tag Type Name/value
0x0000000000000001 (NEEDED) Shared library: [libc.so.6]
0x000000000000000c (INIT) 0x400460
0x000000000000000d (FINI) 0x400694
0x0000000000000019 (Init_array) 0x600e10

[email protected]:~/src$ upx_diy.out libcmxsecd.so
                        Ultimate Packer for executables
                           Copyright (C) 1996-
UPX 1.02        Markus oberhumer, Laszlo Molnar & John reiser    Mar 30th

        File size          ratio      format      Name
  - -------------------  ------  -----------  -----------
Upx_diy.out: Libcmxsecd.so:UnknownExecutableFormatException

Packed 0 files.

Above, no (INIT) so cannot be added shell, workaround, by compiling option to join:

First define a function,

void my_init () {}

Compile-time Add compile option in Android.mk

Local_ldflags + =-wl,-init=my_init

3, for Android so reinforcement?

After UPX after the shell of So, through IDA can not be static analysis, there is better protection ability. But the weakness is also obvious, through the upx-d parameter can be perfectly stripped off.

But DIY source code, only our own compiled upx.out can take off the OH;)

4. Focus on Changelog

Https://www.pysol.org:4443/hg/upx.hg/log

https://sourceforge.net/p/upx/bugs/

Special attention to this discussion: https://sourceforge.net/p/upx/bugs/223/

Android so UPX Packers

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.