MCPcopy Create free account
hub / github.com/Binject/universal / FindCodeSigCmd

Function FindCodeSigCmd

codesign_darwin.go:168–183  ·  view source on GitHub ↗
(f *macho.File)

Source from the content-addressed store, hash-verified

166}
167
168func FindCodeSigCmd(f *macho.File) (CodeSigCmd, bool) {
169 get32 := f.ByteOrder.Uint32
170 for _, l := range f.Loads {
171 data := l.Raw()
172 cmd := get32(data)
173 if cmd == LC_CODE_SIGNATURE {
174 return CodeSigCmd{
175 cmd,
176 get32(data[4:]),
177 get32(data[8:]),
178 get32(data[12:]),
179 }, true
180 }
181 }
182 return CodeSigCmd{}, false
183}
184
185func put32be(b []byte, x uint32) []byte { binary.BigEndian.PutUint32(b, x); return b[4:] }
186func put64be(b []byte, x uint64) []byte { binary.BigEndian.PutUint64(b, x); return b[8:] }

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…