Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <windows.h>
- #include <defs.h>
- extern int dword_10003114;
- extern char aFindleaderboar[];
- extern char aOnfindleaderbo[];
- extern char aLeaderboardCuo[];
- extern char aUploadscore[];
- extern char aOnuploadscore[];
- extern char aScoreCouldNotB[];
- extern char aDownloadscore[];
- extern char aOndownloadscor[];
- extern _UNKNOWN unk_100031D1;
- extern int (__stdcall *off_100031D8)(int, int, int, int);
- extern int (__stdcall *off_100031E8)(int, int, int, int);
- extern int (__stdcall *off_100031F8)(int, int, int, int);
- extern char aFail[];
- extern char aClosingSteam[];
- extern char aDone_[];
- extern int (__stdcall *off_100034E8)(int, int, int, int);
- extern int (__stdcall *off_100034F8)(int, int, int, int);
- extern int (__stdcall *off_10003508)(int, int, int, int);
- extern char aName[5];
- extern char aS[];
- extern char aDesc[5];
- extern char aRequeststatsFa[];
- extern char aStorestatsFail[];
- extern _UNKNOWN unk_100038AC;
- extern int __security_cookie;
- extern _UNKNOWN unk_10005238;
- extern _UNKNOWN unk_100088E8;
- extern _UNKNOWN unk_10008CBC;
- extern int dword_10008CC4;
- extern int dword_10008CC8;
- extern char byte_10008CCC;
- extern int dword_10008CD0;
- #define __thiscall __cdecl
- int __stdcall sub_10001170(int a1);
- int __thiscall sub_10001210(void *this, int a2, char a3);
- char __stdcall sub_10001260(int a1);
- int __stdcall sub_10001310(int a1, char a2);
- char __cdecl sub_10001350();
- int __thiscall sub_10001400(void *this, int a2, char a3);
- int __thiscall sub_100014A0(int this, int a2);
- signed int __cdecl sub_100014C0();
- int __thiscall sub_100014D0(int this, int a2, int a3, int a4, int a5);
- signed int __cdecl sub_10001510();
- int __stdcall sub_10001520(int a1);
- double __cdecl SteamInit();
- double __cdecl SteamRunCallbacks();
- double __cdecl SteamShutdown();
- double __cdecl SteamStoreStats();
- double __cdecl SteamSetStatInt(const char *a1, double a2);
- double __cdecl SteamSetStat(const char *a1, double a2, double a3);
- double __cdecl SteamFindLeaderboard(int a1);
- double __cdecl SteamUploadScore(double a1);
- double __cdecl SteamDownloadScores();
- double __cdecl SteamGetScoreForPosition(double a1);
- int __cdecl SteamGetNameForPosition(double);
- double __cdecl SteamGetGlobalRankForPosition(double a1);
- double __cdecl SteamResetAllStats(double a1);
- double __cdecl SteamIncreaseStat(const char *a1, double a2);
- signed int __cdecl sub_10001A20();
- int __thiscall sub_10001A50(int this);
- int __thiscall sub_10001A60(int this, int a2, int a3, int a4, int a5);
- signed int __cdecl sub_10001AA0();
- int __stdcall sub_10001AB0(int a1);
- char __stdcall sub_10001CC0(const char *a1, double a2, double a3);
- char __stdcall sub_10001D60(const char *a1, int a2);
- char __stdcall sub_10001DE0(const char *a1, int a2);
- char __stdcall sub_10001E60(const char *a1, double a2);
- int __stdcall nullsub_1(int);
- int __cdecl sub_100026EC();
- int (*__cdecl sub_100027B0())(void);
- BOOL __stdcall DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved);
- int __cdecl sub_10002B92();
- int __cdecl sub_10002BD1(int a1, int a2);
- int __usercall sub_10001000<eax>(int result<eax>)
- {
- *(_DWORD *)result = 0;
- *(_DWORD *)(result + 4) = 0;
- *(_DWORD *)(result + 8) = 0;
- *(_DWORD *)(result + 16) = 0;
- *(_DWORD *)(result + 48) = 0;
- *(_DWORD *)(result + 80) = 0;
- *(_DWORD *)(result + 112) = 0;
- *(_DWORD *)(result + 144) = 0;
- *(_DWORD *)(result + 176) = 0;
- *(_DWORD *)(result + 208) = 0;
- *(_DWORD *)(result + 240) = 0;
- *(_DWORD *)(result + 272) = 0;
- *(_DWORD *)(result + 304) = 0;
- *(_DWORD *)(result + 20) &= 0xFF0FFFFFu;
- *(_DWORD *)(result + 52) &= 0xFF0FFFFFu;
- *(_DWORD *)(result + 84) &= 0xFF0FFFFFu;
- *(_DWORD *)(result + 116) &= 0xFF0FFFFFu;
- *(_DWORD *)(result + 148) &= 0xFF0FFFFFu;
- *(_DWORD *)(result + 180) &= 0xFF0FFFFFu;
- *(_DWORD *)(result + 212) &= 0xFF0FFFFFu;
- *(_DWORD *)(result + 244) &= 0xFF0FFFFFu;
- *(_DWORD *)(result + 276) &= 0xFF0FFFFFu;
- *(_DWORD *)(result + 308) &= 0xFF0FFFFFu;
- *(_BYTE *)(result + 23) = 0;
- *(_DWORD *)(result + 20) &= 0xFFF00000u;
- *(_BYTE *)(result + 55) = 0;
- *(_DWORD *)(result + 52) &= 0xFFF00000u;
- *(_BYTE *)(result + 87) = 0;
- *(_DWORD *)(result + 84) &= 0xFFF00000u;
- *(_BYTE *)(result + 119) = 0;
- *(_DWORD *)(result + 116) &= 0xFFF00000u;
- *(_BYTE *)(result + 151) = 0;
- *(_DWORD *)(result + 148) &= 0xFFF00000u;
- *(_BYTE *)(result + 183) = 0;
- *(_DWORD *)(result + 180) &= 0xFFF00000u;
- *(_BYTE *)(result + 215) = 0;
- *(_DWORD *)(result + 212) &= 0xFFF00000u;
- *(_BYTE *)(result + 247) = 0;
- *(_DWORD *)(result + 244) &= 0xFFF00000u;
- *(_BYTE *)(result + 279) = 0;
- *(_DWORD *)(result + 276) &= 0xFFF00000u;
- *(_BYTE *)(result + 311) = 0;
- *(_DWORD *)(result + 308) &= 0xFFF00000u;
- *(_BYTE *)(result + 340) = 0;
- *(_DWORD *)(result + 336) = &off_100031D8;
- *(_DWORD *)(result + 352) = 0;
- *(_DWORD *)(result + 356) = 0;
- *(_DWORD *)(result + 360) = 0;
- *(_DWORD *)(result + 364) = 0;
- *(_DWORD *)(result + 344) = 1104;
- *(_BYTE *)(result + 372) = 0;
- *(_DWORD *)(result + 368) = &off_100031E8;
- *(_DWORD *)(result + 384) = 0;
- *(_DWORD *)(result + 388) = 0;
- *(_DWORD *)(result + 392) = 0;
- *(_DWORD *)(result + 396) = 0;
- *(_DWORD *)(result + 376) = 1106;
- *(_BYTE *)(result + 404) = 0;
- *(_DWORD *)(result + 400) = &off_100031F8;
- *(_DWORD *)(result + 416) = 0;
- *(_DWORD *)(result + 420) = 0;
- *(_DWORD *)(result + 424) = 0;
- *(_DWORD *)(result + 428) = 0;
- *(_DWORD *)(result + 408) = 1105;
- return result;
- }
- int __stdcall sub_10001170(int a1)
- {
- int v1;
- int v2;
- int v3;
- int v4;
- int result;
- int v6;
- v2 = dword_10008CC8;
- printf("FindLeaderboard\n");
- *(_DWORD *)v2 = 0;
- *(_DWORD *)(v2 + 4) = 0;
- v3 = SteamUserStats();
- v1 = (*(int (__thiscall **)(int, int))(*(_DWORD *)v3 + 84))(v3, a1);
- v6 = v4;
- if ( *(_QWORD *)(v2 + 352) )
- SteamAPI_UnregisterCallResult(v2 + 336, *(_DWORD *)(v2 + 352), *(_DWORD *)(v2 + 356));
- result = v6;
- *(_DWORD *)(v2 + 352) = v1;
- *(_DWORD *)(v2 + 356) = v6;
- *(_DWORD *)(v2 + 360) = v2;
- *(_DWORD *)(v2 + 364) = sub_10001210;
- if ( v6 | v1 )
- result = SteamAPI_RegisterCallResult(v2 + 336, v1, v6);
- return result;
- }
- int __thiscall sub_10001210(void *this, int a2, char a3)
- {
- int result;
- void *v4;
- v4 = this;
- ((void (__cdecl *)(_DWORD))printf)("OnFindLeaderboard\n");
- result = a2;
- if ( !*(_BYTE *)(a2 + 8) || a3 )
- {
- result = printf("Leaderboard cuold not be found\n");
- }
- else
- {
- *(_DWORD *)v4 = *(_DWORD *)a2;
- *((_DWORD *)v4 + 1) = *(_DWORD *)(a2 + 4);
- }
- return result;
- }
- char __stdcall sub_10001260(int a1)
- {
- int v1;
- char result;
- int v3;
- int v4;
- int v5;
- int v6;
- v1 = dword_10008CC8;
- printf("UploadScore\n");
- if ( *(_QWORD *)v1 )
- {
- v3 = SteamUserStats();
- v4 = (*(int (__thiscall **)(int, _DWORD, _DWORD, signed int, int, _DWORD, _DWORD))(*(_DWORD *)v3 + 116))(
- v3,
- *(_DWORD *)v1,
- *(_DWORD *)(v1 + 4),
- 1,
- a1,
- 0,
- 0);
- v6 = v5;
- if ( *(_QWORD *)(v1 + 384) )
- SteamAPI_UnregisterCallResult(v1 + 368, *(_DWORD *)(v1 + 384), *(_DWORD *)(v1 + 388));
- *(_DWORD *)(v1 + 384) = v4;
- *(_DWORD *)(v1 + 388) = v6;
- *(_DWORD *)(v1 + 392) = v1;
- *(_DWORD *)(v1 + 396) = sub_10001310;
- if ( v6 | v4 )
- SteamAPI_RegisterCallResult(v1 + 368, v4, v6);
- result = 1;
- }
- else
- {
- result = 0;
- }
- return result;
- }
- int __stdcall sub_10001310(int a1, char a2)
- {
- int result;
- ((void (__cdecl *)(_DWORD))printf)("OnUploadScore\n");
- result = a1;
- if ( !*(_BYTE *)a1 || a2 )
- result = printf("Score could not be uploaded to Steam\n");
- return result;
- }
- char __cdecl sub_10001350()
- {
- int v0;
- char result;
- int v2;
- int v3;
- int v4;
- int v5;
- v0 = dword_10008CC8;
- printf("DownloadScore\n");
- if ( *(_QWORD *)v0 )
- {
- v2 = SteamUserStats();
- v3 = (*(int (__thiscall **)(int, _DWORD, _DWORD, signed int, signed int, signed int))(*(_DWORD *)v2 + 104))(
- v2,
- *(_DWORD *)v0,
- *(_DWORD *)(v0 + 4),
- 1,
- -4,
- 5);
- v5 = v4;
- if ( *(_QWORD *)(v0 + 416) )
- SteamAPI_UnregisterCallResult(v0 + 400, *(_DWORD *)(v0 + 416), *(_DWORD *)(v0 + 420));
- *(_DWORD *)(v0 + 416) = v3;
- *(_DWORD *)(v0 + 420) = v5;
- *(_DWORD *)(v0 + 424) = v0;
- *(_DWORD *)(v0 + 428) = sub_10001400;
- if ( v5 | v3 )
- SteamAPI_RegisterCallResult(v0 + 400, v3, v5);
- result = 1;
- }
- else
- {
- result = 0;
- }
- return result;
- }
- int __thiscall sub_10001400(void *this, int a2, char a3)
- {
- int result;
- void *v4;
- int v5;
- int v6;
- int v7;
- void *v8;
- char v9;
- unsigned int v10;
- v10 = (unsigned int)&v8 ^ __security_cookie;
- v4 = this;
- v8 = this;
- result = printf("OnDownloadScore\n");
- if ( !a3 )
- {
- result = *(_DWORD *)(a2 + 16);
- if ( result >= 10 )
- result = 10;
- v5 = 0;
- *((_DWORD *)v4 + 2) = result;
- if ( result > 0 )
- {
- v6 = (int)((char *)v4 + 16);
- do
- {
- v7 = SteamUserStats();
- (*(void (__thiscall **)(int, _DWORD, _DWORD, int, int, char *, signed int))(*(_DWORD *)v7 + 112))(
- v7,
- *(_DWORD *)(a2 + 8),
- *(_DWORD *)(a2 + 12),
- v5,
- v6,
- &v9,
- 3);
- result = (int)v8;
- ++v5;
- v6 += 32;
- }
- while ( v5 < *((_DWORD *)v8 + 2) );
- }
- }
- return result;
- }
- int __thiscall sub_100014A0(int this, int a2)
- {
- int (__thiscall *v3)(_DWORD, _DWORD, _DWORD);
- v3 = *(int (__thiscall **)(_DWORD, _DWORD, _DWORD))(this + 28);
- *(_DWORD *)(this + 16) = 0;
- *(_DWORD *)(this + 20) = 0;
- return v3(*(_DWORD *)(this + 24), a2, 0);
- }
- signed int __cdecl sub_100014C0()
- {
- return 16;
- }
- int __thiscall sub_100014D0(int this, int a2, int a3, int a4, int a5)
- {
- int result;
- result = this;
- if ( a4 == *(_DWORD *)(this + 16) )
- {
- if ( a5 == *(_DWORD *)(this + 20) )
- {
- *(_DWORD *)(this + 16) = 0;
- *(_DWORD *)(this + 20) = 0;
- result = (*(int (__thiscall **)(_DWORD, int, int))(this + 28))(*(_DWORD *)(this + 24), a2, a3);
- }
- }
- return result;
- }
- signed int __cdecl sub_10001510()
- {
- return 32;
- }
- int __stdcall sub_10001520(int a1)
- {
- int v1;
- int v2;
- char v3;
- int v4;
- int v5;
- char v6;
- int result;
- int v8;
- char v9;
- v1 = *(_DWORD *)(a1 + 416);
- v2 = *(_DWORD *)(a1 + 420);
- v3 = *(_QWORD *)(a1 + 416) == 0i64;
- *(_DWORD *)(a1 + 400) = &off_100031F8;
- if ( !v3 )
- {
- SteamAPI_UnregisterCallResult(a1 + 400, v1, v2);
- *(_DWORD *)(a1 + 416) = 0;
- *(_DWORD *)(a1 + 420) = 0;
- }
- v4 = *(_DWORD *)(a1 + 384);
- v5 = *(_DWORD *)(a1 + 388);
- v6 = *(_QWORD *)(a1 + 384) == 0i64;
- *(_DWORD *)(a1 + 368) = &off_100031E8;
- if ( !v6 )
- {
- SteamAPI_UnregisterCallResult(a1 + 368, v4, v5);
- *(_DWORD *)(a1 + 384) = 0;
- *(_DWORD *)(a1 + 388) = 0;
- }
- result = *(_DWORD *)(a1 + 352);
- v8 = *(_DWORD *)(a1 + 356);
- v9 = *(_QWORD *)(a1 + 352) == 0i64;
- *(_DWORD *)(a1 + 336) = &off_100031D8;
- if ( !v9 )
- {
- result = SteamAPI_UnregisterCallResult(a1 + 336, result, v8);
- *(_DWORD *)(a1 + 352) = 0;
- *(_DWORD *)(a1 + 356) = 0;
- }
- return result;
- }
- double __cdecl SteamInit()
- {
- int v0;
- int v1;
- int v2;
- double result;
- byte_10008CCC = SteamAPI_Init();
- if ( byte_10008CCC )
- {
- v0 = operator new(88);
- if ( v0 )
- v1 = sub_10001AB0(v0);
- else
- v1 = 0;
- dword_10008CC4 = v1;
- v2 = operator new(432);
- if ( v2 )
- {
- result = 1.0;
- dword_10008CC8 = sub_10001000(v2);
- }
- else
- {
- result = 1.0;
- dword_10008CC8 = 0;
- }
- }
- else
- {
- printf("Fail\n");
- result = -1.0;
- }
- return result;
- }
- double __cdecl SteamRunCallbacks()
- {
- SteamAPI_RunCallbacks();
- return 0.0;
- }
- double __cdecl SteamShutdown()
- {
- int v0;
- ((void (__cdecl *)(_DWORD))printf)("Closing Steam - ");
- SteamAPI_Shutdown();
- if ( dword_10008CC4 )
- sub_100016B0(dword_10008CC4);
- if ( dword_10008CC8 )
- {
- v0 = dword_10008CC8;
- sub_10001520(dword_10008CC8);
- operator delete(v0);
- }
- printf("Done.\n");
- return 1.0;
- }
- int __usercall sub_100016B0<eax>(int a1<esi>)
- {
- char v1;
- char v2;
- char v3;
- v1 = (*(_BYTE *)(a1 + 72) & 1) == 0;
- *(_DWORD *)(a1 + 68) = &off_10003508;
- if ( !v1 )
- SteamAPI_UnregisterCallback(a1 + 68);
- v2 = (*(_BYTE *)(a1 + 52) & 1) == 0;
- *(_DWORD *)(a1 + 48) = &off_100034F8;
- if ( !v2 )
- SteamAPI_UnregisterCallback(a1 + 48);
- v3 = (*(_BYTE *)(a1 + 32) & 1) == 0;
- *(_DWORD *)(a1 + 28) = &off_100034E8;
- if ( !v3 )
- SteamAPI_UnregisterCallback(a1 + 28);
- operator delete(a1);
- return a1;
- }
- double __usercall SteamSetAchievement<st0>(int a1<ecx>, int a2<esi>, int a3)
- {
- double result;
- int v4;
- int v5;
- if ( dword_10008CC4 )
- {
- if ( *(_BYTE *)(dword_10008CC4 + 24) )
- {
- v4 = ((int (__stdcall *)(_DWORD))SteamUserStats)(a2);
- (*(void (__thiscall **)(_DWORD, _DWORD))(*(_DWORD *)v4 + 28))(v4, a3);
- v5 = SteamUserStats();
- result = (double)(unsigned __int8)(*(int (__thiscall **)(_DWORD))(*(_DWORD *)v5 + 40))(v5);
- }
- else
- {
- result = (double)0;
- }
- }
- else
- {
- result = -1.0;
- }
- return result;
- }
- double __cdecl SteamStoreStats()
- {
- char v0;
- double result;
- if ( dword_10008CC4 && (sub_10001C00(dword_10008CC4), v0) )
- result = 1.0;
- else
- result = -1.0;
- return result;
- }
- double __cdecl SteamSetStatInt(const char *a1, double a2)
- {
- double result;
- if ( dword_10008CC4 && sub_10001D60(a1, (signed int)a2) )
- result = 1.0;
- else
- result = -1.0;
- return result;
- }
- double __cdecl SteamSetStat(const char *a1, double a2, double a3)
- {
- if ( dword_10008CC4 )
- {
- if ( a3 >= 0.001 || a3 <= -0.001 )
- {
- if ( sub_10001CC0(a1, a2, a3) )
- return 1.0;
- }
- else
- {
- if ( sub_10001E60(a1, a2) )
- return 1.0;
- }
- }
- return -1.0;
- }
- double __cdecl SteamFindLeaderboard(int a1)
- {
- double result;
- if ( dword_10008CC8 )
- {
- sub_10001170(a1);
- result = (double)(2 * (*(_DWORD *)(dword_10008CC8 + 8) == 0) - 1);
- }
- else
- {
- result = -1.0;
- }
- return result;
- }
- double __cdecl SteamUploadScore(double a1)
- {
- double result;
- if ( dword_10008CC8 )
- {
- sub_10001260((signed int)a1);
- result = 1.0;
- }
- else
- {
- result = -1.0;
- }
- return result;
- }
- double __cdecl SteamDownloadScores()
- {
- double result;
- if ( dword_10008CC8 )
- {
- sub_10001350();
- result = 1.0;
- }
- else
- {
- result = -1.0;
- }
- return result;
- }
- double __cdecl SteamGetScoreForPosition(double a1)
- {
- double result;
- if ( dword_10008CC8 && (signed int)a1 < *(_DWORD *)(dword_10008CC8 + 8) )
- result = (double)*(signed int *)(32 * (signed int)a1 + dword_10008CC8 + 28);
- else
- result = -1.0;
- return result;
- }
- int __cdecl SteamGetNameForPosition(double a1)
- {
- int v1;
- int v2;
- int result;
- v1 = dword_10008CC8;
- if ( dword_10008CC8 )
- {
- if ( (signed int)a1 >= *(_DWORD *)(dword_10008CC8 + 8) )
- {
- result = (int)&unk_100031D1;
- }
- else
- {
- v2 = SteamFriends();
- result = (*(int (__thiscall **)(int, _DWORD, _DWORD))(*(_DWORD *)v2 + 28))(
- v2,
- *(_DWORD *)(32 * (signed int)a1 + v1 + 16),
- *(_DWORD *)(32 * (signed int)a1 + v1 + 20));
- }
- }
- else
- {
- result = (int)&unk_100031D1;
- }
- return result;
- }
- double __cdecl SteamGetGlobalRankForPosition(double a1)
- {
- double result;
- if ( dword_10008CC8 && (signed int)a1 < *(_DWORD *)(dword_10008CC8 + 8) )
- result = (double)*(signed int *)(32 * (signed int)a1 + dword_10008CC8 + 24);
- else
- result = -1.0;
- return result;
- }
- double __cdecl SteamResetAllStats(double a1)
- {
- int v1;
- double result;
- char v3;
- char v4;
- int v5;
- result = 0.0;
- v1 = dword_10008CC4;
- if ( dword_10008CC4 )
- {
- v3 = 1;
- if ( a1 <= 0.0 )
- v4 = 0;
- v5 = SteamUserStats();
- (*(void (__thiscall **)(int))(*(_DWORD *)v5 + 76))(v5);
- sub_10001C00(v1);
- result = 1.0;
- }
- return result;
- }
- double __cdecl SteamIncreaseStat(const char *a1, double a2)
- {
- double result;
- if ( dword_10008CC4 )
- {
- sub_10001DE0(a1, (signed int)a2);
- result = 1.0;
- }
- else
- {
- result = 0.0;
- }
- return result;
- }
- signed int __cdecl sub_10001A20()
- {
- return 24;
- }
- int __thiscall sub_10001A50(int this)
- {
- return (*(int (__thiscall **)(_DWORD))(this + 16))(*(_DWORD *)(this + 12));
- }
- int __thiscall sub_10001A60(int this, int a2, int a3, int a4, int a5)
- {
- return (*(int (__thiscall **)(_DWORD, int))(this + 16))(*(_DWORD *)(this + 12), a2);
- }
- signed int __cdecl sub_10001AA0()
- {
- return 152;
- }
- int __stdcall sub_10001AB0(int a1)
- {
- int (__stdcall *v1)(int);
- int (__stdcall *v2)(int);
- int v3;
- int v4;
- int v5;
- *(_DWORD *)a1 = 0;
- *(_DWORD *)(a1 + 4) = 0;
- *(_BYTE *)(a1 + 24) = 0;
- *(_BYTE *)(a1 + 32) = 0;
- *(_DWORD *)(a1 + 36) = 0;
- *(_DWORD *)(a1 + 28) = &off_100034E8;
- *(_DWORD *)(a1 + 40) = a1;
- *(_DWORD *)(a1 + 44) = sub_10001EE0;
- if ( sub_10001EE0 )
- {
- *(_DWORD *)(a1 + 40) = a1;
- *(_DWORD *)(a1 + 44) = sub_10001EE0;
- SteamAPI_RegisterCallback(a1 + 28, 1101);
- }
- *(_BYTE *)(a1 + 52) = 0;
- *(_DWORD *)(a1 + 56) = 0;
- *(_DWORD *)(a1 + 48) = &off_100034F8;
- *(_DWORD *)(a1 + 60) = a1;
- *(_DWORD *)(a1 + 64) = sub_10002080;
- if ( sub_10002080 )
- {
- *(_DWORD *)(a1 + 60) = a1;
- *(_DWORD *)(a1 + 64) = sub_10002080;
- SteamAPI_RegisterCallback(a1 + 48, 1102);
- }
- v2 = nullsub_1;
- v1 = nullsub_1;
- *(_BYTE *)(a1 + 72) = 0;
- *(_DWORD *)(a1 + 76) = 0;
- *(_DWORD *)(a1 + 68) = &off_10003508;
- *(_DWORD *)(a1 + 80) = a1;
- *(_DWORD *)(a1 + 84) = nullsub_1;
- if ( nullsub_1 )
- {
- *(_DWORD *)(a1 + 80) = a1;
- *(_DWORD *)(a1 + 84) = nullsub_1;
- SteamAPI_RegisterCallback(a1 + 68, 1103);
- }
- v3 = SteamUtils(v2, v1);
- *(_DWORD *)a1 = (*(int (__thiscall **)(int))(*(_DWORD *)v3 + 36))(v3);
- *(_DWORD *)(a1 + 4) = 0;
- *(_DWORD *)(a1 + 8) = &unk_100088E8;
- *(_DWORD *)(a1 + 12) = 4;
- *(_DWORD *)(a1 + 16) = &unk_10005238;
- *(_DWORD *)(a1 + 20) = 35;
- if ( SteamUserStats() )
- {
- if ( SteamUser() )
- {
- v4 = SteamUser();
- if ( (unsigned __int8)(*(int (__thiscall **)(int))(*(_DWORD *)v4 + 4))(v4) )
- {
- v5 = SteamUserStats();
- (**(void (***)(void))v5)();
- }
- }
- }
- return a1;
- }
- void __usercall sub_10001C00(int a1<ebx>)
- {
- int v1;
- int v2;
- int v3;
- int v4;
- int v5;
- void (__thiscall *v6)(_DWORD, _DWORD, _DWORD);
- int v7;
- int v8;
- float v9;
- int v10;
- int v11;
- if ( *(_BYTE *)(a1 + 24) )
- {
- v11 = 0;
- if ( *(_DWORD *)(a1 + 12) > 0 )
- {
- v10 = 0;
- while ( 1 )
- {
- v2 = v10 + *(_DWORD *)(a1 + 8);
- v1 = *(_DWORD *)(v2 + 8);
- if ( !v1 )
- break;
- v3 = v1 - 1;
- if ( !v3 )
- {
- v4 = SteamUserStats();
- v6 = *(void (__thiscall **)(_DWORD, _DWORD, _DWORD))(*(_DWORD *)v4 + 12);
- v9 = *(float *)(v2 + 20);
- goto LABEL_11;
- }
- if ( v3 == 1 )
- {
- v5 = SteamUserStats();
- (*(void (__thiscall **)(int, _DWORD, _DWORD, _DWORD, _DWORD))(*(_DWORD *)v5 + 20))(
- v5,
- *(_DWORD *)(v2 + 12),
- *(float *)(v2 + 24),
- COERCE_UNSIGNED_INT64(*(float *)(v2 + 28)),
- COERCE_UNSIGNED_INT64(*(float *)(v2 + 28)) >> 32);
- v4 = SteamUserStats();
- v6 = *(void (__thiscall **)(_DWORD, _DWORD, _DWORD))(*(_DWORD *)v4 + 4);
- v7 = v2 + 20;
- goto LABEL_10;
- }
- LABEL_12:
- v10 += 32;
- ++v11;
- if ( v11 >= *(_DWORD *)(a1 + 12) )
- goto LABEL_13;
- }
- v4 = SteamUserStats();
- v7 = *(_DWORD *)(v2 + 16);
- v6 = *(void (__thiscall **)(_DWORD, _DWORD, _DWORD))(*(_DWORD *)v4 + 16);
- LABEL_10:
- LODWORD(v9) = v7;
- LABEL_11:
- v6(v4, *(_DWORD *)(v2 + 12), LODWORD(v9));
- goto LABEL_12;
- }
- LABEL_13:
- v8 = SteamUserStats();
- (*(void (__thiscall **)(int))(*(_DWORD *)v8 + 40))(v8);
- }
- }
- char __stdcall sub_10001CC0(const char *a1, double a2, double a3)
- {
- int v3;
- int v4;
- const char **v5;
- char result;
- int v7;
- float v8;
- float v9;
- v3 = *(_DWORD *)(dword_10008CC4 + 12);
- v4 = 0;
- if ( v3 <= 0 )
- {
- LABEL_5:
- result = 0;
- }
- else
- {
- v5 = (const char **)(*(_DWORD *)(dword_10008CC4 + 8) + 12);
- while ( strcmp(a1, *v5) )
- {
- ++v4;
- v5 += 8;
- if ( v4 >= v3 )
- goto LABEL_5;
- }
- v7 = dword_10008CC4;
- v8 = a2;
- *(float *)(*(_DWORD *)(dword_10008CC4 + 8) + 32 * v4 + 24) = v8;
- v9 = a3;
- *(float *)(*(_DWORD *)(v7 + 8) + 32 * v4 + 28) = v9;
- result = 1;
- }
- return result;
- }
- char __stdcall sub_10001D60(const char *a1, int a2)
- {
- int v2;
- int v3;
- const char **v4;
- char result;
- int v6;
- v2 = *(_DWORD *)(dword_10008CC4 + 12);
- v3 = 0;
- if ( v2 <= 0 )
- {
- LABEL_5:
- result = 0;
- }
- else
- {
- v6 = *(_DWORD *)(dword_10008CC4 + 8);
- v4 = (const char **)(v6 + 12);
- while ( strcmp(a1, *v4) )
- {
- ++v3;
- v4 += 8;
- if ( v3 >= v2 )
- goto LABEL_5;
- }
- *(_DWORD *)(32 * v3 + v6 + 16) = a2;
- result = 1;
- }
- return result;
- }
- char __stdcall sub_10001DE0(const char *a1, int a2)
- {
- int v2;
- int v3;
- const char **v4;
- char result;
- v2 = *(_DWORD *)(dword_10008CC4 + 12);
- v3 = 0;
- if ( v2 <= 0 )
- {
- LABEL_5:
- result = 0;
- }
- else
- {
- v4 = (const char **)(*(_DWORD *)(dword_10008CC4 + 8) + 12);
- while ( strcmp(a1, *v4) )
- {
- ++v3;
- v4 += 8;
- if ( v3 >= v2 )
- goto LABEL_5;
- }
- *(_DWORD *)(32 * v3 + *(_DWORD *)(dword_10008CC4 + 8) + 16) += a2;
- result = 1;
- }
- return result;
- }
- char __stdcall sub_10001E60(const char *a1, double a2)
- {
- int v2;
- int v3;
- const char **v4;
- char result;
- int v6;
- float v7;
- v2 = *(_DWORD *)(dword_10008CC4 + 12);
- v3 = 0;
- if ( v2 <= 0 )
- {
- LABEL_5:
- result = 0;
- }
- else
- {
- v6 = *(_DWORD *)(dword_10008CC4 + 8);
- v4 = (const char **)(v6 + 12);
- while ( strcmp(a1, *v4) )
- {
- ++v3;
- v4 += 8;
- if ( v3 >= v2 )
- goto LABEL_5;
- }
- v7 = a2;
- *(float *)(32 * v3 + v6 + 20) = v7;
- result = 1;
- }
- return result;
- }
- int __userpurge sub_10001EE0<eax>(int a1<ecx>, int a2<edi>, int a3)
- {
- int result;
- int v4;
- int v5;
- int v6;
- void (__thiscall *v7)(_DWORD);
- int v8;
- int v9;
- int v10;
- int v11;
- int v12;
- int v13;
- int v14;
- int v15;
- int v16;
- int v17;
- char v18;
- unsigned int v19;
- int v20;
- v19 = (unsigned int)&v20 ^ __security_cookie;
- result = a3;
- v4 = a1;
- if ( *(_DWORD *)a1 != *(_DWORD *)a3 || *(_DWORD *)(a1 + 4) != *(_DWORD *)(a3 + 4) )
- {
- result = snprintf(&v18, 0x80u, "RequestStats - failed, %d", *(_DWORD *)(a3 + 8));
- }
- else
- {
- if ( *(_DWORD *)(a3 + 8) == 1 )
- {
- v14 = 0;
- if ( *(_DWORD *)(a1 + 12) > 0 )
- {
- v16 = 0;
- while ( 1 )
- {
- v5 = *(_DWORD *)(v16 + *(_DWORD *)(v4 + 8) + 8);
- if ( !v5 )
- break;
- if ( (unsigned int)(v5 - 1) <= 1 )
- {
- v6 = SteamUserStats();
- v7 = *(void (__thiscall **)(_DWORD))(*(_DWORD *)v6 + 4);
- LABEL_10:
- v7(v6);
- }
- v16 += 32;
- ++v14;
- if ( v14 >= *(_DWORD *)(v4 + 12) )
- goto LABEL_12;
- }
- v6 = SteamUserStats();
- v7 = *(void (__thiscall **)(_DWORD))(*(_DWORD *)v6 + 8);
- goto LABEL_10;
- }
- LABEL_12:
- result = 0;
- v15 = 0;
- if ( *(_DWORD *)(v4 + 20) > 0 )
- {
- v17 = 0;
- do
- {
- v8 = v17 + *(_DWORD *)(v4 + 16);
- v9 = SteamUserStats();
- (*(void (__thiscall **)(int, _DWORD, int))(*(_DWORD *)v9 + 24))(v9, *(_DWORD *)(v8 + 4), v8 + 392);
- v10 = SteamUserStats();
- v11 = (*(int (__thiscall **)(int, _DWORD, _DWORD))(*(_DWORD *)v10 + 48))(v10, *(_DWORD *)(v8 + 4), "name");
- snprintf((char *)(v8 + 8), 0x80u, "%s", v11);
- v12 = SteamUserStats();
- v13 = (*(int (__thiscall **)(int, _DWORD, _DWORD))(*(_DWORD *)v12 + 48))(v12, *(_DWORD *)(v8 + 4), "desc");
- snprintf((char *)(v8 + 136), 0x100u, "%s", v13);
- v17 += 400;
- result = v15 + 1;
- v15 = result;
- }
- while ( result < *(_DWORD *)(v4 + 20) );
- }
- }
- *(_BYTE *)(v4 + 24) = 1;
- }
- return result;
- }
- int __userpurge sub_10002080<eax>(int a1<ecx>, int a2<edi>, int a3)
- {
- int result;
- int v4;
- int v5;
- char v6;
- int v7;
- int v8;
- int v9;
- int v10;
- int v11;
- char v12;
- unsigned int v13;
- v13 = (unsigned int)&v6 ^ __security_cookie;
- result = a3;
- v4 = *(_DWORD *)a1;
- v5 = *(_DWORD *)(a1 + 4);
- if ( *(_DWORD *)a1 == *(_DWORD *)a3 )
- {
- if ( v5 == *(_DWORD *)(a3 + 4) )
- {
- result = *(_DWORD *)(a3 + 8);
- if ( result != 1 )
- {
- if ( result == 8 )
- {
- v11 &= 0xFF0FFFFFu;
- BYTE3(v11) = 0;
- v11 &= 0xFFF00000u;
- v10 = 0;
- v9 = 1;
- v7 = v4;
- v8 = v5;
- result = sub_10001EE0(a1, a2, (int)&v7);
- }
- else
- {
- result = snprintf(&v12, 0x80u, "StoreStats - failed, %d\n", result);
- }
- }
- }
- }
- return result;
- }
- int __cdecl sub_100026EC()
- {
- return _clean_type_info_names_internal(&unk_10008CBC);
- }
- int (*__cdecl sub_100027B0())(void)
- {
- int (*result)(void);
- unsigned int v1;
- result = (int (*)(void))&unk_100038AC;
- v1 = (unsigned int)&unk_100038AC;
- if ( &unk_100038AC < &unk_100038AC )
- {
- do
- {
- result = *(int (**)(void))v1;
- if ( *(_DWORD *)v1 )
- result = (int (*)(void))result();
- v1 += 4;
- }
- while ( v1 < (unsigned int)&unk_100038AC );
- }
- return result;
- }
- BOOL __stdcall DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
- {
- if ( fdwReason == 1 )
- {
- if ( !dword_10003114 )
- DisableThreadLibraryCalls(hinstDLL);
- }
- return 1;
- }
- int __cdecl sub_10002B92()
- {
- dword_10008CD0 = IsProcessorFeaturePresent(0xAu);
- return 0;
- }
- int __usercall sub_10002BB0<eax>(int a1<ebp>)
- {
- char v1;
- int result;
- result = *(_DWORD *)(a1 + 8) + 28;
- v1 = (*(_BYTE *)(*(_DWORD *)(a1 + 8) + 32) & 1) == 0;
- *(_DWORD *)result = &off_100034E8;
- if ( !v1 )
- result = SteamAPI_UnregisterCallback(result);
- return result;
- }
- int __usercall sub_10002BBB<eax>(int a1<ebp>)
- {
- char v1;
- int result;
- result = *(_DWORD *)(a1 + 8) + 48;
- v1 = (*(_BYTE *)(*(_DWORD *)(a1 + 8) + 52) & 1) == 0;
- *(_DWORD *)result = &off_100034F8;
- if ( !v1 )
- result = SteamAPI_UnregisterCallback(result);
- return result;
- }
- int __usercall sub_10002BC6<eax>(int a1<ebp>)
- {
- char v1;
- int result;
- result = *(_DWORD *)(a1 + 8) + 68;
- v1 = (*(_BYTE *)(*(_DWORD *)(a1 + 8) + 72) & 1) == 0;
- *(_DWORD *)result = &off_10003508;
- if ( !v1 )
- result = SteamAPI_UnregisterCallback(result);
- return result;
- }
- int __cdecl sub_10002BD1(int a1, int a2)
- {
- __security_check_cookie((a2 + 12) ^ *(_DWORD *)(a2 - 16));
- return _CxxFrameHandler3(a1, a2);
- }
Advertisement
Add Comment
Please, Sign In to add comment