{"type": "func", "start": 4300442528, "end": 4300442839, "name": "GameLevelManager::getTimeLeft", "pseudocode": "// \n// GameLevelManager::getTimeLeft from 0x100538ba0 to 0x100538cd7 (311 bytes)\n// \n// 10 xrefs:\n// > AccountLayer::onBackup @ 0x1000cc567\n// > AccountLayer::onSync @ 0x1000cc829\n// > MessagesProfilePage::onUpdate @ 0x10022e8a0\n// > LevelLeaderboard::onUpdate @ 0x1003db463\n// > FriendsProfilePage::onUpdate @ 0x100658440\n// > FRequestProfilePage::onUpdate @ 0x100790d50\n// > InfoLayer::onComment @ 0x1007b0972\n// > InfoLayer::onRefreshComments @ 0x1007b1df0\n// > ProfilePage::onUpdate @ 0x1007b9779\n// > ProfilePage::onComment @ 0x1007be7f8\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// local variable allocation has failed, the output may be wrong!\nint __fastcall GameLevelManager::getTimeLeft(GameLevelManager *a1, const char *a2, float a3)\n{\n  cocos2d::CCDictionary *m_timerDict; // rbx\n  size_t v4; // rax\n  size_t v5; // r15\n  char *v6; // r12\n  size_t v7; // r13\n  cocos2d::CCString *v8; // rbx\n  __m128d v9; // xmm0\n  __m128d v10; // xmm1\n  double v12; // [rsp+0h] [rbp-50h]\n  timeb __dst; // [rsp+10h] [rbp-40h] BYREF\n  void *__p; // [rsp+20h] [rbp-30h]\n\n  m_timerDict = a1->m_timerDict;\n  v4 = strlen(a2);\n  if ( v4 >= 0xFFFFFFFFFFFFFFF8LL )\n    sub_100006BF0(*(double *)&a3);\n  v5 = v4;\n  if ( v4 >= 0x17 )\n  {\n    v7 = 26;\n    if ( (v4 | 7) != 0x17 )\n      v7 = (v4 | 7) + 1;\n    v6 = (char *)operator new(v7);\n    __p = v6;\n    __dst.time = v7 + 1;\n    *(_QWORD *)&__dst.millitm = v5;\n    goto LABEL_8;\n  }\n  LOBYTE(__dst.time) = 2 * v4;\n  v6 = (char *)&__dst.time + 1;\n  if ( v4 )\nLABEL_8:\n    memcpy(v6, a2, v5);\n  v6[v5] = 0;\n  v8 = (cocos2d::CCString *)cocos2d::CCDictionary::objectForKey_1((__int64)m_timerDict, (char *)&__dst);\n  if ( (__dst.time & 1) != 0 )\n    operator delete(__p);\n  if ( !v8 )\n    return 0;\n  v12 = cocos2d::CCString::doubleValue(v8);\n  ftime(&__dst);\n  v9 = 0;\n  v9.f64[0] = (double)(__dst.millitm + 1000 * (__dst.time & 0xFFFFF)) / 1000.0 - v12;\n  v10 = (__m128d)LODWORD(a3);\n  v10.f64[0] = a3;\n  *(_QWORD *)&v9.f64[0] = ~(unsigned __int64)_mm_cmpgt_sd(v9, v10) & COERCE_UNSIGNED_INT64(a3 - v9.f64[0]);\n  return (int)COERCE_DOUBLE(~(unsigned __int64)_mm_cmplt_sd(v10, v9) & *(_QWORD *)&v9.f64[0]);\n}", "assembly": "; \n; GameLevelManager::getTimeLeft from 0x100538ba0 to 0x100538cd7 (311 bytes)\n; \n; 10 xrefs:\n; > AccountLayer::onBackup @ 0x1000cc567\n; > AccountLayer::onSync @ 0x1000cc829\n; > MessagesProfilePage::onUpdate @ 0x10022e8a0\n; > LevelLeaderboard::onUpdate @ 0x1003db463\n; > FriendsProfilePage::onUpdate @ 0x100658440\n; > FRequestProfilePage::onUpdate @ 0x100790d50\n; > InfoLayer::onComment @ 0x1007b0972\n; > InfoLayer::onRefreshComments @ 0x1007b1df0\n; > ProfilePage::onUpdate @ 0x1007b9779\n; > ProfilePage::onComment @ 0x1007be7f8\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\npush    rbp                                                            ; +0x0, 0x100538ba0\nmov     rbp, rsp                                                       ; +0x1, 0x100538ba1\npush    r15                                                            ; +0x4, 0x100538ba4\npush    r14                                                            ; +0x6, 0x100538ba6\npush    r13                                                            ; +0x8, 0x100538ba8\npush    r12                                                            ; +0xa, 0x100538baa\npush    rbx                                                            ; +0xc, 0x100538bac\nsub     rsp, 28h                                                       ; +0xd, 0x100538bad\nmovss   [rbp+var_44], xmm0                                             ; +0x11, 0x100538bb1\nmov     r14, rsi                                                       ; +0x16, 0x100538bb6\nmov     rbx, [rdi+210h]                                                ; +0x19, 0x100538bb9\nmov     rdi, rsi; __s                                                  ; +0x20, 0x100538bc0\ncall    _strlen                                                        ; +0x23, 0x100538bc3\ncmp     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x28, 0x100538bc8\njnb     loc_100538CD2                                                  ; +0x2c, 0x100538bcc\nmov     r15, rax                                                       ; +0x32, 0x100538bd2\ncmp     rax, 17h                                                       ; +0x35, 0x100538bd5\njnb     short loc_100538BED                                            ; +0x39, 0x100538bd9\nlea     eax, [r15+r15]                                                 ; +0x3b, 0x100538bdb\nmov     byte ptr [rbp+__dst], al                                       ; +0x3f, 0x100538bdf\nlea     r12, [rbp+__dst+1]                                             ; +0x42, 0x100538be2\ntest    r15, r15                                                       ; +0x46, 0x100538be6\njnz     short loc_100538C20                                            ; +0x49, 0x100538be9\njmp     short loc_100538C2E                                            ; +0x4b, 0x100538beb\nmov     rax, r15                                                       ; +0x4d, 0x100538bed\nor      rax, 7                                                         ; +0x50, 0x100538bf0\nlea     rcx, [rax+1]                                                   ; +0x54, 0x100538bf4\ncmp     rax, 17h                                                       ; +0x58, 0x100538bf8\nmov     r13d, 1Ah                                                      ; +0x5c, 0x100538bfc\ncmovnz  r13, rcx                                                       ; +0x62, 0x100538c02\nmov     rdi, r13; __sz                                                 ; +0x66, 0x100538c06\ncall    __Znwm; operator new(ulong)                                    ; +0x69, 0x100538c09\nmov     r12, rax                                                       ; +0x6e, 0x100538c0e\nmov     [rbp+__p], rax                                                 ; +0x71, 0x100538c11\ninc     r13                                                            ; +0x75, 0x100538c15\nmov     [rbp+__dst], r13                                               ; +0x78, 0x100538c18\nmov     [rbp+var_38], r15                                              ; +0x7c, 0x100538c1c\nmov     rdi, r12; __dst                                                ; +0x80, 0x100538c20\nmov     rsi, r14; __src                                                ; +0x83, 0x100538c23\nmov     rdx, r15; __n                                                  ; +0x86, 0x100538c26\ncall    _memcpy                                                        ; +0x89, 0x100538c29\nmov     byte ptr [r12+r15], 0                                          ; +0x8e, 0x100538c2e\nlea     rsi, [rbp+__dst]                                               ; +0x93, 0x100538c33\nmov     rdi, rbx                                                       ; +0x97, 0x100538c37\ncall    cocos2d__CCDictionary__objectForKey_1                          ; +0x9a, 0x100538c3a\nmov     rbx, rax                                                       ; +0x9f, 0x100538c3f\ntest    byte ptr [rbp+__dst], 1                                        ; +0xa2, 0x100538c42\njz      short loc_100538C51                                            ; +0xa6, 0x100538c46\nmov     rdi, [rbp+__p]; __p                                            ; +0xa8, 0x100538c48\ncall    __ZdlPv; operator delete(void *)                               ; +0xac, 0x100538c4c\ntest    rbx, rbx                                                       ; +0xb1, 0x100538c51\njz      short loc_100538CC1                                            ; +0xb4, 0x100538c54\nmov     rdi, rbx                                                       ; +0xb6, 0x100538c56\ncall    cocos2d__CCString__doubleValue                                 ; +0xb9, 0x100538c59\nmovsd   [rbp+var_50], xmm0                                             ; +0xbe, 0x100538c5e\nlea     rdi, [rbp+__dst]; timeb *                                      ; +0xc3, 0x100538c63\ncall    _ftime                                                         ; +0xc7, 0x100538c67\nmovzx   eax, word ptr [rbp+var_38]                                     ; +0xcc, 0x100538c6c\nmov     rcx, [rbp+__dst]                                               ; +0xd0, 0x100538c70\nand     ecx, 0FFFFFh                                                   ; +0xd4, 0x100538c74\nimul    rcx, 3E8h                                                      ; +0xda, 0x100538c7a\nadd     rcx, rax                                                       ; +0xe1, 0x100538c81\nxorps   xmm0, xmm0                                                     ; +0xe4, 0x100538c84\ncvtsi2sd xmm0, rcx                                                     ; +0xe7, 0x100538c87\ndivsd   xmm0, cs:qword_100815208                                       ; +0xec, 0x100538c8c\nsubsd   xmm0, [rbp+var_50]                                             ; +0xf4, 0x100538c94\nmovss   xmm1, [rbp+var_44]                                             ; +0xf9, 0x100538c99\ncvtss2sd xmm1, xmm1                                                    ; +0xfe, 0x100538c9e\nmovaps  xmm2, xmm1                                                     ; +0x102, 0x100538ca2\nsubsd   xmm2, xmm0                                                     ; +0x105, 0x100538ca5\ncmpnlesd xmm0, xmm1                                                    ; +0x109, 0x100538ca9\nandnpd  xmm0, xmm2                                                     ; +0x10e, 0x100538cae\ncmpltsd xmm1, xmm0                                                     ; +0x112, 0x100538cb2\nandnpd  xmm1, xmm0                                                     ; +0x117, 0x100538cb7\ncvttsd2si eax, xmm1                                                    ; +0x11b, 0x100538cbb\njmp     short loc_100538CC3                                            ; +0x11f, 0x100538cbf\nxor     eax, eax                                                       ; +0x121, 0x100538cc1\nadd     rsp, 28h                                                       ; +0x123, 0x100538cc3\npop     rbx                                                            ; +0x127, 0x100538cc7\npop     r12                                                            ; +0x128, 0x100538cc8\npop     r13                                                            ; +0x12a, 0x100538cca\npop     r14                                                            ; +0x12c, 0x100538ccc\npop     r15                                                            ; +0x12e, 0x100538cce\npop     rbp                                                            ; +0x130, 0x100538cd0\nretn                                                                   ; +0x131, 0x100538cd1\ncall    sub_100006BF0                                                  ; +0x132, 0x100538cd2", "xrefs": ["AccountLayer::onBackup @ 0x1000cc567", "AccountLayer::onSync @ 0x1000cc829", "MessagesProfilePage::onUpdate @ 0x10022e8a0", "LevelLeaderboard::onUpdate @ 0x1003db463", "FriendsProfilePage::onUpdate @ 0x100658440", "FRequestProfilePage::onUpdate @ 0x100790d50", "InfoLayer::onComment @ 0x1007b0972", "InfoLayer::onRefreshComments @ 0x1007b1df0", "ProfilePage::onUpdate @ 0x1007b9779", "ProfilePage::onComment @ 0x1007be7f8"], "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"}