Comments (8)
Hey @andermoran
I'll work on flushing out the Installation instructions. The major step that's currently missing is that you must add the MachOKit framework target as a Target Dependency of your application (Select your application target and look under the Build Phases tab). This will tell Xcode to build the MachOKit framework for whatever platform+arch your application is building for.
from macho-kit.
Installation instructions expanded in 9c1251a.
from macho-kit.
Still having issues with it. What's the fastest way to contact you? I need to get this working ASAP as I'm trying to use it for a school project!
from macho-kit.
Hey @andermoran
What's the latest issue? There is not a lot of information in your original post, but it looks like you built the MachOKit framework and then added that to your project, instead of adding the MachOKit Xcode project.
I was able to create a new macOS application Xcode project, drop in MachOKit.xcodeproj, add MachOKit framework as an embedded binary, and start using MachOKit from the new project without any problems. I'm also working on another project - Mach-O Explorer - that uses Mach-O Kit, if you want to see a working example of this setup.
Xcode subprojects are well understood and are used in many projects. Try searching for "Xcode subproject" in your favorite search engine.
Lastly, double check that you included the --recursive
option when cloning Mach-O Kit, as shown in the ReadMe. This is very important.
from macho-kit.
It works but maybe also include that they need to import MachOKit in their file! Also does this work on iOS binaries that are decrypted?
from macho-kit.
Can you put an example of you using your kit in Objective-C?
from macho-kit.
Mach-O Kit should parse unencrypted binaries from all Apple platforms (macOS, iOS, tvOS, watchOS, and their respective simulators) but almost all testing thus far has been with macOS binaries.
from macho-kit.
Here is the Objective-C Metadata example from the ReadMe, in Objective-C
MKMemoryMap *memoryMap = [MKMemoryMap memoryMapWithContentsOfFile:[NSURL fileURLWithPath:@"/Applications/Calculator.app/Contents/MacOS/Calculator"] error:nil];
// Instantiate an instance of MKMachOImage to begin parsing the Calculator binary
MKMachOImage *macho;
{
MKFatBinary *fat = [[MKFatBinary alloc] initWithMemoryMap:memoryMap error:nil];
if (fat) {
// It's a FAT binary, find the x86_64 slice
for (MKFatArch *slice in fat.architectures) {
if (slice.cputype == CPU_TYPE_X86_64) {
// Instantiate an instance of MKMachOImage to parse the slice
macho = [[MKMachOImage alloc] initWithName:"calculator" flags:0 atAddress:slice.offset inMapping:memoryMap error:nil];
break;
}
}
} else {
// Not a FAT binary
macho = [[MKMachOImage alloc] initWithName:"calculator" flags:0 atAddress:0 inMapping:memoryMap error:nil];
}
NSAssert(macho != nil, @"Failed to initialize MKMachOImage");
}
// Find the MKObjCClassListSection
for (MKSection *section in macho.sections.allValues) {
// Mach-O Kit instantiates a specialized subclass of MKSection when it encounters a section containing Objective-C class list metadata
if ([section isKindOfClass:MKObjCClassListSection.class]) {
MKObjCClassListSection *classListSection = (MKObjCClassListSection*)section;
// Print all the class names
for (MKPointerNode *clsPointer in classListSection.elements) {
// The __objc_(n)classlist sections are just a list of pointers to class structures in the data section
MKObjCClass *cls = clsPointer.pointee.value;
// The pointer to the class name is stored in the class data
MKObjCClassData *clsData = cls.classData.pointee.value;
// Finally, the name is a pointer to a string in the strings section
MKCString *clsName = clsData.name.pointee.value;
NSLog(@"%@", clsName);
}
}
}
from macho-kit.
Related Issues (18)
- what the different with LC_Symtab and LC_DYSYMTAB ? HOT 6
- Error on getting String Table HOT 4
- Replace @import with #import for support of .mm files HOT 1
- The node description system should be reworked further
- Swift metadata parsing
- Modernize the dyld shared cache parser
- Improve testing
- can i get the category Class, such as name HOT 2
- Any chance to support CocoaPods? HOT 4
- Handle Chained Fixups
- Handle βSmallβ ObjC Method Lists HOT 1
- Can not find MKDataModel+Layout_Internal.h HOT 2
- Missing include HOT 1
- Infinite recursion in core.h when __cplusplus defined
- Some wrong libMachO includes in MachOKit HOT 1
- Example of symbols enumeration HOT 6
- __cfstring Section HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
π Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. πππ
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google β€οΈ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from macho-kit.