{"type": "func", "start": 6442957760, "end": 6442958308, "name": "sub_18007BBC0", "pseudocode": "// \n// sub_18007BBC0 from 0x18007bbc0 to 0x18007bde4 (548 bytes)\n// \n// 4 xrefs:\n// > StartAddress @ 0x180077ccc\n// > <???> @ 0x180144d38\n// > <???> @ 0x180144d48\n// > <???> @ 0x1801bede8\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:22:00 +0000\n// \n\nint __fastcall sub_18007BBC0(LONG_PTR dwNewLong)\n{\n  HWND Window; // rax\n  HWND v3; // rsi\n  HANDLE CurrentThread; // rax\n  void *v5; // rcx\n  RAWINPUTDEVICE pRawInputDevices; // [rsp+60h] [rbp-A8h] BYREF\n  int v8; // [rsp+70h] [rbp-98h]\n  int v9; // [rsp+74h] [rbp-94h]\n  HWND v10; // [rsp+78h] [rbp-90h]\n  WNDCLASSA WndClass; // [rsp+80h] [rbp-88h] BYREF\n  struct tagMSG Msg; // [rsp+D0h] [rbp-38h] BYREF\n\n  *(_DWORD *)(dwNewLong + 240) = GetCurrentThreadId();\n  *(_QWORD *)&WndClass.cbClsExtra = 0;\n  *(_QWORD *)&WndClass.style = 0;\n  WndClass.lpfnWndProc = (WNDPROC)sub_1800787A0;\n  memset(&WndClass.hIcon, 0, 32);\n  WndClass.hInstance = GetModuleHandleA(nullptr);\n  WndClass.lpszClassName = \"GD_RawInput\";\n  if ( (RegisterClassA(&WndClass) || (LODWORD(Window) = GetLastError(), (_DWORD)Window == 1410))\n    && (Window = CreateWindowExA(\n                   0,\n                   \"GD_RawInput\",\n                   \"GD Raw Input Window\",\n                   0,\n                   0,\n                   0,\n                   0,\n                   0,\n                   HWND_MESSAGE,\n                   nullptr,\n                   WndClass.hInstance,\n                   nullptr),\n        (v3 = Window) != nullptr) )\n  {\n    *(_QWORD *)(dwNewLong + 48) = Window;\n    SetWindowLongPtrA(Window, -21, dwNewLong);\n    *(_DWORD *)&pRawInputDevices.usUsagePage = 131073;\n    pRawInputDevices.dwFlags = 256;\n    pRawInputDevices.hwndTarget = v3;\n    v8 = 393217;\n    v9 = 256;\n    v10 = v3;\n    if ( RegisterRawInputDevices(&pRawInputDevices, 2u, 0x10u) )\n    {\n      CurrentThread = GetCurrentThread();\n      SetThreadPriority(CurrentThread, 2);\n      *(_QWORD *)(dwNewLong + 248) = RegisterPowerSettingNotification(v3, &PowerSettingGuid, 0);\n      if ( GetMessageA(&Msg, nullptr, 0, 0) > 0 )\n      {\n        do\n          DispatchMessageA(&Msg);\n        while ( *(_BYTE *)(dwNewLong + 8) && GetMessageA(&Msg, nullptr, 0, 0) > 0 );\n      }\n      v5 = *(void **)(dwNewLong + 248);\n      if ( v5 )\n      {\n        UnregisterPowerSettingNotification(v5);\n        *(_QWORD *)(dwNewLong + 248) = 0;\n      }\n    }\n    else\n    {\n      *(_BYTE *)(dwNewLong + 8) = 0;\n    }\n    LODWORD(Window) = DestroyWindow(v3);\n    *(_QWORD *)(dwNewLong + 48) = 0;\n  }\n  else\n  {\n    *(_BYTE *)(dwNewLong + 8) = 0;\n  }\n  return (int)Window;\n}", "assembly": "; \n; sub_18007BBC0 from 0x18007bbc0 to 0x18007bde4 (548 bytes)\n; \n; 4 xrefs:\n; > StartAddress @ 0x180077ccc\n; > <???> @ 0x180144d38\n; > <???> @ 0x180144d48\n; > <???> @ 0x1801bede8\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:22:00 +0000\n; \nmov     [rsp+arg_8], rbx                                               ; +0x0, 0x18007bbc0\nmov     [rsp+arg_10], rsi                                              ; +0x5, 0x18007bbc5\npush    rdi                                                            ; +0xa, 0x18007bbca\nsub     rsp, 100h                                                      ; +0xb, 0x18007bbcb\nmov     rbx, rcx                                                       ; +0x12, 0x18007bbd2\ncall    cs:GetCurrentThreadId                                          ; +0x15, 0x18007bbd5\nxorps   xmm0, xmm0                                                     ; +0x1b, 0x18007bbdb\nmov     [rbx+0F0h], eax                                                ; +0x1e, 0x18007bbde\nxor     edi, edi                                                       ; +0x24, 0x18007bbe4\nmovdqa  xmmword ptr [rsp+108h+WndClass.cbClsExtra], xmm0               ; +0x26, 0x18007bbe6\nlea     rax, sub_1800787A0                                             ; +0x2f, 0x18007bbef\nmov     qword ptr [rsp+108h+WndClass.style], rdi                       ; +0x36, 0x18007bbf6\nxorps   xmm1, xmm1                                                     ; +0x3e, 0x18007bbfe\nmov     [rsp+108h+WndClass.lpfnWndProc], rax                           ; +0x41, 0x18007bc01\nxor     ecx, ecx; lpModuleName                                         ; +0x49, 0x18007bc09\nmovdqa  xmmword ptr [rsp+108h+WndClass.hIcon], xmm1                    ; +0x4b, 0x18007bc0b\nmovdqa  xmmword ptr [rsp+108h+WndClass.hbrBackground], xmm0            ; +0x54, 0x18007bc14\nmov     [rsp+108h+WndClass.lpszClassName], rdi                         ; +0x5d, 0x18007bc1d\ncall    cs:GetModuleHandleA                                            ; +0x65, 0x18007bc25\nlea     rsi, ClassName; \"GD_RawInput\"                                  ; +0x6b, 0x18007bc2b\nmov     [rsp+108h+WndClass.hInstance], rax                             ; +0x72, 0x18007bc32\nlea     rcx, [rsp+108h+WndClass]; lpWndClass                           ; +0x7a, 0x18007bc3a\nmov     [rsp+108h+WndClass.lpszClassName], rsi                         ; +0x82, 0x18007bc42\ncall    cs:RegisterClassA                                              ; +0x8a, 0x18007bc4a\ntest    ax, ax                                                         ; +0x90, 0x18007bc50\njnz     short loc_18007BC62                                            ; +0x93, 0x18007bc53\ncall    cs:GetLastError                                                ; +0x95, 0x18007bc55\ncmp     eax, 582h                                                      ; +0x9b, 0x18007bc5b\njnz     short loc_18007BCAF                                            ; +0xa0, 0x18007bc60\nmov     rax, [rsp+108h+WndClass.hInstance]                             ; +0xa2, 0x18007bc62\nlea     r8, WindowName; \"GD Raw Input Window\"                          ; +0xaa, 0x18007bc6a\nmov     [rsp+108h+lpParam], rdi; lpParam                               ; +0xb1, 0x18007bc71\nxor     r9d, r9d; dwStyle                                              ; +0xb6, 0x18007bc76\nmov     [rsp+108h+hInstance], rax; hInstance                           ; +0xb9, 0x18007bc79\nmov     rdx, rsi; lpClassName                                          ; +0xbe, 0x18007bc7e\nmov     [rsp+108h+hMenu], rdi; hMenu                                   ; +0xc1, 0x18007bc81\nxor     ecx, ecx; dwExStyle                                            ; +0xc6, 0x18007bc86\nmov     [rsp+108h+hWndParent], 0FFFFFFFFFFFFFFFDh; hWndParent          ; +0xc8, 0x18007bc88\nmov     [rsp+108h+nHeight], edi; nHeight                               ; +0xd1, 0x18007bc91\nmov     [rsp+108h+nWidth], edi; nWidth                                 ; +0xd5, 0x18007bc95\nmov     [rsp+108h+Y], edi; Y                                           ; +0xd9, 0x18007bc99\nmov     [rsp+108h+X], edi; X                                           ; +0xdd, 0x18007bc9d\ncall    cs:CreateWindowExA                                             ; +0xe1, 0x18007bca1\nmov     rsi, rax                                                       ; +0xe7, 0x18007bca7\ntest    rax, rax                                                       ; +0xea, 0x18007bcaa\njnz     short loc_18007BCB8                                            ; +0xed, 0x18007bcad\nxchg    dil, [rbx+8]                                                   ; +0xef, 0x18007bcaf\njmp     loc_18007BDCF                                                  ; +0xf3, 0x18007bcb3\nmov     r8, rbx; dwNewLong                                             ; +0xf8, 0x18007bcb8\nmov     [rsp+108h+arg_0], rbp                                          ; +0xfb, 0x18007bcbb\nmov     edx, 0FFFFFFEBh; nIndex                                        ; +0x103, 0x18007bcc3\nmov     [rbx+30h], rsi                                                 ; +0x108, 0x18007bcc8\nmov     rcx, rsi; hWnd                                                 ; +0x10c, 0x18007bccc\ncall    cs:SetWindowLongPtrA                                           ; +0x10f, 0x18007bccf\nmov     ebp, 2                                                         ; +0x115, 0x18007bcd5\nmov     dword ptr [rsp+108h+pRawInputDevices.usUsagePage], 20001h      ; +0x11a, 0x18007bcda\nmov     edx, ebp; uiNumDevices                                         ; +0x122, 0x18007bce2\nmov     [rsp+108h+pRawInputDevices.dwFlags], 100h                      ; +0x124, 0x18007bce4\nmov     r8d, 10h; cbSize                                               ; +0x12c, 0x18007bcec\nmov     [rsp+108h+pRawInputDevices.hwndTarget], rsi                    ; +0x132, 0x18007bcf2\nlea     rcx, [rsp+108h+pRawInputDevices]; pRawInputDevices             ; +0x137, 0x18007bcf7\nmov     [rsp+108h+var_98], 60001h                                      ; +0x13c, 0x18007bcfc\nmov     [rsp+108h+var_94], 100h                                        ; +0x144, 0x18007bd04\nmov     [rsp+108h+var_90], rsi                                         ; +0x14c, 0x18007bd0c\ncall    cs:RegisterRawInputDevices                                     ; +0x151, 0x18007bd11\ntest    eax, eax                                                       ; +0x157, 0x18007bd17\njnz     short loc_18007BD25                                            ; +0x159, 0x18007bd19\nmov     eax, edi                                                       ; +0x15b, 0x18007bd1b\nxchg    al, [rbx+8]                                                    ; +0x15d, 0x18007bd1d\njmp     loc_18007BDBA                                                  ; +0x160, 0x18007bd20\ncall    cs:GetCurrentThread                                            ; +0x165, 0x18007bd25\nmov     rcx, rax; hThread                                              ; +0x16b, 0x18007bd2b\nmov     edx, ebp; nPriority                                            ; +0x16e, 0x18007bd2e\ncall    cs:SetThreadPriority                                           ; +0x170, 0x18007bd30\nxor     r8d, r8d; Flags                                                ; +0x176, 0x18007bd36\nlea     rdx, PowerSettingGuid; PowerSettingGuid                        ; +0x179, 0x18007bd39\nmov     rcx, rsi; hRecipient                                           ; +0x180, 0x18007bd40\ncall    cs:RegisterPowerSettingNotification                            ; +0x183, 0x18007bd43\nxor     r9d, r9d; wMsgFilterMax                                        ; +0x189, 0x18007bd49\nlea     rcx, [rsp+108h+Msg]; lpMsg                                     ; +0x18c, 0x18007bd4c\nxor     r8d, r8d; wMsgFilterMin                                        ; +0x194, 0x18007bd54\nmov     [rbx+0F8h], rax                                                ; +0x197, 0x18007bd57\nxor     edx, edx; hWnd                                                 ; +0x19e, 0x18007bd5e\ncall    cs:GetMessageA                                                 ; +0x1a0, 0x18007bd60\ntest    eax, eax                                                       ; +0x1a6, 0x18007bd66\njle     short loc_18007BDA1                                            ; +0x1a8, 0x18007bd68\nnop     word ptr [rax+rax+00h]                                         ; +0x1aa, 0x18007bd6a\nlea     rcx, [rsp+108h+Msg]; lpMsg                                     ; +0x1b0, 0x18007bd70\ncall    cs:DispatchMessageA                                            ; +0x1b8, 0x18007bd78\nmovzx   eax, byte ptr [rbx+8]                                          ; +0x1be, 0x18007bd7e\nnop                                                                    ; +0x1c2, 0x18007bd82\ntest    al, al                                                         ; +0x1c3, 0x18007bd83\njz      short loc_18007BDA1                                            ; +0x1c5, 0x18007bd85\nxor     r9d, r9d; wMsgFilterMax                                        ; +0x1c7, 0x18007bd87\nlea     rcx, [rsp+108h+Msg]; lpMsg                                     ; +0x1ca, 0x18007bd8a\nxor     r8d, r8d; wMsgFilterMin                                        ; +0x1d2, 0x18007bd92\nxor     edx, edx; hWnd                                                 ; +0x1d5, 0x18007bd95\ncall    cs:GetMessageA                                                 ; +0x1d7, 0x18007bd97\ntest    eax, eax                                                       ; +0x1dd, 0x18007bd9d\njg      short loc_18007BD70                                            ; +0x1df, 0x18007bd9f\nmov     rcx, [rbx+0F8h]; Handle                                        ; +0x1e1, 0x18007bda1\ntest    rcx, rcx                                                       ; +0x1e8, 0x18007bda8\njz      short loc_18007BDBA                                            ; +0x1eb, 0x18007bdab\ncall    cs:UnregisterPowerSettingNotification                          ; +0x1ed, 0x18007bdad\nmov     [rbx+0F8h], rdi                                                ; +0x1f3, 0x18007bdb3\nmov     rcx, rsi; hWnd                                                 ; +0x1fa, 0x18007bdba\ncall    cs:DestroyWindow                                               ; +0x1fd, 0x18007bdbd\nmov     rbp, [rsp+108h+arg_0]                                          ; +0x203, 0x18007bdc3\nmov     [rbx+30h], rdi                                                 ; +0x20b, 0x18007bdcb\nlea     r11, [rsp+108h+var_8]                                          ; +0x20f, 0x18007bdcf\nmov     rbx, [r11+18h]                                                 ; +0x217, 0x18007bdd7\nmov     rsi, [r11+20h]                                                 ; +0x21b, 0x18007bddb\nmov     rsp, r11                                                       ; +0x21f, 0x18007bddf\npop     rdi                                                            ; +0x222, 0x18007bde2\nretn                                                                   ; +0x223, 0x18007bde3", "xrefs": ["StartAddress @ 0x180077ccc", "<???> @ 0x180144d38", "<???> @ 0x180144d48", "<???> @ 0x1801bede8"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}