mirror of
https://github.com/SteamAutoCracks/DepotDownloaderMod.git
synced 2026-02-13 21:30:58 +01:00
70 lines
1.2 KiB
C++
70 lines
1.2 KiB
C++
|
|
|
|
#include <winsock2.h>
|
|
#include <windows.h>
|
|
|
|
#include "clientapp.h"
|
|
|
|
#include "logger.h"
|
|
#include "udpconnection.h"
|
|
#include "wshooks.h"
|
|
#include "crypto.h"
|
|
|
|
|
|
// define our clientapp entry point
|
|
CLIENTAPP( main );
|
|
|
|
|
|
CLogger *g_Logger = NULL;
|
|
CUDPConnection *g_udpConnection = NULL;
|
|
|
|
|
|
int main( int argc, char **argv )
|
|
{
|
|
AllocConsole();
|
|
|
|
g_Logger = new CLogger( argv[ 0 ] );
|
|
g_udpConnection = new CUDPConnection( argv[ 0 ] );
|
|
|
|
Detour_WSAStartup->Attach();
|
|
|
|
|
|
// load the real client app
|
|
HMODULE steamUI = LoadLibrary( "SteamUI.dll" );
|
|
if ( !steamUI )
|
|
{
|
|
MessageBox( HWND_DESKTOP, "Unable to load SteamUI.", "Oops!", MB_OK );
|
|
return -1;
|
|
}
|
|
|
|
SteamDllMainFn realSteamMain = ( SteamDllMainFn )GetProcAddress( steamUI, "SteamDllMain" );
|
|
if ( !realSteamMain )
|
|
{
|
|
MessageBox( HWND_DESKTOP, "Unable to find Steam entrypoint.", "Oops!", MB_OK );
|
|
return -1;
|
|
}
|
|
|
|
int ret = realSteamMain( argc, argv );
|
|
|
|
FreeLibrary( steamUI );
|
|
|
|
|
|
// udp
|
|
Detour_recvfrom->Detach();
|
|
Detour_WSASendTo->Detach();
|
|
|
|
// tcp
|
|
Detour_WSARecv->Detach();
|
|
Detour_WSASend->Detach();
|
|
|
|
Detour_WSAStartup->Detach();
|
|
|
|
|
|
delete g_Crypto; // cleanup crypto hooks
|
|
delete g_udpConnection;
|
|
|
|
delete g_Logger;
|
|
|
|
return ret;
|
|
}
|