Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void __cdecl setinfo(int a1)
- {
- int v1; // edi@3
- int v2; // esi@3
- int v3; // eax@13
- int v4; // eax@14
- int v5; // ebx@20
- int v6; // edx@20
- char v7; // cl@21
- BYTE *v8; // esi@27
- int v9; // eax@28
- BYTE *v10; // eax@28
- int v11; // [sp+10h] [bp-40h]@3
- int v12; // [sp+18h] [bp-38h]@0
- int (__stdcall **v13)(char); // [sp+1Ch] [bp-34h]@30
- int v14; // [sp+20h] [bp-30h]@30
- if ( *(_DWORD *)a1 != 3 )
- {
- Msg("Syntax: setinfo <key> <value>\n");
- return;
- }
- v1 = *(_DWORD *)(a1 + 1036);
- v11 = *(_DWORD *)(a1 + 1040);
- v2 = (*(int (__stdcall **)(_DWORD))(*(_DWORD *)dword_10855E68 + 60))(*(_DWORD *)(a1 + 1036));
- sub_102F8280("sv_cheats");
- if ( !v2 )
- {
- v5 = (*(int (__stdcall **)(unsigned int))(*(_DWORD *)g_pMemAlloc + 4))(strlen((const char *)v1) + 1);
- v6 = v1;
- do
- {
- v7 = *(_BYTE *)v6++;
- *(_BYTE *)(v5 - v1 + v6 - 1) = v7;
- }
- while ( v7 );
- if ( (*(int (__stdcall **)(signed int))(*(_DWORD *)g_pMemAlloc + 4))(88) )
- v2 = sub_102F79D0(v5, &SrcBuf, 512, "Custom user info value");
- else
- v2 = 0;
- LABEL_25:
- (*(void (__thiscall **)(int, int))(*(_DWORD *)(v2 + 24) + 12))(v2 + 24, v11);
- if ( *(_DWORD *)(dword_105D2284 + 232) >= 2 )
- {
- if ( *(_DWORD *)(v2 + 20) & 0x1000 )
- {
- v8 = (BYTE *)"FCVAR_NEVER_AS_STRING";
- }
- else
- {
- v9 = *(_DWORD *)(v2 + 28);
- v8 = &SrcBuf;
- v10 = *(BYTE **)(v9 + 36);
- if ( v10 )
- v8 = v10;
- }
- sub_100C2250(&v13);
- v13 = &off_104B8230;
- v14 = (int)off_104B8268;
- sub_100F45B0(v1, v8);
- (*(void (__stdcall **)(int *, _DWORD, _DWORD))(**(_DWORD **)(dword_105D2284 + 148) + 168))(&v13, 0, 0);
- sub_100C21D0(&v13);
- }
- return;
- }
- if ( (unsigned __int8)(*(int (__thiscall **)(int))(*(_DWORD *)v2 + 4))(v2) )
- {
- Msg("Name %s is already registered as console command\n", v1);
- return;
- }
- if ( !(unsigned __int8)(*(int (__thiscall **)(int, signed int))(*(_DWORD *)v2 + 8))(v2, 512) )
- {
- Msg("Convar %s is already registered but not as user info value\n", v1);
- return;
- }
- if ( (unsigned __int8)(*(int (__thiscall **)(int, signed int))(*(_DWORD *)v2 + 8))(v2, 0x400000)
- && *(_DWORD *)(dword_105D2284 + 232) >= 2
- && (!(unsigned __int8)(*(int (__thiscall **)(int, signed int))(*(_DWORD *)v2 + 8))(v2, 512)
- || !dword_1084D9FC
- || !(unsigned __int8)(*(int (__stdcall **)(_DWORD))(*(_DWORD *)dword_1084D9FC + 436))(0)) )
- {
- v3 = (*(int (__thiscall **)(int))(*(_DWORD *)v2 + 24))(v2);
- ConMsg("Can't change %s when playing, disconnect from the server or switch team to spectators\n", v3);
- return;
- }
- v4 = sub_1022D130();
- if ( v4 == 2 || v4 == 4 || !(unsigned __int8)(*(int (__thiscall **)(_DWORD, signed int))(*(_DWORD *)v2 + 8))(v2, 2) )
- {
- if ( (unsigned __int8)(*(int (__thiscall **)(_DWORD, signed int))(*(_DWORD *)v2 + 8))(v2, 0x4000)
- && !*(_DWORD *)(v12 + 48) )
- {
- Msg("Convar %s is marked as cheat and cheats are off\n", v1);
- return;
- }
- goto LABEL_25;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement