copy_block
0x000ebfc0 · 440 bytes · __cdecl
_Z10copy_blockR6TStatePcji
Decompiled
undefined (4 params)
/* copy_block(TState&, char*, unsigned int, int) */
void copy_block(TState *param_1,char *param_2,uint param_3,int param_4)
{
int iVar1;
byte bVar2;
uint uVar3;
bi_windup(param_1);
if (param_4 == 0) goto LAB_000ec07d;
uVar3 = *(uint *)(param_1 + 0x1af64);
bVar2 = (byte)(param_3 >> 8);
if (uVar3 < *(int *)(param_1 + 0x1af68) - 1U) {
LAB_000ebff9:
*(uint *)(param_1 + 0x1af64) = uVar3 + 1;
*(byte *)(*(int *)(param_1 + 0x1af60) + uVar3) = (byte)param_3;
iVar1 = *(int *)(param_1 + 0x1af64);
*(int *)(param_1 + 0x1af64) = iVar1 + 1;
*(byte *)(*(int *)(param_1 + 0x1af60) + iVar1) = bVar2;
uVar3 = *(uint *)(param_1 + 0x1af64);
if (*(int *)(param_1 + 0x1af68) - 1U <= uVar3) goto LAB_000ec153;
LAB_000ec041:
*(uint *)(param_1 + 0x1af64) = uVar3 + 1;
*(byte *)(*(int *)(param_1 + 0x1af60) + uVar3) = ~(byte)param_3;
iVar1 = *(int *)(param_1 + 0x1af64);
*(int *)(param_1 + 0x1af64) = iVar1 + 1;
*(byte *)(*(int *)(param_1 + 0x1af60) + iVar1) = ~bVar2;
}
else {
(**(code **)(param_1 + 0x10))
(*(undefined4 *)param_1,*(undefined4 *)(param_1 + 0x1af60),param_1 + 0x1af64);
uVar3 = *(uint *)(param_1 + 0x1af64);
if (uVar3 < *(int *)(param_1 + 0x1af68) - 1U) goto LAB_000ebff9;
LAB_000ec153:
(**(code **)(param_1 + 0x10))
(*(undefined4 *)param_1,*(undefined4 *)(param_1 + 0x1af60),param_1 + 0x1af64);
uVar3 = *(uint *)(param_1 + 0x1af64);
if (uVar3 < *(int *)(param_1 + 0x1af68) - 1U) goto LAB_000ec041;
}
*(int *)(param_1 + 0x1af6c) = *(int *)(param_1 + 0x1af6c) + 0x20;
LAB_000ec07d:
if (*(int *)(param_1 + 0x1af54) == 0) {
if (*(uint *)(param_1 + 0x1af68) < param_3 + *(int *)(param_1 + 0x1af64)) {
*(char **)(param_1 + 0x6afa4) = "output buffer too small for in-memory compression";
}
else {
memcpy((void *)(*(int *)(param_1 + 0x1af64) + *(int *)(param_1 + 0x1af60)),param_2,param_3);
*(uint *)(param_1 + 0x1af64) = *(int *)(param_1 + 0x1af64) + param_3;
}
}
else {
(**(code **)(param_1 + 0x10))
(*(undefined4 *)param_1,*(undefined4 *)(param_1 + 0x1af60),param_1 + 0x1af64);
*(uint *)(param_1 + 0x1af64) = param_3;
(**(code **)(param_1 + 0x10))(*(undefined4 *)param_1,param_2,param_1 + 0x1af64);
}
*(uint *)(param_1 + 0x1af6c) = *(int *)(param_1 + 0x1af6c) + param_3 * 8;
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.