Class: Pliney::AppleCodeSignature::Requirement
- Defined in:
- lib/pliney/apple_code_signature.rb
Overview
An individual code requirement This is actlually a small compiled expression. csreq(1) can be used to decompile them
Constant Summary collapse
- SYSTEM_HAS_CSREQ =
system("which csreq > /dev/null")
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#decompiled ⇒ Object
readonly
Returns the value of attribute decompiled.
Attributes inherited from Blob
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from Blob
Constructor Details
This class inherits a constructor from Pliney::AppleCodeSignature::Blob
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
173 174 175 |
# File 'lib/pliney/apple_code_signature.rb', line 173 def data @data end |
#decompiled ⇒ Object (readonly)
Returns the value of attribute decompiled.
173 174 175 |
# File 'lib/pliney/apple_code_signature.rb', line 173 def decompiled @decompiled end |
Class Method Details
.decompile(data) ⇒ Object
181 182 183 184 185 186 187 188 |
# File 'lib/pliney/apple_code_signature.rb', line 181 def self.decompile(data) return nil unless SYSTEM_HAS_CSREQ csreq=IO.popen("csreq -r- -t", "r+") csreq.write(data) decompiled = csreq.read() csreq.close() return decompiled end |
Instance Method Details
#parse ⇒ Object
174 175 176 177 178 179 |
# File 'lib/pliney/apple_code_signature.rb', line 174 def parse super() do @data=rest() @decompiled = self.class.decompile([@magic.value, @size, @data].pack("NNA*")) end end |