Skip to content

Commit

Permalink
feat: support bplist16
Browse files Browse the repository at this point in the history
  • Loading branch information
NSEcho committed Mar 17, 2024
2 parents 4e15c9f + c5d3b7f commit fd70f53
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions script.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,11 +178,11 @@ function getXPCData(conn, dict, buff, n) {
if (hdr == "bplist15") {
const plist = CFBinaryPlistCreate15(buff, n, NULL);
return ObjC.Object(plist).description().toString();
} else if (hdr == "bplist17") {
} else if (hdr == "bplist16" || hdr == "bplist17") {
if (conn != null) {
return parseBPList17(conn, dict);
return parseBPList(conn, dict);
} else {
return "cannot parse blplist17 for xpc_handler_t";
return `cannot parse ${hdr} for xpc_handler_t`;
}
} else if (hdr == "bplist00") {
const format = Memory.alloc(8);
Expand Down Expand Up @@ -217,11 +217,13 @@ function getKeys(description) {
}

// https://github.com/nst/iOS-Runtime-Headers/blob/master/Frameworks/Foundation.framework/NSXPCDecoder.h
function parseBPList17(conn, dict) {
function parseBPList(conn, dict) {
var decoder = NSXPCDecoder.alloc().init();
decoder["- set_connection:"](conn);
decoder["- _startReadingFromXPCObject:"](dict);
return decoder.debugDescription().toString();
var debugDescription = decoder.debugDescription();
decoder.dealloc();
return debugDescription.toString();
}

function extract(conn, xpc_object, dict) {
Expand Down

0 comments on commit fd70f53

Please sign in to comment.