<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.theiphonewiki.com/w/index.php?action=history&amp;feed=atom&amp;title=Patchfinder</id>
	<title>Patchfinder - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.theiphonewiki.com/w/index.php?action=history&amp;feed=atom&amp;title=Patchfinder"/>
	<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Patchfinder&amp;action=history"/>
	<updated>2026-05-08T21:21:48Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.31.14</generator>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Patchfinder&amp;diff=31815&amp;oldid=prev</id>
		<title>Http: add external references</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Patchfinder&amp;diff=31815&amp;oldid=prev"/>
		<updated>2013-04-15T13:06:26Z</updated>

		<summary type="html">&lt;p&gt;add external references&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;Revision as of 13:06, 15 April 2013&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 2:&lt;/td&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 2:&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&amp;#160;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&amp;#160;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&amp;#160;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Previously it was a lot of work to find all the kernel offsets manually and due to the number of different devices and firmwares, this task is always more and more work. That's why [[planetbeing]] has written some code to dynamically search for the offsets. This code was used the first time in the [[evasi0n]] jailbreak.&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&amp;#160;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Previously it was a lot of work to find all the kernel offsets manually and due to the number of different devices and firmwares, this task is always more and more work. That's why [[planetbeing]] has written some code to dynamically search for the offsets. This code was used the first time in the [[evasi0n]] jailbreak.&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty&quot;&gt;&amp;#160;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;+&lt;/td&gt;
  &lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty&quot;&gt;&amp;#160;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;+&lt;/td&gt;
  &lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== External References ==&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty&quot;&gt;&amp;#160;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;+&lt;/td&gt;
  &lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [https://github.com/planetbeing/ios-jailbreak-patchfinder github: planetbeing/ios-jailbreak-patchfinder]&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td colspan=&quot;2&quot; class=&quot;diff-empty&quot;&gt;&amp;#160;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;+&lt;/td&gt;
  &lt;td style=&quot;color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* [http://conference.hitb.org/hitbsecconf2013ams/materials/D2T1%20-%20Pod2g,%20Planetbeing,%20Musclenerd%20and%20Pimskeks%20aka%20Evad3rs%20-%20Swiping%20Through%20Modern%20Security%20Features.pdf Slides from HITB presentation in Amsterdam 2013]&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&amp;#160;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&amp;#160;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&amp;#160;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Header File ==&lt;/div&gt;&lt;/td&gt;
  &lt;td class=&quot;diff-marker&quot;&gt;&amp;#160;&lt;/td&gt;
  &lt;td style=&quot;background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Header File ==&lt;/div&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;!-- diff cache key theiphon_wikidb:diff:wikidiff2:1.12:old-31813:rev-31815:1.7.2:0 --&gt;
&lt;/table&gt;</summary>
		<author><name>Http</name></author>
		
	</entry>
	<entry>
		<id>https://www.theiphonewiki.com/w/index.php?title=Patchfinder&amp;diff=31813&amp;oldid=prev</id>
		<title>Http: initial page</title>
		<link rel="alternate" type="text/html" href="https://www.theiphonewiki.com/w/index.php?title=Patchfinder&amp;diff=31813&amp;oldid=prev"/>
		<updated>2013-04-15T13:02:55Z</updated>

		<summary type="html">&lt;p&gt;initial page&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Patchfinder]] analyzes a binary iOS kernel to determine function offsets and where to apply the canonical jailbreak patches.&lt;br /&gt;
