59 Commits

Author SHA1 Message Date
Download-Fritz
7c8f51f6f2 OcAppleKernelLib: Remove superfluous STAB check. 2019-03-27 15:20:12 +01:00
vit9696
786b78710b OcAppleKernelLib: Fix vtable integer overflow 2019-03-27 02:30:35 +03:00
Download-Fritz
37e30743fd OcAppleKernelLib: Do not resolve STABs or use them for kmod_info/SMCPs. 2019-03-26 23:16:56 +01:00
vit9696
b9988453e3 OcMachoLib: Fix symbol type comparison 2019-03-27 00:10:21 +03:00
Download-Fritz
61244b5fca OcMachoLib and OcAppleKernelLib: Properly error-check section indices. 2019-03-26 21:20:17 +01:00
Download-Fritz
ac1a32f41e OcAppleKernelLib: Clarify SymbolNumber may not be 0 for sections.
Wrapping around to MAX_UINT32 will cause failure as NumSymbols is UINT32, however it's better to be clear.
2019-03-26 09:41:49 +01:00
Download-Fritz
8995e023aa OcAppleKernelLib: Correctly locate section relocation address. 2019-03-26 09:39:15 +01:00
Download-Fritz
9ed4fd0181 OcAppleKernelLib: Prevent VTable patch data from overflowing LinkBuffer. 2019-03-25 20:42:07 +01:00
Download-Fritz
3907c0633c OcAppleKernelLib: Switch VTable lookup to Worker model. 2019-03-25 19:11:23 +01:00
Download-Fritz
d8d60dfd7c OcAppleKernelLib: Self-scanning symbol lookup functions 2019-03-25 19:11:22 +01:00
Download-Fritz
a455f1ebd3 OcAppleKernelLib: Store the Name pointer instead of StringIndex for prelinked symbols. 2019-03-25 19:11:22 +01:00
vit9696
bc0af1edee OcAppleKernelLib: Optimize hot path on vtable lookup 2019-03-24 17:32:58 +03:00
Download-Fritz
3a1cb95a6c OcAppleKernelLib: Join the VTable patching functions. 2019-03-24 13:53:05 +01:00
Download-Fritz
896610d256 OcAppleKernelLib: Rework dependency symbol location. 2019-03-24 13:17:59 +01:00
Download-Fritz
f760c0ca74 OcMachoLib and OcAppleKernelLib: Silence warnings. 2019-03-24 13:17:29 +01:00
Download-Fritz
ac9f3284c4 OcAppleKernelLib: Security updates.
* Check Symbol Tabel retrieval success.
* Check whether the data to retrieve from __LINKEDIT fits the segment.
* Don't assume undefined symbol presence.
2019-03-24 11:13:47 +01:00
vit9696
2a72e67ac0 Move command stripping to Mach-O lib 2019-03-24 11:52:10 +03:00
vit9696
18e2801759 Fix misleading assertions 2019-03-24 02:55:31 +03:00
vit9696
e169a7aa7e Ensure 1:1 disk:vm mach-o matching requirement during kext inject 2019-03-24 01:50:57 +03:00
Download-Fritz
8454cdd574 OcAppleKernelLib: Retrieve Relocation target via GetPointerByAddress API. 2019-03-23 21:03:54 +01:00
Download-Fritz
6bc824ff38 OcAppleKernelLib: Zero __LINKEDIT tail and LinkBuffer. 2019-03-23 17:59:26 +01:00
Download-Fritz
660cc9dc7f OcAppleKernelLib: Remove already performed alignment check. 2019-03-23 17:39:21 +01:00
Download-Fritz
a9c1f22db3 OcMachoLib: Optionally return MaxSize parameter for GetFileOffset.
OcAppleKernelLib: Adapt calls for security.
2019-03-23 17:36:40 +01:00
Download-Fritz
70278f9ef8 OcMachoLib and OcAppleKernelLib: Remove superfluous symbol range checks. 2019-03-23 17:35:27 +01:00
Download-Fritz
0769d63936 OcAppleKernelLib: Fix the upper boundary from last commit. 2019-03-23 16:10:04 +01:00
Download-Fritz
fccd02d540 OcAppleKernelLib: Verifiy Relocation target is in bounds before accessing. 2019-03-23 16:07:30 +01:00
vit9696
73a2be7637 Recover unnecessary command stripping 2019-03-23 18:03:07 +03:00
vit9696
72b4e55786 Fix invalid Mach-O command handling during kext injection 2019-03-23 17:17:33 +03:00
Download-Fritz
16028f123f OcAppleKernelLib: Scan own symbol table for C++ symbols too. 2019-03-23 15:05:13 +03:00
vit9696
fecc396a46 Do not set kmod header size, as it is incompatible with __TEXT permissions 2019-03-23 15:05:13 +03:00
Download-Fritz
d98cdf28ff OcAppleKernelLib: Add segment VM protection adaption. 2019-03-23 15:05:12 +03:00
Download-Fritz
96f3bff46c OcAppleKernelLib: Add symbol value sanity checks. 2019-03-23 15:05:12 +03:00
Download-Fritz
7f478c0051 OcAppleKernelLib: Update kmod_info after prelinking. 2019-03-23 15:05:12 +03:00
Download-Fritz
caf798b2c0 OcAppleKernelLib: Zero NumExternalSymbols after prelinking. 2019-03-23 15:05:12 +03:00
Download-Fritz
ae77243fd0 OcAppleKernelLib: Correctly assign symbol count. 2019-03-23 15:05:12 +03:00
Download-Fritz
e4784fdcbe OcAppleKernelLib: Correctly save LINKEDIT offsets relative to file start. 2019-03-23 15:05:12 +03:00
Download-Fritz
a59443f7f9 OcAppleKernelLib: Alignment is a power of 2. 2019-03-23 15:05:12 +03:00
Download-Fritz
212e3fbca8 OcAppleKernelLib: Use CopyMem() for potentially unaligned memory accesses. 2019-03-23 15:05:12 +03:00
Download-Fritz
9d9b96112a OcAppleKernelLib: Tolerate invalid VTable offsets. 2019-03-23 15:05:12 +03:00
Download-Fritz
a0e95fb9fb OcAppleKernelLib: Remove faulty padslot relocation sanity check. 2019-03-23 15:05:12 +03:00
Download-Fritz
dbf90dbd2a OcAppleKernelLib: Treat scattered relocs as normal ones, as done in KXLD. Check relocation skipability earlier. 2019-03-23 15:05:12 +03:00
Download-Fritz
5d434aded5 OcAppleKernelLib: Fix prelinking finalization. 2019-03-23 15:05:12 +03:00
vit9696
6b11c5675c Partially fix logic in vtable parsing 2019-03-23 15:05:12 +03:00
vit9696
014ef59b45 Also fix vtable iteration 2019-03-23 15:05:12 +03:00
vit9696
69024af3bd Fix dependency handling logic 2019-03-23 15:05:12 +03:00
Download-Fritz
253d0b6284 OcAppleKernelLib: Implement VTable logic. 2019-03-23 15:05:12 +03:00
Download-Fritz
d92c167a0f OcAppleKernelLib: Move LinkBuffer allocation to the dependency walk 2019-03-23 15:05:12 +03:00
Download-Fritz
bc3dcc55db OcAppleKernelLib: Fix symbol location recursion 2019-03-23 15:05:12 +03:00
Download-Fritz
0bf7b5ce98 OcAppleKernelLib: Compilation fixes 2019-03-23 15:05:12 +03:00
Download-Fritz
f331523dda OcAppleKernelLib: Small security enhancements and warn instead of ASSERT more often 2019-03-23 15:05:12 +03:00