![]() |
|
|
|
#1
|
|||
|
|||
|
Thank you for sharing your code atom0s! I've used something very similar to it before I created these template projects. The reason I opted to use complete ASM instead of inline is because it isn't supported by VC in x64 builds, only x86.
Additionally, calling your InitializeProxy (and thus LoadLibrary) from DllMain can cause the process to deadlock under certain conditions. For this reason, MSDN specifically advises people not to call LoadLibrary from DllMain. Although I've never encountered it happen in practice, that could change in the future or in edge cases. That's why I opted to delay the loading until one of its functions is actually called. Either approach works though.
|
| The Following User Says Thank You to zeffy For This Useful Post: | ||
Indigo (07-19-2019) | ||
|
#2
|
||||
|
||||
|
Quote:
|
|
#3
|
|||
|
|||
|
Quote:
I've actually been working on simplifying my project using macros similar to how you did (except in the assembly), which has made it much easier to maintain compared to before. I also fixed the "random" crashing bug that I referred to earlier (which was caused by stack corruption and some of the volatile registers getting mutilated by my proc resolver function ). If you or anyone else is interested in taking a look, here's an example of the changes I've made:https://github.com/zeffy/proxydll_te...inmm/winmm.asm Edit: OK I really fixed the register mutilation now... I was restoring r8 to r9 and r9 to r8 in the last commit.
Last edited by zeffy; 08-31-2017 at 10:10. Reason: really fixed now |
![]() |
| Tags |
| dll, hijacking |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Windows Handle Hijacking | TechLord | General Discussion | 2 | 05-15-2017 20:11 |