&lt;br /&gt;
Previously it was a lot of work to find all the kernel offsets manually and due to the number of different devices and firmwares, this task is always more and more work. That's why [[planetbeing]] has written some code to dynamically search for the offsets. This code was used the first time in the [[evasi0n]] jailbreak.&lt;br /&gt;
&lt;br /&gt;
== Header File ==&lt;br /&gt;
 #ifndef PATCHFINDER_H&lt;br /&gt;
 #define PATCHFINDER_H&lt;br /&gt;
 &lt;br /&gt;
 #include &amp;lt;stdint.h&amp;gt;&lt;br /&gt;
 #include &amp;lt;string.h&amp;gt;&lt;br /&gt;
 &lt;br /&gt;
 // Helper gadget.&lt;br /&gt;
 uint32_t find_memmove(uint32_t region, uint8_t* kdata, size_t ksize);&lt;br /&gt;
 &lt;br /&gt;
 // Use for write-anywhere gadget.&lt;br /&gt;
 uint32_t find_str_r1_r2_bx_lr(uint32_t region, uint8_t* kdata, size_t ksize);&lt;br /&gt;
 &lt;br /&gt;
 // Helper gadget for changing page tables / patching.&lt;br /&gt;
 uint32_t find_flush_dcache(uint32_t region, uint8_t* kdata, size_t ksize);&lt;br /&gt;
 &lt;br /&gt;
 // Helper gadget for changing page tables.&lt;br /&gt;
 uint32_t find_invalidate_tlb(uint32_t region, uint8_t* kdata, size_t ksize);&lt;br /&gt;
 &lt;br /&gt;
 // This points to kernel_pmap. Use that to change the page tables if necessary.&lt;br /&gt;
 uint32_t find_pmap_location(uint32_t region, uint8_t* kdata, size_t ksize);&lt;br /&gt;
 &lt;br /&gt;
 // Write 0 here.&lt;br /&gt;
 uint32_t find_proc_enforce(uint32_t region, uint8_t* kdata, size_t ksize);&lt;br /&gt;
 &lt;br /&gt;
 // Write 1 here.&lt;br /&gt;
 uint32_t find_cs_enforcement_disable_amfi(uint32_t region, uint8_t* kdata, size_t ksize);&lt;br /&gt;
 &lt;br /&gt;
 // Write 1 here.&lt;br /&gt;
 uint32_t find_cs_enforcement_disable_kernel(uint32_t region, uint8_t* kdata, size_t ksize);&lt;br /&gt;
 &lt;br /&gt;
 // Change this to non-zero.&lt;br /&gt;
 uint32_t find_i_can_has_debugger_1(uint32_t region, uint8_t* kdata, size_t ksize);&lt;br /&gt;
 &lt;br /&gt;
 // Change this to what you want the value to be (non-zero appears to work).&lt;br /&gt;
 uint32_t find_i_can_has_debugger_2(uint32_t region, uint8_t* kdata, size_t ksize);&lt;br /&gt;
 &lt;br /&gt;
 // NOP out the conditional branch here.&lt;br /&gt;
 uint32_t find_vm_map_enter_patch(uint32_t region, uint8_t* kdata, size_t ksize);&lt;br /&gt;
 &lt;br /&gt;
 // Change the conditional branch here to an unconditional branch.&lt;br /&gt;
 uint32_t find_vm_map_protect_patch(uint32_t region, uint8_t* kdata, size_t ksize);&lt;br /&gt;
 &lt;br /&gt;
 // Change the conditional branch here to an unconditional branch.&lt;br /&gt;
 uint32_t find_tfp0_patch(uint32_t region, uint8_t* kdata, size_t ksize);&lt;br /&gt;
 &lt;br /&gt;
 // Write this with a jump to the sandbox hook, then write a trampoline back to just after the jump you wrote here. Sandbox hook should look at the path in *(r3 + 0x14) and force&lt;br /&gt;
 // it to be allowed if it is outside of /private/var/mobile, or inside of /private/var/mobile/Library/Preferences but not /private/var/mobile/Library/Preferences/com.apple*&lt;br /&gt;
 // To force it to allow, *r0 = 0 and *(r0 + 0x4) = 0x18. If not, just call the original function via the trampoline.&lt;br /&gt;
 uint32_t find_sb_patch(uint32_t region, uint8_t* kdata, size_t ksize);&lt;br /&gt;
 &lt;br /&gt;
 // Utility function, necessary for the sandbox hook.&lt;br /&gt;
 uint32_t find_vn_getpath(uint32_t region, uint8_t* kdata, size_t ksize);&lt;br /&gt;
 &lt;br /&gt;
 // Utility function, necessary for the sandbox hook.&lt;br /&gt;
 uint32_t find_memcmp(uint32_t region, uint8_t* kdata, size_t ksize);&lt;br /&gt;
 &lt;br /&gt;
 // Dereference this, add 0x38 to the resulting pointer, and write whatever boot-args are suitable to affect kern.bootargs.&lt;br /&gt;
 uint32_t find_p_bootargs(uint32_t region, uint8_t* kdata, size_t ksize);&lt;br /&gt;
 &lt;br /&gt;
 // This gets the zone_page_table array in osfmk/kern/zalloc.c. Useful for diagnosing problems with the zone allocator.&lt;br /&gt;
 uint32_t find_zone_page_table(uint32_t region, uint8_t* kdata, size_t ksize);&lt;br /&gt;
 &lt;br /&gt;
 // Function to free leaked ipc_kmsg objects&lt;br /&gt;
 uint32_t find_ipc_kmsg_destroy(uint32_t region, uint8_t* kdata, size_t ksize);&lt;br /&gt;
 &lt;br /&gt;
 // Function to find the syscall 0 function pointer. Used to modify the syscall table to call our own code.&lt;br /&gt;
 uint32_t find_syscall0(uint32_t region, uint8_t* kdata, size_t ksize);&lt;br /&gt;
 &lt;br /&gt;
 // Function used to free any dead ports we find to clean up after memory leak.&lt;br /&gt;
 uint32_t find_io_free(uint32_t region, uint8_t* kdata, size_t ksize);&lt;br /&gt;
 &lt;br /&gt;
 // Function used to find IOLog for printing debug messages&lt;br /&gt;
 uint32_t find_IOLog(uint32_t region, uint8_t* kdata, size_t ksize);&lt;br /&gt;
 &lt;br /&gt;
 #endif&lt;/div&gt;</summary>
		<author><name>Http</name></author>
		
	</entry>
</feed>