mirror of https://github.com/infosecn1nja/C3.git
Add debug code and config to Loader
parent
d67e62844f
commit
f3ddc927bd
|
@ -35,7 +35,7 @@
|
|||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
|
@ -55,7 +55,7 @@
|
|||
<CharacterSet>Unicode</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<CharacterSet>Unicode</CharacterSet>
|
||||
|
|
|
@ -339,6 +339,7 @@ void ExecResource(void* baseAddress)
|
|||
LoadPe(resource);
|
||||
}
|
||||
|
||||
#ifdef NDEBUG
|
||||
BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID)
|
||||
{
|
||||
// Indicate successful load of the library.
|
||||
|
@ -347,3 +348,17 @@ BOOL WINAPI DllMain(HINSTANCE instance, DWORD reason, LPVOID)
|
|||
|
||||
return TRUE;
|
||||
}
|
||||
#else
|
||||
|
||||
#include "tlhelp32.h"
|
||||
|
||||
int main()
|
||||
{
|
||||
auto ME32 = MODULEENTRY32{ sizeof(MODULEENTRY32), };
|
||||
auto moduleHandle = CreateToolhelp32Snapshot(TH32CS_SNAPMODULE, GetCurrentProcessId());
|
||||
|
||||
Module32First(moduleHandle, &ME32);
|
||||
CloseHandle(moduleHandle);
|
||||
ExecResource(ME32.modBaseAddr);
|
||||
}
|
||||
#endif
|
||||
|
|
Loading…
Reference in New Issue