{"type": "func", "start": 4300244544, "end": 4300244967, "name": "GJRateLevelListLayer::onCustomButton", "pseudocode": "// \n// GJRateLevelListLayer::onCustomButton from 0x100508640 to 0x1005087e7 (423 bytes)\n// \n// 1 xrefs:\n// > <???> @ 0x100b66188\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 12:31:33 +0000\n// \n\nvoid __fastcall GJRateLevelListLayer::onCustomButton(_QWORD *a1, __int64 a2, double a3)\n{\n  __int64 *v3; // r14\n  __int64 v4; // rax\n  __int64 v5; // rax\n  _QWORD v6[2]; // [rsp+8h] [rbp-48h] BYREF\n  void *__p; // [rsp+18h] [rbp-38h]\n  __int128 v8[3]; // [rsp+20h] [rbp-30h] BYREF\n\n  if ( (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2) == -13 )\n  {\n    __p = operator new(0x28u);\n    v6[0] = 41;\n    v6[1] = 32;\n    strcpy((char *)__p, \"Do you want to unrate this list?\");\n    v3 = (__int64 *)FLAlertLayer::create_1(\n                      (int)a1 + 1032,\n                      (int)\"Unrate List\",\n                      (__int64)v6,\n                      (int)\"Cancel\",\n                      (int)\"Unrate\",\n                      380.0);\n    if ( (v6[0] & 1) != 0 )\n      operator delete(__p);\n    ButtonSprite::updateBGImage(v3[77], (__int64)\"GJ_button_06.png\");\n    (*(void (__fastcall **)(__int64 *, __int64))(*v3 + 72))(v3, 4294967282LL);\nLABEL_5:\n    (*(void (__fastcall **)(__int64 *))(*v3 + 1312))(v3);\n    return;\n  }\n  if ( (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2) == -15 )\n  {\n    *(float *)&a3 = (*(float (__fastcall **)(_QWORD *, __int64))(*a1 + 1464LL))(a1, 4294967286LL);\n    if ( (int)*(float *)&a3 > 0 )\n    {\n      v4 = GameLevelManager::sharedState(a3);\n      if ( (unsigned __int8)sub_100579B60(v4, *(unsigned int *)(a1[130] + 344LL), (unsigned int)(int)*(float *)&a3) )\n      {\n        *(_QWORD *)(GameLevelManager::sharedState(a3) + 1360) = a1 + 128;\n        v5 = a1[132];\n        if ( v5 )\n          *(_QWORD *)(v5 + 664) = 0;\n        strcpy((char *)v8, \" Updating rank...\");\n        v3 = (__int64 *)UploadActionPopup::create((__int64)(a1 + 127), v8);\n        a1[132] = v3;\n        if ( (v8[0] & 1) != 0 )\n        {\n          operator delete(*(void **)&v8[1]);\n          v3 = (__int64 *)a1[132];\n        }\n        goto LABEL_5;\n      }\n    }\n  }\n}", "assembly": "; \n; GJRateLevelListLayer::onCustomButton from 0x100508640 to 0x1005087e7 (423 bytes)\n; \n; 1 xrefs:\n; > <???> @ 0x100b66188\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 12:31:33 +0000\n; \npush    rbp                                                            ; +0x0, 0x100508640\nmov     rbp, rsp                                                       ; +0x1, 0x100508641\npush    r15                                                            ; +0x4, 0x100508644\npush    r14                                                            ; +0x6, 0x100508646\npush    rbx                                                            ; +0x8, 0x100508648\nsub     rsp, 38h                                                       ; +0x9, 0x100508649\nmov     r14, rsi                                                       ; +0xd, 0x10050864d\nmov     rbx, rdi                                                       ; +0x10, 0x100508650\nmov     rax, [rsi]                                                     ; +0x13, 0x100508653\nmov     rdi, rsi                                                       ; +0x16, 0x100508656\ncall    qword ptr [rax+40h]                                            ; +0x19, 0x100508659\ncmp     eax, 0FFFFFFF3h                                                ; +0x1c, 0x10050865c\njnz     loc_100508714                                                  ; +0x1f, 0x10050865f\nadd     rbx, 408h                                                      ; +0x25, 0x100508665\nmov     edi, 28h ; '('; __sz                                           ; +0x2c, 0x10050866c\ncall    __Znwm; operator new(ulong)                                    ; +0x31, 0x100508671\nlea     r15, [rbp+__p]                                                 ; +0x36, 0x100508676\nmov     [rbp+__p], rax                                                 ; +0x3a, 0x10050867a\nmov     [rbp+var_48], 29h ; ')'                                        ; +0x3e, 0x10050867e\nmov     [rbp+var_40], 20h ; ' '                                        ; +0x46, 0x100508686\nmovups  xmm0, xmmword ptr cs:aDoYouWantToUnr_0+10h; \"nrate this list?\" ; +0x4e, 0x10050868e\nmovups  xmmword ptr [rax+10h], xmm0                                    ; +0x55, 0x100508695\nmovups  xmm0, xmmword ptr cs:aDoYouWantToUnr_0; \"Do you want to unrate this list?\" ; +0x59, 0x100508699\nmovups  xmmword ptr [rax], xmm0                                        ; +0x60, 0x1005086a0\nmov     byte ptr [rax+20h], 0                                          ; +0x63, 0x1005086a3\nlea     rsi, aUnrateList; \"Unrate List\"                                ; +0x67, 0x1005086a7\nlea     rcx, aCancel; \"Cancel\"                                         ; +0x6e, 0x1005086ae\nlea     r8, aUnrate; \"Unrate\"                                          ; +0x75, 0x1005086b5\nlea     rdx, [rbp+var_48]                                              ; +0x7c, 0x1005086bc\nmovss   xmm0, cs:dword_100A03824                                       ; +0x80, 0x1005086c0\nmov     rdi, rbx                                                       ; +0x88, 0x1005086c8\ncall    FLAlertLayer__create_1                                         ; +0x8b, 0x1005086cb\nmov     r14, rax                                                       ; +0x90, 0x1005086d0\ntest    byte ptr [rbp+var_48], 1                                       ; +0x93, 0x1005086d3\njz      short loc_1005086E2                                            ; +0x97, 0x1005086d7\nmov     rdi, [rbp+__p]; __p                                            ; +0x99, 0x1005086d9\ncall    __ZdlPv; operator delete(void *)                               ; +0x9d, 0x1005086dd\nmov     rdi, [r14+268h]                                                ; +0xa2, 0x1005086e2\nlea     rsi, aGjButton06Png; \"GJ_button_06.png\"                        ; +0xa9, 0x1005086e9\ncall    ButtonSprite__updateBGImage                                    ; +0xb0, 0x1005086f0\nmov     rax, [r14]                                                     ; +0xb5, 0x1005086f5\nmov     rdi, r14                                                       ; +0xb8, 0x1005086f8\nmov     esi, 0FFFFFFF2h                                                ; +0xbb, 0x1005086fb\ncall    qword ptr [rax+48h]                                            ; +0xc0, 0x100508700\nmov     rax, [r14]                                                     ; +0xc3, 0x100508703\nmov     rdi, r14                                                       ; +0xc6, 0x100508706\ncall    qword ptr [rax+520h]                                           ; +0xc9, 0x100508709\njmp     loc_1005087DC                                                  ; +0xcf, 0x10050870f\nmov     rax, [r14]                                                     ; +0xd4, 0x100508714\nmov     rdi, r14                                                       ; +0xd7, 0x100508717\ncall    qword ptr [rax+40h]                                            ; +0xda, 0x10050871a\ncmp     eax, 0FFFFFFF1h                                                ; +0xdd, 0x10050871d\njnz     loc_1005087DC                                                  ; +0xe0, 0x100508720\nmov     rax, [rbx]                                                     ; +0xe6, 0x100508726\nmov     rdi, rbx                                                       ; +0xe9, 0x100508729\nmov     esi, 0FFFFFFF6h                                                ; +0xec, 0x10050872c\ncall    qword ptr [rax+5B8h]                                           ; +0xf1, 0x100508731\ncvttss2si r14d, xmm0                                                   ; +0xf7, 0x100508737\ntest    r14d, r14d                                                     ; +0xfc, 0x10050873c\njle     loc_1005087DC                                                  ; +0xff, 0x10050873f\ncall    GameLevelManager__sharedState                                  ; +0x105, 0x100508745\nmov     rcx, [rbx+410h]                                                ; +0x10a, 0x10050874a\nmov     esi, [rcx+158h]                                                ; +0x111, 0x100508751\nmov     rdi, rax                                                       ; +0x117, 0x100508757\nmov     edx, r14d                                                      ; +0x11a, 0x10050875a\ncall    sub_100579B60                                                  ; +0x11d, 0x10050875d\ntest    al, al                                                         ; +0x122, 0x100508762\njz      short loc_1005087DC                                            ; +0x124, 0x100508764\ncall    GameLevelManager__sharedState                                  ; +0x126, 0x100508766\nlea     rcx, [rbx+400h]                                                ; +0x12b, 0x10050876b\nmov     [rax+550h], rcx                                                ; +0x132, 0x100508772\nmov     rax, [rbx+420h]                                                ; +0x139, 0x100508779\ntest    rax, rax                                                       ; +0x140, 0x100508780\njz      short loc_100508790                                            ; +0x143, 0x100508783\nmov     qword ptr [rax+298h], 0                                        ; +0x145, 0x100508785\nlea     rdi, [rbx+3F8h]                                                ; +0x150, 0x100508790\nmov     [rbp+var_30], 20h ; ' '                                        ; +0x157, 0x100508797\nmovups  xmm0, xmmword ptr cs:aUpdatingRank; \"Updating rank...\"         ; +0x15b, 0x10050879b\nmovups  xmmword ptr [rbp+var_30+1], xmm0                               ; +0x162, 0x1005087a2\nmov     [rbp+var_30+11h], 0                                            ; +0x166, 0x1005087a6\nlea     rsi, [rbp+var_30]                                              ; +0x16a, 0x1005087aa\ncall    UploadActionPopup__create                                      ; +0x16e, 0x1005087ae\nmov     r14, rax                                                       ; +0x173, 0x1005087b3\nmov     [rbx+420h], rax                                                ; +0x176, 0x1005087b6\ntest    [rbp+var_30], 1                                                ; +0x17d, 0x1005087bd\njz      loc_100508703                                                  ; +0x181, 0x1005087c1\nmov     rdi, qword ptr [rbp+var_30+10h]; __p                           ; +0x187, 0x1005087c7\ncall    __ZdlPv; operator delete(void *)                               ; +0x18b, 0x1005087cb\nmov     r14, [rbx+420h]                                                ; +0x190, 0x1005087d0\njmp     loc_100508703                                                  ; +0x197, 0x1005087d7\nadd     rsp, 38h                                                       ; +0x19c, 0x1005087dc\npop     rbx                                                            ; +0x1a0, 0x1005087e0\npop     r14                                                            ; +0x1a1, 0x1005087e1\npop     r15                                                            ; +0x1a3, 0x1005087e3\npop     rbp                                                            ; +0x1a5, 0x1005087e5\nretn                                                                   ; +0x1a6, 0x1005087e6", "xrefs": ["<???> @ 0x100b66188"], "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"}