08.05.2013 Views

AlexSyScan13

AlexSyScan13

AlexSyScan13

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.

Surviving as an Injected DLL<br />

■ DllMain is the only piece of code that will run while in the<br />

hotpatching process<br />

■ After it exits, the hotpatcher will try to find valid hotpatch data<br />

(more on this later)<br />

■ If no data is found, the thread is terminated and the DLL unloaded!<br />

■ One should therefore:<br />

■ Use CreateThread and/or the Vista Thread Pool API to spawn off a new<br />

thread<br />

■ Use LdrAddRefDll<br />

■ Makes the DLL immune to the hotpatcher’s LdrUnloadDll<br />

■ ~15 lines of code and you’ve got a universally loadable DLL<br />

■ But it has to be on disk…

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

Saved successfully!

Ooh no, something went wrong!