#include "classes.h" // 00aaae20 Mutex::ScopeLock::~ScopeLock() { undefined4 *puVar1; uint uVar2; byte *msgEnd; void *ptr; void *logString [4]; undefined4 logSize; uint logCapacity; byte msgBuf [1024]; uint local_14; void *local_10; undefined1 *puStack_c; undefined4 uStack_8; byte ch; uStack_8 = 0xffffffff; puStack_c = &LAB_00b14f90; local_10 = ExceptionList; uVar2 = __security_cookie ^ GHIDRA_UINT((msgBuf + 0x410)); ExceptionList = &local_10; puVar1 = *GHIDRA_CAST(this); if (puVar1 != GHIDRA_CAST(0x0)) { *GHIDRA_CAST((puVar1 + 1)) = 0; local_14 = uVar2; LeaveCriticalSection((LPCRITICAL_SECTION)*puVar1); *GHIDRA_CAST(this) = 0; if (*GHIDRA_CAST((GHIDRA_CAST(this) + 4)) != '\0') { memset(msgBuf,0,0x400); sprintf(msgBuf,GHIDRA_CAST("WARNING: \'<0x%p>\' has been scope-unlocked automatically!")); msgEnd = msgBuf; logString[0] = (void *)0x0; logSize = 0; logCapacity = 0xf; do { ch = *msgEnd; msgEnd = msgEnd + 1; } while (ch != 0); (GHIDRA_CAST((GHIDRA_CAST(logString))))->std::string::assign(msgBuf,GHIDRA_INT(msgEnd) - GHIDRA_INT((msgBuf + 1))); (*(code *)PTR_FUN_00c5aa7c)(logString,uVar2); if (0xf < logCapacity) { uVar2 = logCapacity + 1; ptr = logString[0]; if (0xfff < uVar2) { ptr = *(void **)(GHIDRA_INT(logString[0]) + -4); uVar2 = logCapacity + 0x24; if (0x1f < GHIDRA_UINT((GHIDRA_INT(logString[0]) + (-4 - GHIDRA_INT(ptr))))) { /* WARNING: Subroutine does not return */ _invalid_parameter_noinfo_noreturn(); } } operator_delete(ptr,uVar2); } } } ExceptionList = local_10; return; }