Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Universal binary segmentation fault #22

Open
gzz2000 opened this issue Feb 4, 2023 · 2 comments
Open

Universal binary segmentation fault #22

gzz2000 opened this issue Feb 4, 2023 · 2 comments

Comments

@gzz2000
Copy link

gzz2000 commented Feb 4, 2023

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 #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.

@HenryQuan
Copy link
Contributor

fouldecrypt may be handling it.

@gzz2000
Copy link
Author

gzz2000 commented Oct 24, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants