Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does detours need huge extra memory? #33

Closed
jizhideyu opened this issue Aug 15, 2018 · 4 comments
Closed

Does detours need huge extra memory? #33

jizhideyu opened this issue Aug 15, 2018 · 4 comments

Comments

@jizhideyu
Copy link

jizhideyu commented Aug 15, 2018

I use DetourCreateProcessWithDll to create my app process and find the process use 1.6g memory in win task-manager view. Normally, my app use 0.8g memory in win task-manager view.
It's confuse that i can only catch the 0.8g memory using (by hooking NtAllocateVirtualMemory and VirtualAlloc ) when use DetourCreateProcessWithDll.
I want to know what's the problem?

@dstd
Copy link

dstd commented Aug 15, 2018

@jizhideyu if you use sucha formatting to force everybody to give up reading your message looks like you achieved your goal..

@jizhideyu
Copy link
Author

@dstd I'm sorry. I have edited my comment.

@Arefu
Copy link

Arefu commented Aug 22, 2018

Not an expert by any means, but would this have something to do with it?

After the detour DLL has been loaded, it should reverse changes to the in-memory import table by calling DetourRestoreAfterWith. To facilitate reversing these changes, DetourCreateProcessWithDll copies relevant reversal data into a payload in the target process using the DetourCopyPayloadToProcess API. The loaded DLL should call the DetourRestoreAfterWith API to restores the contents of the import table.

@dtarditi
Copy link
Contributor

dtarditi commented Jan 23, 2019

@jizhideyu, did you ever figure out what was going on? No, Detours doesn't normally use huge amounts of extra memory. It could increase your virtual memory usage through its placement of the modified import tables. But it should not increase your physical memory usage significantly.

@ghost ghost locked as resolved and limited conversation to collaborators Jan 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants