Skip to content

Conversation

@jackylai0
Copy link

Fix:

  • Use only Windows API for dll injection and profiling
  • Preserve last error code from original malloc / free
  • Delay injection until process entry point is reached
  • Hook realloc and calloc for profiling
  • Allow space in injection dll's path
  • Allocate enough buffer in injected process for dll path
    New:
  • Support Visual C++ 2010 or later
  • Support running on Windows XP
  • Update MinHook library
  • Enable hooking of msvcrt.dll's malloc and free
  • Write injection log to InjectLog.txt

jackylai0 and others added 20 commits May 16, 2016 23:46
…lowed

to use thread local before CRT initialization
SuspendThread is not enough to guarantee safe initialization of
bookkeeping data
…ntly.

Remove the need to manually update MinHook project when upgrading Visual C++.
I decided to ditch the changes to make the profiler not use malloc for now. They didn't compile.

I'll resurrect these after assesing whether some third party hash table would do the job better.

# Conflicts:
#	Heapy/Heapy.vcxproj
#	HeapyInject/HeapyInject.vcxproj
#	ProfileTestApplication/ProfileTestApplication.vcxproj
#	Readme.md
#	TestApplication/TestApplication.vcxproj
#	libs/MinHook/build/VC12/libMinHook.vcxproj
#	libs/MinHook/src/HDE/hde32.h
#	libs/MinHook/src/HDE/hde64.h
#	libs/MinHook/src/hook.cpp
#	libs/MinHook/src/trampoline.cpp
@lukedodd
Copy link
Owner

I honestly can't remember what happened with this line of work - but I'm looking at incorporating these changes now @jackylai0. I'm planning on adding some other features soon and wanted a good starting point. Branch merge_jackylais_work.

@jackylai0
Copy link
Author

jackylai0 commented Mar 29, 2020

"I decided to ditch the changes to make the profiler not use malloc for now. They didn't compile."

@lukedodd You mean HeapAllocator? It is based on VS2010 std::allocator and modify to use HeapAlloc/HeapFree instead. Maybe std::allocator changes is too extensive and have to re-adapted for VS2019.

@jackylai0
Copy link
Author

@lukedodd Please check my latest commits. I merged your branch again and fixed various bugs (including HeapAllocator compile error).

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants