server-re/decomp/DBCServer_Release_x64/full/functions/0x1401c1240.c

40 lines
1.5 KiB
C

/* DBCServer_Release_x64.exe sha256 d9e4fccdf3482e50247686d4452c0b13c75a53efc4bd7320668eece8d1ce828c
* Ghidra 12.1.2 decompiler output for 0x1401c1240 FUN_1401c1240
* Pseudocode, not original source. */
longlong FUN_1401c1240(longlong param_1)
{
int iVar1;
undefined4 uVar2;
undefined1 local_58 [80];
InitializeCriticalSection((LPCRITICAL_SECTION)&DAT_14039d1a0);
InitializeCriticalSection((LPCRITICAL_SECTION)&DAT_14039d1e0);
InitializeCriticalSection((LPCRITICAL_SECTION)&DAT_14039d220);
iVar1 = FUN_1401e4020(&PTR_s_fortuna_140291880);
if (iVar1 == -1) {
FUN_14016d300(local_58,L"REGISTER PRNG ERROR : SPRNG");
/* WARNING: Subroutine does not return */
_CxxThrowException(local_58,(ThrowInfo *)&DAT_1403417f8);
}
iVar1 = FUN_1401e37d0(&PTR_DAT_140291800);
if (iVar1 == -1) {
FUN_14016d300(local_58,L"REGISTER HASH ERROR : SHA1");
/* WARNING: Subroutine does not return */
_CxxThrowException(local_58,(ThrowInfo *)&DAT_1403417f8);
}
memcpy(&DAT_14039d260,&PTR_s_LibTomMath_14029163f_1_140291670,0x188);
uVar2 = FUN_1401e2980("fortuna");
*(undefined4 *)(param_1 + 0x1058) = uVar2;
uVar2 = FUN_1401e28e0(&DAT_14028a038);
*(undefined4 *)(param_1 + 0x105c) = uVar2;
iVar1 = FUN_1401e27e0(0x80,*(undefined4 *)(param_1 + 0x1058),param_1,0);
if (iVar1 != 0) {
FUN_14016d300(local_58,L"PRNG MAKE ERROR");
/* WARNING: Subroutine does not return */
_CxxThrowException(local_58,(ThrowInfo *)&DAT_1403417f8);
}
return param_1;
}