CVariantBase<CVariantDefaultAllocator>::ConvertToCopiedData
0x009738d0 · 478 bytes · __regparm3
_ZN12CVariantBaseI24CVariantDefaultAllocatorE19ConvertToCopiedDataEb.part.409.constprop.508
Decompiled
undefined (1 param)
/* CVariantBase<CVariantDefaultAllocator>::ConvertToCopiedData(bool) [clone .part.409] [clone
.constprop.508] */
void __regparm3 CVariantBase<CVariantDefaultAllocator>::ConvertToCopiedData(bool param_1)
{
char *__ptr;
undefined3 in_register_00000001;
undefined4 *puVar1;
undefined4 *puVar2;
int iVar3;
void *__dest;
undefined4 *puVar4;
puVar1 = (undefined4 *)CONCAT31(in_register_00000001,param_1);
switch((int)*(short *)(puVar1 + 2) - 3U & 0xffff) {
case 0:
puVar4 = (undefined4 *)*puVar1;
if ((*(byte *)((int)puVar1 + 10) & 1) != 0) {
free(puVar4);
*(ushort *)((int)puVar1 + 10) = *(ushort *)((int)puVar1 + 10) & 0xfffe;
}
*puVar1 = 0;
puVar1[1] = 0;
*(undefined2 *)(puVar1 + 2) = 3;
break;
case 1:
puVar4 = (undefined4 *)*puVar1;
if ((*(byte *)((int)puVar1 + 10) & 1) != 0) {
free(puVar4);
*(ushort *)((int)puVar1 + 10) = *(ushort *)((int)puVar1 + 10) & 0xfffe;
}
puVar1[1] = 0;
*(undefined2 *)(puVar1 + 2) = 4;
*puVar1 = 0;
puVar2 = malloc(0x10);
*puVar1 = puVar2;
*puVar2 = *puVar4;
puVar2[1] = puVar4[1];
puVar2[2] = puVar4[2];
puVar2[3] = puVar4[3];
*(ushort *)((int)puVar1 + 10) = *(ushort *)((int)puVar1 + 10) | 1;
return;
default:
Warning("Attempted to ConvertToCopiedData for unsupported type (%d)\n",
(int)*(short *)(puVar1 + 2));
return;
case 0x19:
puVar4 = (undefined4 *)*puVar1;
if ((*(byte *)((int)puVar1 + 10) & 1) != 0) {
free(puVar4);
*(ushort *)((int)puVar1 + 10) = *(ushort *)((int)puVar1 + 10) & 0xfffe;
}
puVar1[1] = 0;
*(undefined2 *)(puVar1 + 2) = 0x1c;
*puVar1 = 0;
puVar2 = malloc(8);
*puVar1 = puVar2;
*puVar2 = *puVar4;
puVar2[1] = puVar4[1];
*(ushort *)((int)puVar1 + 10) = *(ushort *)((int)puVar1 + 10) | 1;
return;
case 0x1c:
__ptr = (char *)*puVar1;
if ((*(byte *)((int)puVar1 + 10) & 1) != 0) {
free(__ptr);
*(ushort *)((int)puVar1 + 10) = *(ushort *)((int)puVar1 + 10) & 0xfffe;
}
puVar1[1] = 0;
*(undefined2 *)(puVar1 + 2) = 0x1f;
*puVar1 = 0;
iVar3 = _V_strlen(__ptr);
__dest = malloc(iVar3 + 1U);
*puVar1 = __dest;
memcpy(__dest,__ptr,iVar3 + 1U);
*(ushort *)((int)puVar1 + 10) = *(ushort *)((int)puVar1 + 10) | 1;
return;
case 0x25:
puVar4 = (undefined4 *)*puVar1;
if ((*(byte *)((int)puVar1 + 10) & 1) != 0) {
free(puVar4);
*(ushort *)((int)puVar1 + 10) = *(ushort *)((int)puVar1 + 10) & 0xfffe;
}
*puVar1 = 0;
puVar1[1] = 0;
*(undefined2 *)(puVar1 + 2) = 0x28;
}
puVar2 = malloc(0xc);
*puVar1 = puVar2;
*puVar2 = *puVar4;
puVar2[1] = puVar4[1];
puVar2[2] = puVar4[2];
*(ushort *)((int)puVar1 + 10) = *(ushort *)((int)puVar1 + 10) | 1;
return;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
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.
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.