CDownloadListGenerator::CheckCRCs
0x0013f430 · 591 bytes · __thiscall
_ZN22CDownloadListGenerator9CheckCRCsEPKcPhPcibb
Decompiled
undefined (7 params)
/* CDownloadListGenerator::CheckCRCs(char const*, unsigned char*, char*, int, bool, bool) */
void __thiscall
CDownloadListGenerator::CheckCRCs
(CDownloadListGenerator *this,char *param_1,uchar *param_2,char *param_3,int param_4,
bool param_5,bool param_6)
{
byte bVar1;
char cVar2;
int iVar3;
int in_GS_OFFSET;
char *pcVar4;
uchar local_134 [276];
int local_20;
local_20 = *(int *)(in_GS_OFFSET + 0x14);
if ((CheckCRCs(char_const*,unsigned_char*,char*,int,bool,bool)::red == '\0') &&
(iVar3 = __cxa_guard_acquire(&CheckCRCs(char_const*,unsigned_char*,char*,int,bool,bool)::red),
iVar3 != 0)) {
CheckCRCs(char_const*,unsigned_char*,char*,int,bool,bool)::red._0_1_ = 200;
CheckCRCs(char_const*,unsigned_char*,char*,int,bool,bool)::red._1_1_ = 0x14;
CheckCRCs(char_const*,unsigned_char*,char*,int,bool,bool)::red._2_1_ = 0x14;
CheckCRCs(char_const*,unsigned_char*,char*,int,bool,bool)::red._3_1_ = 0xff;
__cxa_guard_release(&CheckCRCs(char_const*,unsigned_char*,char*,int,bool,bool)::red);
}
bVar1 = *param_2;
if ((((((bVar1 & 0x10) == 0) || (!param_5)) && (((bVar1 & 0x20) == 0 || (!param_6)))) &&
((bVar1 & 2) != 0)) &&
((cVar2 = AlreadyVerified((CDownloadListGenerator *)g_DownloadListGenerator,param_1),
cVar2 == '\0' || ((*param_2 & 0x40) != 0)))) {
(**(code **)(*g_pFileSystem + 0x30))
(g_pFileSystem,param_1,"GAME_ROOT",local_134 + 0x10,0x104,0,0);
local_134[0] = '\0';
local_134[1] = '\0';
local_134[2] = '\0';
local_134[3] = '\0';
local_134[4] = '\0';
local_134[5] = '\0';
local_134[6] = '\0';
local_134[7] = '\0';
local_134[8] = '\0';
local_134[9] = '\0';
local_134[10] = '\0';
local_134[0xb] = '\0';
local_134[0xc] = '\0';
local_134[0xd] = '\0';
local_134[0xe] = '\0';
local_134[0xf] = '\0';
cVar2 = MD5_Hash_File(local_134,(char *)(local_134 + 0x10),false,(uint *)0x0);
if (cVar2 == '\0') {
cVar2 = (**(code **)(g_pFileSystem[1] + 0x28))(g_pFileSystem + 1,param_1,"GAME_ROOT");
if ((cVar2 == '\0') && (iVar3 = V_stristr(param_1,"pak02_dir.vpk"), iVar3 != 0))
goto LAB_0013f476;
pcVar4 = "Can\'t find file %s.\n";
}
else {
iVar3 = _V_memcmp(local_134,param_2 + 1,0x10);
if (iVar3 == 0) {
AddVerifiedCRCData((CDownloadListGenerator *)g_DownloadListGenerator,*param_2,param_1,
local_134);
if (*(int *)(sv_show_whitelist_msg._28_4_ + 0x30) != 0) {
Msg("Client has successfully CRC\'d file %s.\n",param_1);
}
goto LAB_0013f476;
}
pcVar4 = "Bad CRC for %s\n";
}
ConColorMsg((Color *)&CheckCRCs(char_const*,unsigned_char*,char*,int,bool,bool)::red,pcVar4,
param_1);
V_strncpy(param_3,param_1,param_4);
}
LAB_0013f476:
if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
return;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.