calebzulawski / symbol-slasher

Obfuscate shared objects by hashing symbol names
GNU General Public License v3.0
14 stars 3 forks source link

Android support #14

Closed dpanic closed 2 years ago

dpanic commented 2 years ago

Hey,

I tried this on Android .so files.

When I run APK I get this error: E/linker: "!/lib/arm64-v8a/libgojni.so" has invalid shdr offset/size: 14146606/2624

Did you had such problems?

calebzulawski commented 2 years ago

I've never tried it on Android objects but I wouldn't expect them to be any different. Maybe there's a bug in this version of the object parser?

dpanic commented 2 years ago

I saw exactly the same error in UPX.

https://github.com/upx/upx/issues/242

When you set --android-shlib in UPX it works...I did quick look on their source code, and indeed it needs to work differently on different architectures.

ARM 32bit, ARM 64bit...

dpanic commented 2 years ago

Update:

If I disable object->remove(object->static_symbols_section(), true); in file store.h all works perfectly!

Is this okay to do?

calebzulawski commented 2 years ago

In that case, can you try running it with --keep-static?

dpanic commented 2 years ago

In that case, can you try running it with --keep-static?

That should work. I will try it tomorrow.

dpanic commented 2 years ago

One more question, is hashing process inreversible if there is no symbols.json file?

I checked source code, looks like it is inreversible.

calebzulawski commented 2 years ago

Yes, the intention is that it is not reversible.