V_atod
0x0025ce80 · 534 bytes · __cdecl
_Z6V_atodPKc
Decompiled
undefined (1 param)
/* V_atod(char const*) */
longdouble V_atod(char *param_1)
{
byte *pbVar1;
int iVar2;
byte bVar3;
int iVar4;
int iVar5;
longdouble lVar6;
double dVar7;
int local_24;
bVar3 = *param_1;
if (bVar3 == 0x2d) {
bVar3 = param_1[1];
local_24 = -1;
param_1 = param_1 + 1;
}
else {
local_24 = 1;
if (bVar3 == 0x2b) {
bVar3 = param_1[1];
param_1 = param_1 + 1;
}
}
if (bVar3 == 0x30) {
if ((param_1[1] & 0xdfU) == 0x58) {
pbVar1 = (byte *)(param_1 + 2);
dVar7 = 0.0;
while( true ) {
while( true ) {
bVar3 = *pbVar1;
while( true ) {
iVar5 = (int)(char)bVar3;
pbVar1 = pbVar1 + 1;
if (9 < iVar5 - 0x30U) break;
bVar3 = *pbVar1;
dVar7 = (double)iVar5 + -48.0 + dVar7 * 16.0;
}
if (5 < iVar5 - 0x61U) break;
dVar7 = (double)iVar5 + -87.0 + dVar7 * 16.0;
}
if (5 < iVar5 - 0x41U) break;
dVar7 = (double)iVar5 + -55.0 + dVar7 * 16.0;
}
goto LAB_0025cf43;
}
}
else if (bVar3 == 0x27) {
return (longdouble)(param_1[1] * local_24);
}
iVar4 = 0;
dVar7 = 0.0;
iVar5 = -1;
LAB_0025cf01:
param_1 = param_1 + 1;
if (bVar3 == 0x2e) {
iVar2 = iVar4;
if (iVar5 != -1) goto LAB_0025cf29;
}
else {
if (9 < (int)(char)bVar3 - 0x30U) {
if (((bVar3 & 0xdf) == 0x45) && (iVar2 = V_atoi64(param_1), iVar2 != 0)) {
lVar6 = (longdouble)__pow_finite(0x4024000000000000,(double)iVar2);
dVar7 = (double)lVar6 * dVar7;
}
if (iVar5 == -1) goto LAB_0025cf43;
LAB_0025cf29:
if (iVar5 < iVar4) {
do {
dVar7 = dVar7 * 0.1;
iVar4 = iVar4 + -1;
} while (iVar4 != iVar5);
}
LAB_0025cf43:
return (longdouble)((double)local_24 * dVar7);
}
iVar4 = iVar4 + 1;
dVar7 = dVar7 * 10.0 + (double)(int)(char)bVar3 + -48.0;
iVar2 = iVar5;
}
bVar3 = *param_1;
iVar5 = iVar2;
goto LAB_0025cf01;
}
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.