Skip to content

Instantly share code, notes, and snippets.

@oleavr
Last active June 4, 2021 09:07
Show Gist options
  • Save oleavr/e1b76d6cbb7f3e48894e4e69925b148f to your computer and use it in GitHub Desktop.
Save oleavr/e1b76d6cbb7f3e48894e4e69925b148f to your computer and use it in GitHub Desktop.
Frida ObjC.Block example
const pendingBlocks = new Set();
Interceptor.attach(..., {
onEnter(args) {
const block = new ObjC.Block(args[4]);
pendingBlocks.add(block); // Keep it alive
const appCallback = block.implementation;
block.implementation = (success, error) => {
// Do your logging here
appCallback(success, error);
pendingBlocks.delete(block);
};
}
});
@jiaxw32
Copy link

jiaxw32 commented Oct 16, 2020

nice work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment