mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2026-05-27 13:31:32 +08:00
Fixed issues with dyld_shared_cache parsing
First issue fixed was a simple null deref. The other issue is the dylib's load commands in the dyld_shared_cache should be absolute from zero not relative from the start of the dylib's mach header. When done incorrectly this causes a read past the end of file.
This commit is contained in:
+2
-3
@@ -241,8 +241,7 @@ public class DyldCacheProgramBuilder extends MachoProgramBuilder {
|
|||||||
// locate slide Info
|
// locate slide Info
|
||||||
DyldCacheSlideInfoCommon slideInfo = dyldCacheHeader.getSlideInfo();
|
DyldCacheSlideInfoCommon slideInfo = dyldCacheHeader.getSlideInfo();
|
||||||
if (slideInfo == null || !(slideInfo instanceof DyldCacheSlideInfo2)) {
|
if (slideInfo == null || !(slideInfo instanceof DyldCacheSlideInfo2)) {
|
||||||
log.appendMsg(
|
log.appendMsg("No compatible slide info version");
|
||||||
"Can't handle version " + slideInfo.getVersion() + " slide info, only version 2");
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
DyldCacheSlideInfo2 slideInfo2 = (DyldCacheSlideInfo2) slideInfo;
|
DyldCacheSlideInfo2 slideInfo2 = (DyldCacheSlideInfo2) slideInfo;
|
||||||
@@ -448,7 +447,7 @@ public class DyldCacheProgramBuilder extends MachoProgramBuilder {
|
|||||||
String path) throws Exception {
|
String path) throws Exception {
|
||||||
this.headerAddr = headerAddr;
|
this.headerAddr = headerAddr;
|
||||||
this.header = MachHeader.createMachHeader(MessageLogContinuesFactory.create(log),
|
this.header = MachHeader.createMachHeader(MessageLogContinuesFactory.create(log),
|
||||||
provider, offset);
|
provider, offset, false);
|
||||||
this.header.parse();
|
this.header.parse();
|
||||||
this.path = path;
|
this.path = path;
|
||||||
this.name = new File(path).getName();
|
this.name = new File(path).getName();
|
||||||
|
|||||||
Reference in New Issue
Block a user