Files

68 lines
1.7 KiB
Plaintext

// Generated by DllShimmer (https://github.com/Print3M/DllShimmer)
//
// Author: Print3M (https://print3m.github.io/)
#include <stdio.h>
#include <iostream>
// Put your imports here...
// #------------------------------------------------------------------#
// | "DON'T TOUCH" ZONE |
// | (auto generated) |
// #------------------------------------------------------------------#
{{- range .Functions}}
#define {{.OriginalName}} {{.OriginalName}}Original
{{- end}}
#include "dllshimmer.h"
#include <windows.h>
{{- range .Functions}}
#undef {{.OriginalName}}
{{- end}}
{{ $r := . }}
// #------------------------------------------------------------------#
// | END OF "DON'T TOUCH" ZONE |
// #------------------------------------------------------------------#
{{- range $i, $v := .Functions }}
{{- if eq (len $v.Forwarder) 0 }}
extern "C" __declspec(dllimport) UINT64 {{$v.OriginalName}}(PARAMS);
extern "C" UINT64 {{$v.ProxyName}}(PARAMS) {
#ifdef DEBUG
dbgf("{{$v.OriginalName}} called");
#endif
{{ if $r.Mutex }}
if (MUTEX("Global\\{{$v.OriginalName}}__{{$i}}")) {
// Put your code here...
}
{{- else }}
// Put your code here...
{{- end }}
return {{$v.OriginalName}}(ARGS);
}
{{- end }}
{{- end }}
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) {
switch (fdwReason) {
case DLL_PROCESS_ATTACH: {
#ifdef DEBUG
dbgf("DLL_PROCESS_ATTACH event");
dbgCurrentDirectory();
#endif
}
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}