Skip to content

Commit fd70f53

Browse files
authored
feat: support bplist16
2 parents 4e15c9f + c5d3b7f commit fd70f53

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

script.js

+7-5
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,11 @@ function getXPCData(conn, dict, buff, n) {
178178
if (hdr == "bplist15") {
179179
const plist = CFBinaryPlistCreate15(buff, n, NULL);
180180
return ObjC.Object(plist).description().toString();
181-
} else if (hdr == "bplist17") {
181+
} else if (hdr == "bplist16" || hdr == "bplist17") {
182182
if (conn != null) {
183-
return parseBPList17(conn, dict);
183+
return parseBPList(conn, dict);
184184
} else {
185-
return "cannot parse blplist17 for xpc_handler_t";
185+
return `cannot parse ${hdr} for xpc_handler_t`;
186186
}
187187
} else if (hdr == "bplist00") {
188188
const format = Memory.alloc(8);
@@ -217,11 +217,13 @@ function getKeys(description) {
217217
}
218218

219219
// https://github.com/nst/iOS-Runtime-Headers/blob/master/Frameworks/Foundation.framework/NSXPCDecoder.h
220-
function parseBPList17(conn, dict) {
220+
function parseBPList(conn, dict) {
221221
var decoder = NSXPCDecoder.alloc().init();
222222
decoder["- set_connection:"](conn);
223223
decoder["- _startReadingFromXPCObject:"](dict);
224-
return decoder.debugDescription().toString();
224+
var debugDescription = decoder.debugDescription();
225+
decoder.dealloc();
226+
return debugDescription.toString();
225227
}
226228

227229
function extract(conn, xpc_object, dict) {

0 commit comments

Comments
 (0)