{"type": "func", "start": 6442549648, "end": 6442549778, "name": "cocos2d::extension::CCHttpClient::availableThreadCount", "pseudocode": "// \n// cocos2d::extension::CCHttpClient::availableThreadCount from 0x180018190 to 0x180018212 (130 bytes)\n// \n// 2 xrefs:\n// > <???> @ 0x18002fdf8\n// > <???> @ 0x18004aaac\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 cocos2d::extension::CCHttpClient::availableThreadCount(cocos2d::extension::CCHttpClient *this)\n{\n  __int64 v1; // rdi\n  struct _Mtx_internal_imp_t *v2; // rbx\n  unsigned __int64 v3; // rdx\n  unsigned __int64 v4; // rax\n  __int64 v5; // rdi\n\n  v1 = *((_QWORD *)this + 7);\n  v2 = (struct _Mtx_internal_imp_t *)(v1 + 64);\n  if ( Mtx_lock((_Mtx_t)(v1 + 64)) )\n  {\n    std::_Throw_Cpp_error(5);\n    __debugbreak();\n  }\n  if ( *(_DWORD *)(v1 + 140) == 0x7FFFFFFF )\n  {\n    *(_DWORD *)(v1 + 140) = 2147483646;\n    std::_Throw_Cpp_error(6);\n    __debugbreak();\n  }\n  v3 = *(_QWORD *)(v1 + 56) + *(_QWORD *)(v1 + 224);\n  v4 = (__int64)(*(_QWORD *)(v1 + 8) - *(_QWORD *)v1) >> 4;\n  v5 = v4 - v3;\n  if ( v4 <= v3 )\n    v5 = 0;\n  Mtx_unlock(v2);\n  return v5;\n}", "assembly": "; \n; cocos2d::extension::CCHttpClient::availableThreadCount from 0x180018190 to 0x180018212 (130 bytes)\n; \n; 2 xrefs:\n; > <???> @ 0x18002fdf8\n; > <???> @ 0x18004aaac\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, 0x180018190\npush    rdi                                                            ; +0x5, 0x180018195\nsub     rsp, 20h                                                       ; +0x6, 0x180018196\nmov     rdi, [rcx+38h]                                                 ; +0xa, 0x18001819a\nlea     rbx, [rdi+40h]                                                 ; +0xe, 0x18001819e\nmov     rcx, rbx; _Mtx_t                                               ; +0x12, 0x1800181a2\ncall    cs:_Mtx_lock                                                   ; +0x15, 0x1800181a5\ntest    eax, eax                                                       ; +0x1b, 0x1800181ab\njz      short loc_1800181BB                                            ; +0x1d, 0x1800181ad\nmov     ecx, 5                                                         ; +0x1f, 0x1800181af\ncall    cs:?_Throw_Cpp_error@std@@YAXH@Z; std::_Throw_Cpp_error(int)   ; +0x24, 0x1800181b4\nint     3; Trap to Debugger                                            ; +0x2a, 0x1800181ba\nmov     eax, [rbx+4Ch]                                                 ; +0x2b, 0x1800181bb\ncmp     eax, 7FFFFFFFh                                                 ; +0x2e, 0x1800181be\njnz     short loc_1800181D6                                            ; +0x33, 0x1800181c3\ndec     eax                                                            ; +0x35, 0x1800181c5\nmov     ecx, 6                                                         ; +0x37, 0x1800181c7\nmov     [rbx+4Ch], eax                                                 ; +0x3c, 0x1800181cc\ncall    cs:?_Throw_Cpp_error@std@@YAXH@Z; std::_Throw_Cpp_error(int)   ; +0x3f, 0x1800181cf\nint     3; Trap to Debugger                                            ; +0x45, 0x1800181d5\nmov     rdx, [rdi+0E0h]                                                ; +0x46, 0x1800181d6\nxor     ecx, ecx                                                       ; +0x4d, 0x1800181dd\nmov     rax, [rdi+8]                                                   ; +0x4f, 0x1800181df\nsub     rax, [rdi]                                                     ; +0x53, 0x1800181e3\nadd     rdx, [rdi+38h]                                                 ; +0x56, 0x1800181e6\nsar     rax, 4                                                         ; +0x5a, 0x1800181ea\nmov     rdi, rax                                                       ; +0x5e, 0x1800181ee\nsub     rdi, rdx                                                       ; +0x61, 0x1800181f1\ncmp     rax, rdx                                                       ; +0x64, 0x1800181f4\ncmovbe  rdi, rcx                                                       ; +0x67, 0x1800181f7\nmov     rcx, rbx; _Mtx_t                                               ; +0x6b, 0x1800181fb\ncall    cs:_Mtx_unlock                                                 ; +0x6e, 0x1800181fe\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x74, 0x180018204\nmov     rax, rdi                                                       ; +0x79, 0x180018209\nadd     rsp, 20h                                                       ; +0x7c, 0x18001820c\npop     rdi                                                            ; +0x80, 0x180018210\nretn                                                                   ; +0x81, 0x180018211", "xrefs": ["<???> @ 0x18002fdf8", "<???> @ 0x18004aaac"], "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"}