CRConServer::FinishRedirect
0x0020b2d0 · 993 bytes · __thiscall
_ZN11CRConServer14FinishRedirectEPKcRK8netadr_s
Decompiled
undefined (3 params)
/* CRConServer::FinishRedirect(char const*, netadr_s const&) */
void __thiscall CRConServer::FinishRedirect(CRConServer *this,char *param_1,netadr_s *param_2)
{
char cVar1;
CSocketCreator *this_00;
int iVar2;
netadr_s *pnVar3;
int iVar4;
void *pvVar5;
undefined4 uVar6;
undefined1 local_6c;
undefined1 local_6b;
undefined1 local_6a;
undefined1 local_69;
undefined4 local_68;
undefined1 local_64;
undefined1 local_63;
undefined1 local_62;
undefined1 local_61;
undefined1 local_60;
undefined1 local_5f;
undefined1 local_5e;
undefined1 local_5d;
undefined4 local_5c;
undefined1 local_58;
undefined1 local_57;
undefined1 local_56;
undefined1 local_55;
void *local_54 [4];
int local_44;
byte local_3f;
int local_34;
byte local_20;
this_00 = (CSocketCreator *)(this + 4);
iVar2 = CSocketCreator::GetAcceptedSocketCount(this_00);
iVar2 = iVar2 + -1;
if (-1 < iVar2) {
do {
while( true ) {
pnVar3 = (netadr_s *)CSocketCreator::GetAcceptedSocketAddress(this_00,iVar2);
cVar1 = netadr_s::CompareAdr(param_2,pnVar3,false);
if (cVar1 == '\0') break;
CUtlBuffer::CUtlBuffer((CUtlBuffer *)local_54,0,0,0);
/* try { // try from 0020b360 to 0020b6c3 has its CatchHandler @ 0020b6cc */
iVar4 = CSocketCreator::GetAcceptedSocketData(this_00,iVar2);
if ((local_3f & 1) == 0) {
cVar1 = CUtlBuffer::CheckPut((CUtlBuffer *)local_54,4);
if (cVar1 == '\0') goto LAB_0020b389;
if ((local_20 & 1) == 0) {
*(undefined4 *)((int)local_54[0] + (local_44 - local_34)) = 0;
}
else {
pvVar5 = (void *)((local_44 - local_34) + (int)local_54[0]);
if (pvVar5 != (void *)0x0) {
local_6c = 0;
local_6b = 0;
local_6a = 0;
local_69 = 0;
_V_memcpy(pvVar5,&local_6c,4);
}
}
local_44 = local_44 + 4;
CUtlBuffer::AddNullTermination((CUtlBuffer *)local_54);
uVar6 = *(undefined4 *)(iVar4 + 4);
if ((local_3f & 1) != 0) goto LAB_0020b396;
LAB_0020b4d0:
local_68 = uVar6;
cVar1 = CUtlBuffer::CheckPut((CUtlBuffer *)local_54,4);
if (cVar1 == '\0') goto LAB_0020b3aa;
if ((local_20 & 1) == 0) {
*(undefined4 *)((int)local_54[0] + (local_44 - local_34)) = uVar6;
}
else {
pvVar5 = (void *)((local_44 - local_34) + (int)local_54[0]);
if (pvVar5 != (void *)0x0) {
local_64 = local_68._3_1_;
local_63 = local_68._2_1_;
local_62 = local_68._1_1_;
local_61 = (undefined1)local_68;
_V_memcpy(pvVar5,&local_64,4);
}
}
local_44 = local_44 + 4;
CUtlBuffer::AddNullTermination((CUtlBuffer *)local_54);
if ((local_3f & 1) == 0) goto LAB_0020b51c;
LAB_0020b3b4:
CUtlBuffer::Printf((CUtlBuffer *)local_54,"%d",0);
}
else {
CUtlBuffer::Printf((CUtlBuffer *)local_54,"%d",0);
LAB_0020b389:
uVar6 = *(undefined4 *)(iVar4 + 4);
if ((local_3f & 1) == 0) goto LAB_0020b4d0;
LAB_0020b396:
CUtlBuffer::Printf((CUtlBuffer *)local_54,"%d",uVar6);
LAB_0020b3aa:
if ((local_3f & 1) != 0) goto LAB_0020b3b4;
LAB_0020b51c:
cVar1 = CUtlBuffer::CheckPut((CUtlBuffer *)local_54,4);
if (cVar1 != '\0') {
if ((local_20 & 1) == 0) {
*(undefined4 *)((int)local_54[0] + (local_44 - local_34)) = 0;
}
else {
pvVar5 = (void *)((local_44 - local_34) + (int)local_54[0]);
if (pvVar5 != (void *)0x0) {
local_60 = 0;
local_5f = 0;
local_5e = 0;
local_5d = 0;
_V_memcpy(pvVar5,&local_60,4);
}
}
local_44 = local_44 + 4;
CUtlBuffer::AddNullTermination((CUtlBuffer *)local_54);
}
}
CUtlBuffer::PutString((CUtlBuffer *)local_54,param_1);
CUtlBuffer::PutString((CUtlBuffer *)local_54,"");
iVar4 = local_44 + -4;
CUtlBuffer::SeekPut((CUtlBuffer *)local_54,0,0);
if ((local_3f & 1) == 0) {
local_5c = iVar4;
cVar1 = CUtlBuffer::CheckPut((CUtlBuffer *)local_54,4);
if (cVar1 != '\0') {
if ((local_20 & 1) == 0) {
*(int *)((int)local_54[0] + (local_44 - local_34)) = iVar4;
}
else {
pvVar5 = (void *)((local_44 - local_34) + (int)local_54[0]);
if (pvVar5 != (void *)0x0) {
local_58 = local_5c._3_1_;
local_57 = local_5c._2_1_;
local_56 = local_5c._1_1_;
local_55 = (undefined1)local_5c;
_V_memcpy(pvVar5,&local_58,4);
}
}
local_44 = local_44 + 4;
CUtlBuffer::AddNullTermination((CUtlBuffer *)local_54);
}
}
else {
CUtlBuffer::Printf((CUtlBuffer *)local_54,"%d",iVar4);
}
CUtlBuffer::SeekPut((CUtlBuffer *)local_54,1,iVar4);
SendRCONResponse(this,iVar2,local_54[0],local_44,false);
iVar2 = iVar2 + -1;
CUtlMemory<unsigned_char,int>::Purge((CUtlMemory<unsigned_char,int> *)local_54);
if (iVar2 == -1) {
return;
}
}
iVar2 = iVar2 + -1;
} while (iVar2 != -1);
}
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.