Обновить ed_parseedict.c

This commit is contained in:
a1batross 2024-03-11 01:56:17 +01:00
parent 70c825b980
commit b18248b5f2

View File

@ -1,5 +1,50 @@
// this isn't a compilable code // this isn't a compilable code
// provided just for reference // provided just for reference
// don't believe Ghidra output
bool __regparm3 SuckOutClassname(char *szInputStream,edict_t *pEdict)
{
int iVar1;
bool bVar2;
int iVar3;
char *data;
int in_GS_OFFSET;
KeyValueData kvd;
bool szKeyName [256];
iVar1 = *(int *)(in_GS_OFFSET + 0x14);
kvd.szClassName = (char *)0x0;
kvd.szValue = "";
kvd.fHandled = 0;
kvd.szKeyName = szKeyName;
do {
data = COM_Parse(szInputStream);
if ((data == (char *)0x0) || (com_token[0] == '}')) {
bVar2 = false;
goto LAB_000d4d0f;
}
Q_strncpy(szKeyName,com_token,0xff);
szKeyName[255] = false;
szInputStream = COM_Parse(data);
if (szInputStream == (char *)0x0) break;
iVar3 = Q_strcmp(szKeyName,"classname");
} while (iVar3 != 0);
kvd.szValue = com_token;
(*gEntityInterface.pfnKeyValue)(pEdict,&kvd);
if (kvd.fHandled == 0) {
/* WARNING: Subroutine does not return */
Host_Error("SuckOutClassname: parse error");
}
bVar2 = true;
LAB_000d4d0f:
if (iVar1 == *(int *)(in_GS_OFFSET + 0x14)) {
return bVar2;
}
/* WARNING: Subroutine does not return */
__stack_chk_fail();
}
char * ED_ParseEdict(char *data,edict_t *ent) char * ED_ParseEdict(char *data,edict_t *ent)
{ {