// alloc memory
m_ImageBase = AllocateMemory( m_hProcess, m_dwImageSize );
// setup message
nlohmann::json jAllocBase;
jAllocBase[ _S( "Data" ) ][ _S( "ID" ) ] = MessageType::SetAllocationBase;
jAllocBase[ _S( "Data" ) ][ _S( "Base" ) ] = ( DWORD )( m_ImageBase );
printf(_S("Adding modules by name...\n"));
// add modules
AddModuleByName( dwClientDll, _S( "client.dll" ) );
AddModuleByName( dwEngineDll, _S( "engine.dll" ) );
AddModuleByName( dwD3D9, _S( "d3d9.dll" ) );
AddModuleByName( dwMaterialSystem, _S( "materialsystem.dll" ) );
AddModuleByName( dwFileSystem, _S( "filesystem_stdio.dll" ) );
AddModuleByName( dwVSTDLib, _S( "vstdlib.dll" ) );
AddModuleByName( dwDataCache, _S( "datacache.dll" ) );
AddModuleByName( dwVPhyiscs, _S( "vphysics.dll" ) );
AddModuleByName( dwInputSystem, _S( "inputsystem.dll" ) );
AddModuleByName( dwLocalize, _S( "localize.dll" ) );
AddModuleByName( dwShaderApiDX9, _S( "shaderapidx9.dll" ) );
AddModuleByName( dwVGui, _S( "vguimatsurface.dll" ) );
AddModuleByName( dwVGui2, _S( "vgui2.dll" ) );
printf("Pushing modules...");
// push modules
jAllocBase[ _S( "Data" ) ][ _S( "Modules" ) ][ _S( "client.dll" ) ] = dwClientDll;
jAllocBase[ _S( "Data" ) ][ _S( "Modules" ) ][ _S( "engine.dll" ) ] = dwEngineDll;
jAllocBase[ _S( "Data" ) ][ _S( "Modules" ) ][ _S( "d3d9.dll" ) ] = dwD3D9;
jAllocBase[ _S( "Data" ) ][ _S( "Modules" ) ][ _S( "materialsystem.dll" ) ] = dwMaterialSystem;
jAllocBase[ _S( "Data" ) ][ _S( "Modules" ) ][ _S( "filesystem_stdio.dll" ) ] = dwFileSystem;
jAllocBase[ _S( "Data" ) ][ _S( "Modules" ) ][ _S( "vstdlib.dll" ) ] = dwVSTDLib;
jAllocBase[ _S( "Data" ) ][ _S( "Modules" ) ][ _S( "datacache.dll" ) ] = dwDataCache;
jAllocBase[ _S( "Data" ) ][ _S( "Modules" ) ][ _S( "vphysics.dll" ) ] = dwVPhyiscs;
jAllocBase[ _S( "Data" ) ][ _S( "Modules" ) ][ _S( "inputsystem.dll" ) ] = dwInputSystem;
jAllocBase[ _S( "Data" ) ][ _S( "Modules" ) ][ _S( "localize.dll" ) ] = dwLocalize;
jAllocBase[ _S( "Data" ) ][ _S( "Modules" ) ][ _S( "shaderapidx9.dll" ) ] = dwShaderApiDX9;
jAllocBase[ _S( "Data" ) ][ _S( "Modules" ) ][ _S( "vgui.dll" ) ] = dwVGui;
jAllocBase[ _S( "Data" ) ][ _S( "Modules" ) ][ _S( "vgui2.dll" ) ] = dwVGui2;
// buffer
auto szImportBuffer = jAllocBase.dump( ).c_str( );
printf("Sending buffer...");
// send buffer
g_RequestManager->SendBuffer( m_Socket, ( void* )( szImportBuffer ), strlen( szImportBuffer ) );
// imports
char aImports[ 16384 ];
ZeroMemory( aImports, 16384 );
printf("Getting buffer...");
// recv buffer
g_RequestManager->RecvBuffer( m_Socket, aImports, 16384 );
// setup import list
m_jImportList = nlohmann::json::parse( aImports );