appdecrypt icon indicating copy to clipboard operation
appdecrypt copied to clipboard

Universal binary segmentation fault

Open gzz2000 opened this issue 2 years ago • 2 comments

When fed with a universal binary like this:

% file Shadowrocket
Shadowrocket: Mach-O universal binary with 2 architectures: [arm_v7:
- Mach-O executable arm_v7] [arm64]
Shadowrocket (for architecture armv7):	Mach-O executable arm_v7
Shadowrocket (for architecture arm64):	Mach-O 64-bit executable arm64

The release version will get a segmentation fault:

zsh: segmentation fault  ./appdecrypt "/.../Shadowrocket.app" 

The debug version trips over an assertion:

appdecrypt/dump.swift:112: Assertion failed
zsh: trace trap  .build/debug/appdecrypt "/.../Shadowrocket.app"

where the code at line 112 is:

    assert(header.pointee.magic == MH_MAGIC_64)

This is likely to be the reason of https://github.com/paradiseduo/appdecrypt/issues/18, too.

I don't know the exact mechanism of encryption with a universal binary. I guess there should be some implementation to automatically extract the matching architecture only, or just throws an error message warning user about the existence of universal binaries.

gzz2000 avatar Feb 04 '23 13:02 gzz2000

fouldecrypt may be handling it.

HenryQuan avatar Oct 15 '23 05:10 HenryQuan

fouldecrypt may be handling it.

Yeah, it seems the code you pointed to does exactly handle universal binaries. fouldecrypt only runs on iOS so I hope appdecrypt may support universal binaries likely. I am not familiar with swift or otherwise I could have started working on it.

gzz2000 avatar Oct 24 '23 13:10 gzz2000