Files
Print3M-DllShimmer/templates/dynamic-shim.cpp.template
T
2025-08-26 11:11:50 +02:00

50 lines
960 B
Plaintext

// Generated by DllShimmer (github.com/Print3M/DllShimmer)
//
// Author: Print3M (print3m.github.io/)
{{- $r := . }}
#include "dllshimmer.h"
#include <windows.h>
#include <stdio.h>
{{- range $i, $v := .Functions }}
{{- if eq (len $v.Forwarder) 0 }}
// {{$v.Name}}
extern "C" UINT64 {{$v.Name}}Fwd(PARAMS) {
#ifdef DEBUG
dbgf("{{$v.Name}} called");
#endif
{{ if $r.Mutex }}
if (MUTEX("Global\\{{$v.Name}}__{{$i}}")) {
// Put your code here...
}
{{- else }}
// Put your code here...
{{- end }}
return PROXY_FUNCTION("{{$v.Name}}");
}
{{- end }}
{{- end }}
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
switch (fdwReason) {
case DLL_PROCESS_ATTACH: {
#ifdef DEBUG
dbgf("DLL_PROCESS_ATTACH");
#endif
}
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}