Difference between revisions of "Cynject"

From iPhone Development Wiki
Jump to: navigation, search
m (Example)
m
Line 2: Line 2:
 
usage: cynject <pid> <dylib> [args...]
 
usage: cynject <pid> <dylib> [args...]
 
</pre>
 
</pre>
 +
Injects a dynamic library into an already running process
  
 
== Example==
 
== Example==

Revision as of 04:51, 8 December 2015

usage: cynject <pid> <dylib> [args...]

Injects a dynamic library into an already running process

Example

Description

We want to get the bundle identifier for a certain process.

Creating a dylib

First we create a dylib. We have two different approaches to this. First is to use theos and create a tweak.

%ctor {
	HBLogDebug(@"Bundle Identifier: %@", [%c(NSBundle) mainBundle].bundleIdentifier);
}

After installation, the dylib will be in /Library/MobileSubstrate/DynamicLibraries

We could also use clang with this install script and create the dylib manually.

Injecting

Once we have the dylib

  1. cynject 443 absolute_path/to/your_dylib_path.dylib

Profit

The Bundle identifier should appear in the syslog