{"type": "func", "start": 6443072320, "end": 6443072559, "name": "cocos2d::CCProfilingBeginTimingBlock", "pseudocode": "// \n// cocos2d::CCProfilingBeginTimingBlock from 0x180097b40 to 0x180097c2f (239 bytes)\n// \n// 2 xrefs:\n// > <???> @ 0x18014cf68\n// > <???> @ 0x1801c0990\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:10 +0000\n// \n\n// Hidden C++ exception states: #wind=1\nvoid __fastcall cocos2d::CCProfilingBeginTimingBlock(cocos2d *this, const char *a2)\n{\n  __int64 *v3; // rsi\n  struct cocos2d::CCProfilingTimer *v4; // rbx\n  struct cocos2d::timezone *v5; // r8\n  void *v6; // rcx\n  void *Block[2]; // [rsp+30h] [rbp-38h] BYREF\n  __m128i si128; // [rsp+40h] [rbp-28h]\n\n  v3 = (__int64 *)cocos2d::CCProfiler::sharedProfiler();\n  sub_180005A10(Block, (char *)this);\n  v4 = (struct cocos2d::CCProfilingTimer *)cocos2d::CCDictionary::objectForKey(v3[7], (__int64)Block);\n  if ( si128.m128i_i64[1] > 0xFuLL )\n  {\n    v6 = Block[0];\n    if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )\n    {\n      v6 = *((void **)Block[0] - 1);\n      if ( (unsigned __int64)((char *)Block[0] - (char *)v6 - 8) > 0x1F )\n        invoke_watson(nullptr, nullptr, nullptr, 0, 0);\n    }\n    j_j_free_0(v6);\n  }\n  si128 = _mm_load_si128((const __m128i *)&xmmword_1800EC500);\n  LOBYTE(Block[0]) = 0;\n  if ( !v4 )\n    v4 = cocos2d::CCProfiler::createAndAddTimerWithName((cocos2d::CCProfiler *)v3, (const char *)this);\n  ++*((_DWORD *)v4 + 22);\n  cocos2d::gettimeofday((struct cocos2d::CCProfilingTimer *)((char *)v4 + 120), nullptr, v5);\n}", "assembly": "; \n; cocos2d::CCProfilingBeginTimingBlock from 0x180097b40 to 0x180097c2f (239 bytes)\n; \n; 2 xrefs:\n; > <???> @ 0x18014cf68\n; > <???> @ 0x1801c0990\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:10 +0000\n; \nmov     [rsp+arg_8], rbx                                               ; +0x0, 0x180097b40\nmov     [rsp+arg_10], rsi                                              ; +0x5, 0x180097b45\npush    rdi                                                            ; +0xa, 0x180097b4a\nsub     rsp, 60h                                                       ; +0xb, 0x180097b4b\nmov     rax, cs:__security_cookie                                      ; +0xf, 0x180097b4f\nxor     rax, rsp                                                       ; +0x16, 0x180097b56\nmov     [rsp+68h+var_18], rax                                          ; +0x19, 0x180097b59\nmov     rdi, rcx                                                       ; +0x1e, 0x180097b5e\ncall    ?sharedProfiler@CCProfiler@cocos2d@@SAPEAV12@XZ; cocos2d::CCProfiler::sharedProfiler(void) ; +0x21, 0x180097b61\nmov     rsi, rax                                                       ; +0x26, 0x180097b66\nmov     rdx, rdi; Str                                                  ; +0x29, 0x180097b69\nlea     rcx, [rsp+68h+Block]; void *                                   ; +0x2c, 0x180097b6c\ncall    sub_180005A10                                                  ; +0x31, 0x180097b71\nnop                                                                    ; +0x36, 0x180097b76\nlea     rdx, [rsp+68h+Block]                                           ; +0x37, 0x180097b77\nmov     rcx, [rsi+38h]                                                 ; +0x3c, 0x180097b7c\ncall    ?objectForKey@CCDictionary@cocos2d@@QEAAPEAVCCObject@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::objectForKey(std::string const &) ; +0x40, 0x180097b80\nmov     rbx, rax                                                       ; +0x45, 0x180097b85\nmov     rdx, [rsp+68h+var_20]                                          ; +0x48, 0x180097b88\ncmp     rdx, 0Fh                                                       ; +0x4d, 0x180097b8d\njbe     short loc_180097BDB                                            ; +0x51, 0x180097b91\ninc     rdx                                                            ; +0x53, 0x180097b93\nmov     rcx, [rsp+68h+Block]; Block                                    ; +0x56, 0x180097b96\nmov     rax, rcx                                                       ; +0x5b, 0x180097b9b\ncmp     rdx, 1000h                                                     ; +0x5e, 0x180097b9e\njb      short loc_180097BD6                                            ; +0x65, 0x180097ba5\nadd     rdx, 27h ; '''                                                 ; +0x67, 0x180097ba7\nmov     rcx, [rcx-8]                                                   ; +0x6b, 0x180097bab\nsub     rax, rcx                                                       ; +0x6f, 0x180097baf\nsub     rax, 8                                                         ; +0x72, 0x180097bb2\ncmp     rax, 1Fh                                                       ; +0x76, 0x180097bb6\njbe     short loc_180097BD6                                            ; +0x7a, 0x180097bba\nmov     [rsp+68h+Reserved], 0; Reserved                                ; +0x7c, 0x180097bbc\nxor     r9d, r9d; LineNo                                               ; +0x85, 0x180097bc5\nxor     r8d, r8d; FileName                                             ; +0x88, 0x180097bc8\nxor     edx, edx; FunctionName                                         ; +0x8b, 0x180097bcb\nxor     ecx, ecx; Expression                                           ; +0x8d, 0x180097bcd\ncall    cs:_invoke_watson                                              ; +0x8f, 0x180097bcf\nalign 2                                                                ; +0x95, 0x180097bd5\ncall    j_j_free_0                                                     ; +0x96, 0x180097bd6\nmovdqa  xmm0, cs:xmmword_1800EC500                                     ; +0x9b, 0x180097bdb\nmovdqu  xmmword ptr [rsp+40h], xmm0                                    ; +0xa3, 0x180097be3\nmov     byte ptr [rsp+68h+Block], 0                                    ; +0xa9, 0x180097be9\ntest    rbx, rbx                                                       ; +0xae, 0x180097bee\njnz     short loc_180097C01                                            ; +0xb1, 0x180097bf1\nmov     rdx, rdi; char *                                               ; +0xb3, 0x180097bf3\nmov     rcx, rsi; this                                                 ; +0xb6, 0x180097bf6\ncall    ?createAndAddTimerWithName@CCProfiler@cocos2d@@QEAAPEAVCCProfilingTimer@2@PEBD@Z; cocos2d::CCProfiler::createAndAddTimerWithName(char const *) ; +0xb9, 0x180097bf9\nmov     rbx, rax                                                       ; +0xbe, 0x180097bfe\ninc     dword ptr [rbx+58h]                                            ; +0xc1, 0x180097c01\nlea     rcx, [rbx+78h]; this                                           ; +0xc4, 0x180097c04\nxor     edx, edx; struct timeval *                                     ; +0xc8, 0x180097c08\ncall    ?gettimeofday@cocos2d@@YAHPEAUtimeval@@PEAUtimezone@1@@Z; cocos2d::gettimeofday(timeval *,cocos2d::timezone *) ; +0xca, 0x180097c0a\nmov     rcx, [rsp+68h+var_18]                                          ; +0xcf, 0x180097c0f\nxor     rcx, rsp; StackCookie                                          ; +0xd4, 0x180097c14\ncall    __security_check_cookie                                        ; +0xd7, 0x180097c17\nmov     rbx, [rsp+68h+arg_8]                                           ; +0xdc, 0x180097c1c\nmov     rsi, [rsp+68h+arg_10]                                          ; +0xe1, 0x180097c21\nadd     rsp, 60h                                                       ; +0xe9, 0x180097c29\npop     rdi                                                            ; +0xed, 0x180097c2d\nretn                                                                   ; +0xee, 0x180097c2e", "xrefs": ["<???> @ 0x18014cf68", "<???> @ 0x1801c0990"], "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"}