Twodayslate (talk | contribs) mNo edit summary |
m (Formatting and proper tag for code.) |
||
Line 1: | Line 1: | ||
Injects a dynamic library into an already running process | Injects a dynamic library into an already running process | ||
== Example= | = Usage = | ||
usage: cynject <pid> <dylib> [args...] | |||
= Example = | |||
== Description == | |||
We want to get the bundle identifier for a certain process. | 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 | |||
< | First we create a dylib. We have two different approaches to this. First is to use [[Iheos]] and create a tweak. | ||
<source lang="logos"> | |||
%ctor { | %ctor { | ||
HBLogDebug(@"Bundle Identifier: %@", [%c(NSBundle) mainBundle].bundleIdentifier); | HBLogDebug(@"Bundle Identifier: %@", [%c(NSBundle) mainBundle].bundleIdentifier); | ||
} | } | ||
</ | </source> | ||
After installation, the dylib will be in <code>/Library/MobileSubstrate/DynamicLibraries</code> | After installation, the dylib will be in <code>/Library/MobileSubstrate/DynamicLibraries</code> | ||
We could also use clang with [https://github.com/Stilldabomb/SSL-Data-Sniffing/blob/master/install.sh this install script] and create the dylib manually. | We could also use clang with [https://github.com/Stilldabomb/SSL-Data-Sniffing/blob/master/install.sh this install script] and create the dylib manually. | ||
== Injecting == | |||
Once we have the dylib | Once we have the dylib | ||
# <code>cynject 443 absolute_path/to/your_dylib_path.dylib</code> | # <code>cynject 443 absolute_path/to/your_dylib_path.dylib</code> | ||
== Profit == | |||
The | |||
The bundle identifier should appear in the syslog |
Latest revision as of 04:00, 26 December 2015
Injects a dynamic library into an already running process
Usage
usage: cynject <pid> <dylib> [args...]
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 Iheos 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
cynject 443 absolute_path/to/your_dylib_path.dylib
Profit
The bundle identifier should appear in the syslog