ipsw icon indicating copy to clipboard operation
ipsw copied to clipboard

Feature Request: Mach-O signer

Open CRKatri opened this issue 2 years ago • 18 comments

The ability to sign binaries is in jtool2 and would be very useful in ipsw too.

CRKatri avatar Feb 22 '22 20:02 CRKatri

I like where your head's at! 🤘

blacktop avatar Feb 23 '22 00:02 blacktop

Also, more importantly, the jtool2 -vv --sig command. This is very useful when inspecting a signature.

CRKatri avatar Mar 20 '22 17:03 CRKatri

dude... I thought we were cool... 😢

ipsw macho info MACHO --sig -V
ipsw macho info MACHO --dump-cert -V

https://blacktop.github.io/ipsw/docs/commands/macho/#macho-info---sig

blacktop avatar Mar 20 '22 17:03 blacktop

I feel stupid 🤦🏻‍♂️, next time I'll read the docs before commenting.

CRKatri avatar Mar 20 '22 17:03 CRKatri

It's cool, I make all these awesome features for my beloved community and don't do a good job advertising them, which is probably why I see people recreating features from ipsw all the time 😞 , it's also my fault for writing it in Go I suppose 😉

blacktop avatar Mar 20 '22 17:03 blacktop

Well trust me, they do not go unappreciated (pun not intended). I'll make sure to read the docs more thoroughly in the future 😆. You have so many awesome features in here sometime I lose track of what you already have.

CRKatri avatar Mar 20 '22 17:03 CRKatri

Just to update you on this initial feature request, I'm hopefully going to take another, 🤞 final, attempt at making a "near perfect" dsc splitter, which requires a LOT of macho re-writing, so once I get into that "flow" I should be able to add custom signatures etc.

blacktop avatar Mar 20 '22 18:03 blacktop

Could you extend ipsw macho info --sig to work on a .app bundle directly? i.e. ipsw macho info --sig -V TestApp.app instead of ipsw macho info --sig -V TestApp.app/TestApp

CRKatri avatar Mar 21 '22 12:03 CRKatri

Could you extend ipsw macho info --sig to work on a .app bundle directly? i.e. ipsw macho info --sig -V TestApp.app instead of ipsw macho info --sig -V TestApp.app/TestApp

done

blacktop avatar Mar 22 '22 01:03 blacktop

I think the correct way is to actually first check if path.app/Info.plist exists, if it does then get the name of the executable from the CFBundleExecutable key and read path.app/CFBundleExecutableVal if path.app/Info.plist doesn't exist, then read path.app/Contents/Info.plist and read path.app/Contents/MacOS/CFBundleExecutableVal

CRKatri avatar Mar 22 '22 01:03 CRKatri

I tried to fix this myself but Go syntax confuses me, sorry.

CRKatri avatar Mar 22 '22 01:03 CRKatri

ah interesting, that does make sense, I checked a handful of apps and they all worked, but that is a much better solution.

blacktop avatar Mar 22 '22 01:03 blacktop

Not saying I will or that it makes sense to, but if I re-wrote ipsw do you think Swift of Rust would be better?

blacktop avatar Mar 22 '22 01:03 blacktop

Swift definitely. I am not a fan of rust, it is incredibly slow to compile and makes huge binaries. It's package manager is also not very good in my opinion. But personally I think ipsw is perfectly fine in Go, I plan on learning go in the future so hopefully I can help you out then.

CRKatri avatar Mar 22 '22 01:03 CRKatri

ah interesting, that does make sense, I checked a handful of apps and they all worked, but that is a much better solution.

The current solution will work for most macOS apps. However it won't work for iOS apps.

CRKatri avatar Mar 22 '22 02:03 CRKatri

Is there a comprehensive list of fields for those two plists anywhere? I figure there might be other interesting fields that I could start mining etc, for example: CFBundleURLSchemes 🤔

blacktop avatar Mar 22 '22 02:03 blacktop

https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Introduction/Introduction.html seems to list some stuff.

CRKatri avatar Mar 22 '22 03:03 CRKatri

should be good now (wrt .apps) 🤞

blacktop avatar Mar 22 '22 04:03 blacktop

😏

blacktop avatar Jan 12 '23 22:01 blacktop