Skip to content

Instantly share code, notes, and snippets.

@pich4ya
Created May 29, 2018 12:21
Show Gist options
  • Save pich4ya/6c509d82f4853c1daed06f013a87acac to your computer and use it in GitHub Desktop.
Save pich4ya/6c509d82f4853c1daed06f013a87acac to your computer and use it in GitHub Desktop.
Objection / Frida patch IPA / applesign with large content
Problem:
$ /path/to/applesign -r -i xxx -m /path/to/embedded.mobileprovision -c resigned.ipa
Unzipping /path/to/resigned.ipa
Cleaning up /private/tmp/resignz/resigned.ipa....
Cleaning up /private/tmp/resignz/resigned.ipa....
Cleaning up /private/tmp/resignz/resigned.ipa....
{ Error: stdout maxBuffer exceeded
at Socket.onChildStdout (child_process.js:326:14)
at Socket.emit (events.js:180:13)
at addChunk (_stream_readable.js:274:12)
at readableAddChunk (_stream_readable.js:257:13)
at Socket.Readable.push (_stream_readable.js:218:10)
at Pipe.onread (net.js:581:20)
cmd: '/usr/bin/unzip -o /private/tmp/IPA.hgs/resigned.ipa -d /private/tmp/IPA.hgs/resigned.ipa....' } undefined
Solution:
Edit the file /usr/local/lib/node_modules/applesign/tools.js
From:
function execProgram (bin, arg, opt, cb) {
if (!opt) {
opt = {};
}
opt.maxBuffer = 1024 * 1024;
return childproc.execFile(bin, arg, opt, cb);
}
To:
function execProgram (bin, arg, opt, cb) {
if (!opt) {
opt = {};
}
opt.maxBuffer = Infinity;
return childproc.execFile(bin, arg, opt, cb);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment