Skip to content

Commit c5d3b7f

Browse files
committed
support bplist16
Signed-off-by: Pedro Tôrres <[email protected]>
1 parent 4d310d0 commit c5d3b7f

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
@@ -93,11 +93,11 @@ function getXPCData(conn, dict, buff, n) {
9393
if (hdr == "bplist15") {
9494
const plist = CFBinaryPlistCreate15(buff, n, NULL);
9595
return ObjC.Object(plist).description().toString();
96-
} else if (hdr == "bplist17") {
96+
} else if (hdr == "bplist16" || hdr == "bplist17") {
9797
if (conn != null) {
98-
return parseBPList17(conn, dict);
98+
return parseBPList(conn, dict);
9999
} else {
100-
return "cannot parse blplist17 for xpc_handler_t";
100+
return `cannot parse ${hdr} for xpc_handler_t`;
101101
}
102102
} else if (hdr == "bplist00") {
103103
const format = Memory.alloc(8);
@@ -132,11 +132,13 @@ function getKeys(description) {
132132
}
133133

134134
// https://github.com/nst/iOS-Runtime-Headers/blob/master/Frameworks/Foundation.framework/NSXPCDecoder.h
135-
function parseBPList17(conn, dict) {
135+
function parseBPList(conn, dict) {
136136
var decoder = NSXPCDecoder.alloc().init();
137137
decoder["- set_connection:"](conn);
138138
decoder["- _startReadingFromXPCObject:"](dict);
139-
return decoder.debugDescription().toString();
139+
var debugDescription = decoder.debugDescription();
140+
decoder.dealloc();
141+
return debugDescription.toString();
140142
}
141143

142144
function extract(conn, xpc_object, dict) {

0 commit comments

Comments
 (0)