{"type": "func", "start": 5368740896, "end": 5368741267, "name": "CompareFunction", "pseudocode": "// \n// CompareFunction from 0x140007c20 to 0x140007d93 (371 bytes)\n// \n// 2 xrefs:\n// > AchievementManager::getAllAchievementsSorted @ 0x140039d0f\n// > <???> @ 0x1406c3c18\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// Hidden C++ exception states: #wind=1\n__int64 __fastcall CompareFunction(_QWORD *a1, __int64 *a2)\n{\n  __int64 v2; // rbx\n  cocos2d::CCString *v3; // rax\n  float v4; // xmm6_4\n  void *v5; // rcx\n  cocos2d::CCString *v6; // rax\n  float v7; // xmm7_4\n  void *v8; // rcx\n  void *Block[2]; // [rsp+20h] [rbp-58h] BYREF\n  __int64 v11; // [rsp+30h] [rbp-48h]\n  unsigned __int64 v12; // [rsp+38h] [rbp-40h]\n\n  v2 = *a2;\n  *(_OWORD *)Block = 0;\n  v11 = 5;\n  v12 = 15;\n  strcpy((char *)Block, \"order\");\n  v3 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(*a1, Block);\n  v4 = cocos2d::CCString::floatValue(v3) * 1000.0;\n  if ( v12 > 0xF )\n  {\n    v5 = Block[0];\n    if ( v12 + 1 >= 0x1000 )\n    {\n      v5 = *((void **)Block[0] - 1);\n      if ( (unsigned __int64)((char *)Block[0] - (char *)v5 - 8) > 0x1F )\n        invalid_parameter_noinfo_noreturn();\n    }\n    j_j_free(v5);\n  }\n  *(_OWORD *)Block = 0;\n  v11 = 5;\n  v12 = 15;\n  strcpy((char *)Block, \"order\");\n  v6 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v2, Block);\n  v7 = cocos2d::CCString::floatValue(v6) * 1000.0;\n  if ( v12 > 0xF )\n  {\n    v8 = Block[0];\n    if ( v12 + 1 >= 0x1000 )\n    {\n      v8 = *((void **)Block[0] - 1);\n      if ( (unsigned __int64)((char *)Block[0] - (char *)v8 - 8) > 0x1F )\n        invalid_parameter_noinfo_noreturn();\n    }\n    j_j_free(v8);\n  }\n  return (unsigned int)(int)(float)(v4 - v7);\n}", "assembly": "; \n; CompareFunction from 0x140007c20 to 0x140007d93 (371 bytes)\n; \n; 2 xrefs:\n; > AchievementManager::getAllAchievementsSorted @ 0x140039d0f\n; > <???> @ 0x1406c3c18\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    rbx                                                            ; +0x0, 0x140007c20\nsub     rsp, 70h                                                       ; +0x2, 0x140007c22\nmovaps  [rsp+78h+var_18], xmm6                                         ; +0x6, 0x140007c26\nmovaps  [rsp+78h+var_28], xmm7                                         ; +0xb, 0x140007c2b\nmov     rax, cs:__security_cookie                                      ; +0x10, 0x140007c30\nxor     rax, rsp                                                       ; +0x17, 0x140007c37\nmov     [rsp+78h+var_38], rax                                          ; +0x1a, 0x140007c3a\nmov     rbx, [rdx]                                                     ; +0x1f, 0x140007c3f\nxorps   xmm0, xmm0                                                     ; +0x22, 0x140007c42\nmovups  xmmword ptr [rsp+78h+Block], xmm0                              ; +0x25, 0x140007c45\nmov     [rsp+78h+var_48], 5                                            ; +0x2a, 0x140007c4a\nmov     [rsp+78h+var_40], 0Fh                                          ; +0x33, 0x140007c53\nmov     eax, cs:dword_140518988                                        ; +0x3c, 0x140007c5c\nmov     dword ptr [rsp+78h+Block], eax                                 ; +0x42, 0x140007c62\nmovzx   eax, cs:byte_14051898C                                         ; +0x46, 0x140007c66\nmov     byte ptr [rsp+78h+Block+4], al                                 ; +0x4d, 0x140007c6d\nmov     byte ptr [rsp+78h+Block+5], 0                                  ; +0x51, 0x140007c71\nlea     rdx, [rsp+78h+Block]                                           ; +0x56, 0x140007c76\nmov     rcx, [rcx]                                                     ; +0x5b, 0x140007c7b\ncall    cs:?valueForKey@CCDictionary@cocos2d@@QEAAPEBVCCString@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::valueForKey(std::string const &) ; +0x5e, 0x140007c7e\nmov     rcx, rax                                                       ; +0x64, 0x140007c84\ncall    cs:?floatValue@CCString@cocos2d@@QEBAMXZ; cocos2d::CCString::floatValue(void) ; +0x67, 0x140007c87\nmovaps  xmm6, xmm0                                                     ; +0x6d, 0x140007c8d\nmulss   xmm6, cs:dword_14062350C                                       ; +0x70, 0x140007c90\nmov     rdx, [rsp+78h+var_40]                                          ; +0x78, 0x140007c98\ncmp     rdx, 0Fh                                                       ; +0x7d, 0x140007c9d\njbe     short loc_140007CD8                                            ; +0x81, 0x140007ca1\ninc     rdx                                                            ; +0x83, 0x140007ca3\nmov     rcx, [rsp+78h+Block]; Block                                    ; +0x86, 0x140007ca6\nmov     rax, rcx                                                       ; +0x8b, 0x140007cab\ncmp     rdx, 1000h                                                     ; +0x8e, 0x140007cae\njb      short loc_140007CD3                                            ; +0x95, 0x140007cb5\nadd     rdx, 27h ; '''                                                 ; +0x97, 0x140007cb7\nmov     rcx, [rcx-8]                                                   ; +0x9b, 0x140007cbb\nsub     rax, rcx                                                       ; +0x9f, 0x140007cbf\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0xa2, 0x140007cc2\ncmp     rax, 1Fh                                                       ; +0xa6, 0x140007cc6\njbe     short loc_140007CD3                                            ; +0xaa, 0x140007cca\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0xac, 0x140007ccc\ndb 0CCh                                                                ; +0xb2, 0x140007cd2\ncall    j_j_free                                                       ; +0xb3, 0x140007cd3\nxorps   xmm0, xmm0                                                     ; +0xb8, 0x140007cd8\nmovups  xmmword ptr [rsp+78h+Block], xmm0                              ; +0xbb, 0x140007cdb\nmov     [rsp+78h+var_48], 5                                            ; +0xc0, 0x140007ce0\nmov     [rsp+78h+var_40], 0Fh                                          ; +0xc9, 0x140007ce9\nmov     eax, cs:dword_140518988                                        ; +0xd2, 0x140007cf2\nmov     dword ptr [rsp+78h+Block], eax                                 ; +0xd8, 0x140007cf8\nmovzx   eax, cs:byte_14051898C                                         ; +0xdc, 0x140007cfc\nmov     byte ptr [rsp+78h+Block+4], al                                 ; +0xe3, 0x140007d03\nmov     byte ptr [rsp+78h+Block+5], 0                                  ; +0xe7, 0x140007d07\nlea     rdx, [rsp+78h+Block]                                           ; +0xec, 0x140007d0c\nmov     rcx, rbx                                                       ; +0xf1, 0x140007d11\ncall    cs:?valueForKey@CCDictionary@cocos2d@@QEAAPEBVCCString@2@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z; cocos2d::CCDictionary::valueForKey(std::string const &) ; +0xf4, 0x140007d14\nmov     rcx, rax                                                       ; +0xfa, 0x140007d1a\ncall    cs:?floatValue@CCString@cocos2d@@QEBAMXZ; cocos2d::CCString::floatValue(void) ; +0xfd, 0x140007d1d\nmovaps  xmm7, xmm0                                                     ; +0x103, 0x140007d23\nmulss   xmm7, cs:dword_14062350C                                       ; +0x106, 0x140007d26\nmov     rdx, [rsp+78h+var_40]                                          ; +0x10e, 0x140007d2e\ncmp     rdx, 0Fh                                                       ; +0x113, 0x140007d33\njbe     short loc_140007D6E                                            ; +0x117, 0x140007d37\ninc     rdx                                                            ; +0x119, 0x140007d39\nmov     rcx, [rsp+78h+Block]; Block                                    ; +0x11c, 0x140007d3c\nmov     rax, rcx                                                       ; +0x121, 0x140007d41\ncmp     rdx, 1000h                                                     ; +0x124, 0x140007d44\njb      short loc_140007D69                                            ; +0x12b, 0x140007d4b\nadd     rdx, 27h ; '''                                                 ; +0x12d, 0x140007d4d\nmov     rcx, [rcx-8]                                                   ; +0x131, 0x140007d51\nsub     rax, rcx                                                       ; +0x135, 0x140007d55\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x138, 0x140007d58\ncmp     rax, 1Fh                                                       ; +0x13c, 0x140007d5c\njbe     short loc_140007D69                                            ; +0x140, 0x140007d60\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0x142, 0x140007d62\ndb 0CCh                                                                ; +0x148, 0x140007d68\ncall    j_j_free                                                       ; +0x149, 0x140007d69\nsubss   xmm6, xmm7                                                     ; +0x14e, 0x140007d6e\ncvttss2si eax, xmm6                                                    ; +0x152, 0x140007d72\nmov     rcx, [rsp+78h+var_38]                                          ; +0x156, 0x140007d76\nxor     rcx, rsp; StackCookie                                          ; +0x15b, 0x140007d7b\ncall    __security_check_cookie                                        ; +0x15e, 0x140007d7e\nmovaps  xmm6, [rsp+78h+var_18]                                         ; +0x163, 0x140007d83\nmovaps  xmm7, [rsp+78h+var_28]                                         ; +0x168, 0x140007d88\nadd     rsp, 70h                                                       ; +0x16d, 0x140007d8d\npop     rbx                                                            ; +0x171, 0x140007d91\nretn                                                                   ; +0x172, 0x140007d92", "xrefs": ["AchievementManager::getAllAchievementsSorted @ 0x140039d0f", "<???> @ 0x1406c3c18"], "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"}