0cyn / ktool

pip install k2l | Mach-O + Obj-C analysis TUI / CLI kit and library. Zero compiled deps, runs anywhere with a python interpreter.
MIT License
485 stars 24 forks source link

can not parse 32bit macho #47

Closed zxvzxv closed 10 months ago

zxvzxv commented 1 year ago

this code raise an error when parsing 32bit macho file, because the pointer length is not 8bytes. And some objc structures also have differece https://github.com/zxvzxv/ktool/blob/596404b085af4f3c2406251ef3bbbc77b81a4981/src/ktool/objc.py#L117

You can refer to this link, this include 32bit and 64bit objc structures https://github.com/apple-oss-distributions/clang/blob/8204159ac8569f29fddc48862412243c2b79ce8c/src/lib/ObjCMetadata/macho-obj.h

i know it's hard to support 32bit files, and ios/mac is not support 32bit apps in newer version, so i don't expect too much

0cyn commented 1 year ago

Hi, sorry this took so long, finally found some time to work on this project again.

ad4b1e3eb6f84cd5f296198718d443f99e12de7b should resolve this. For the time being you can install this version via python3 -m pip install -U git+https://github.com/0cyn/ktool.git This will land on pypi with the 2.0 version alongside a slew of other features "soon", and I'll close this issue once it's published there.

0cyn commented 10 months ago

Landed