11.07.2015 Views

Down the Rabbit Hole - Reverse Engineering Mac OS X

Down the Rabbit Hole - Reverse Engineering Mac OS X

Down the Rabbit Hole - Reverse Engineering Mac OS X

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Code Injection DetailsAllocate a remote thread stack. No need to populate it— parameters will be passed in registers.Allocate and populate <strong>the</strong> thread’s code block. The gotchahere is determining <strong>the</strong> thread entry’s code size. It’ssurprisingly hard, and requires a calling <strong>the</strong> dynamicloader APIs and stat()’ing <strong>the</strong> file system!Allocate, populate and start <strong>the</strong> thread. Set <strong>the</strong> threadcontrol block’s srr0 to <strong>the</strong> code block, r1 to <strong>the</strong>stack, r3 through r10 to parameters and lr to0xDEADBEEF (this thread should never return).Monday, February 9, 2009

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!