{"type": "func", "start": 6443632676, "end": 6443632884, "name": "__scrt_initialize_thread_safe_statics", "pseudocode": "// \n// __scrt_initialize_thread_safe_statics from 0x180120824 to 0x1801208f4 (208 bytes)\n// \n// 2 xrefs:\n// > <???> @ 0x180144518\n// > <???> @ 0x180202528\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\n__int64 __fastcall __scrt_initialize_thread_safe_statics()\n{\n  HMODULE ModuleHandleW; // rbx\n  BOOL (__stdcall *SleepConditionVariableCS)(PCONDITION_VARIABLE, PCRITICAL_SECTION, DWORD); // rdi\n  void (__stdcall *WakeAllConditionVariable)(PCONDITION_VARIABLE); // rax\n\n  InitializeCriticalSectionAndSpinCount(&stru_1801F49F0, 0xFA0u);\n  ModuleHandleW = GetModuleHandleW(L\"api-ms-win-core-synch-l1-2-0.dll\");\n  if ( !ModuleHandleW )\n  {\n    ModuleHandleW = GetModuleHandleW(L\"kernel32.dll\");\n    if ( !ModuleHandleW )\n      goto LABEL_9;\n  }\n  SleepConditionVariableCS = (BOOL (__stdcall *)(PCONDITION_VARIABLE, PCRITICAL_SECTION, DWORD))GetProcAddress(\n                                                                                                  ModuleHandleW,\n                                                                                                  \"SleepConditionVariableCS\");\n  WakeAllConditionVariable = (void (__stdcall *)(PCONDITION_VARIABLE))GetProcAddress(\n                                                                        ModuleHandleW,\n                                                                        \"WakeAllConditionVariable\");\n  if ( SleepConditionVariableCS && WakeAllConditionVariable )\n  {\n    qword_1801F4A18 = (__int64)SleepConditionVariableCS;\n    qword_1801F4A20 = (__int64)WakeAllConditionVariable;\n  }\n  else\n  {\n    hHandle = CreateEventW(nullptr, 1, 0, nullptr);\n    if ( !hHandle )\n      goto LABEL_9;\n  }\n  if ( !_scrt_initialize_onexit_tables(0) )\n  {\nLABEL_9:\n    _scrt_fastfail(7);\n    __debugbreak();\n  }\n  atexit(__scrt_uninitialize_thread_safe_statics);\n  return 0;\n}", "assembly": "; \n; __scrt_initialize_thread_safe_statics from 0x180120824 to 0x1801208f4 (208 bytes)\n; \n; 2 xrefs:\n; > <???> @ 0x180144518\n; > <???> @ 0x180202528\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\nmov     [rsp+arg_0], rbx                                               ; +0x0, 0x180120824\npush    rdi                                                            ; +0x5, 0x180120829\nsub     rsp, 20h                                                       ; +0x6, 0x18012082a\nmov     edx, 0FA0h; dwSpinCount                                        ; +0xa, 0x18012082e\nlea     rcx, stru_1801F49F0; lpCriticalSection                         ; +0xf, 0x180120833\ncall    cs:InitializeCriticalSectionAndSpinCount                       ; +0x16, 0x18012083a\nlea     rcx, ModuleName                                                ; +0x1c, 0x180120840\ncall    cs:GetModuleHandleW                                            ; +0x23, 0x180120847\nmov     rbx, rax                                                       ; +0x29, 0x18012084d\ntest    rax, rax                                                       ; +0x2c, 0x180120850\njnz     short loc_18012086A                                            ; +0x2f, 0x180120853\nlea     rcx, aKernel32Dll_0                                            ; +0x31, 0x180120855\ncall    cs:GetModuleHandleW                                            ; +0x38, 0x18012085c\nmov     rbx, rax                                                       ; +0x3e, 0x180120862\ntest    rax, rax                                                       ; +0x41, 0x180120865\njz      short loc_1801208E9                                            ; +0x44, 0x180120868\nlea     rdx, aSleepcondition                                           ; +0x46, 0x18012086a\nmov     rcx, rbx; hModule                                              ; +0x4d, 0x180120871\ncall    cs:GetProcAddress                                              ; +0x50, 0x180120874\nlea     rdx, aWakeallconditi                                           ; +0x56, 0x18012087a\nmov     rcx, rbx; hModule                                              ; +0x5d, 0x180120881\nmov     rdi, rax                                                       ; +0x60, 0x180120884\ncall    cs:GetProcAddress                                              ; +0x63, 0x180120887\ntest    rdi, rdi                                                       ; +0x69, 0x18012088d\njz      short loc_1801208A7                                            ; +0x6c, 0x180120890\ntest    rax, rax                                                       ; +0x6e, 0x180120892\njz      short loc_1801208A7                                            ; +0x71, 0x180120895\nmov     cs:qword_1801F4A18, rdi                                        ; +0x73, 0x180120897\nmov     cs:qword_1801F4A20, rax                                        ; +0x7a, 0x18012089e\njmp     short loc_1801208C5                                            ; +0x81, 0x1801208a5\nxor     r9d, r9d; lpName                                               ; +0x83, 0x1801208a7\nxor     r8d, r8d; bInitialState                                        ; +0x86, 0x1801208aa\nxor     ecx, ecx; lpEventAttributes                                    ; +0x89, 0x1801208ad\nlea     edx, [r9+1]; bManualReset                                      ; +0x8b, 0x1801208af\ncall    cs:CreateEventW                                                ; +0x8f, 0x1801208b3\nmov     cs:hHandle, rax                                                ; +0x95, 0x1801208b9\ntest    rax, rax                                                       ; +0x9c, 0x1801208c0\njz      short loc_1801208E9                                            ; +0x9f, 0x1801208c3\nxor     ecx, ecx                                                       ; +0xa1, 0x1801208c5\ncall    __scrt_initialize_onexit_tables                                ; +0xa3, 0x1801208c7\ntest    al, al                                                         ; +0xa8, 0x1801208cc\njz      short loc_1801208E9                                            ; +0xaa, 0x1801208ce\nlea     rcx, ?__scrt_uninitialize_thread_safe_statics@@YAXXZ; void (__cdecl *)() ; +0xac, 0x1801208d0\ncall    atexit                                                         ; +0xb3, 0x1801208d7\nmov     rbx, [rsp+28h+arg_0]                                           ; +0xb8, 0x1801208dc\nxor     eax, eax                                                       ; +0xbd, 0x1801208e1\nadd     rsp, 20h                                                       ; +0xbf, 0x1801208e3\npop     rdi                                                            ; +0xc3, 0x1801208e7\nretn                                                                   ; +0xc4, 0x1801208e8\nmov     ecx, 7                                                         ; +0xc5, 0x1801208e9\ncall    __scrt_fastfail                                                ; +0xca, 0x1801208ee\nint     3; Trap to Debugger                                            ; +0xcf, 0x1801208f3", "xrefs": ["<???> @ 0x180144518", "<???> @ 0x180202528"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}