{"type": "func", "start": 4300248736, "end": 4300249173, "name": "GJRateEditorSoundLayer::onCustomButton", "pseudocode": "// \n// GJRateEditorSoundLayer::onCustomButton from 0x1005096a0 to 0x100509855 (437 bytes)\n// \n// 1 xrefs:\n// > <???> @ 0x100b66a08\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 GJRateEditorSoundLayer::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) == -21 )\n  {\n    __p = operator new(0x28u);\n    v6[0] = 41;\n    v6[1] = 38;\n    strcpy((char *)__p, \"Do you want to unrate this sound pack?\");\n    v3 = (__int64 *)FLAlertLayer::create_1(\n                      (int)a1 + 1032,\n                      (int)\"Unrate Sound Pack\",\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, 4294967274LL);\nLABEL_5:\n    (*(void (__fastcall **)(__int64 *))(*v3 + 1312))(v3);\n    return;\n  }\n  if ( (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2) == -23 )\n  {\n    *(float *)&a3 = (*(float (__fastcall **)(_QWORD *, __int64))(*a1 + 1464LL))(a1, 4294967276LL);\n    if ( (int)*(float *)&a3 > 0 )\n    {\n      v4 = GameLevelManager::sharedState(a3);\n      if ( (unsigned __int8)sub_100579B90(v4, *(unsigned int *)(a1[130] + 316LL), (unsigned int)(int)*(float *)&a3) )\n      {\n        *(_QWORD *)(GameLevelManager::sharedState(a3) + 1360) = a1 + 128;\n        v5 = a1[131];\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[131] = v3;\n        if ( (v8[0] & 1) != 0 )\n        {\n          operator delete(*(void **)&v8[1]);\n          v3 = (__int64 *)a1[131];\n        }\n        goto LABEL_5;\n      }\n    }\n  }\n}", "assembly": "; \n; GJRateEditorSoundLayer::onCustomButton from 0x1005096a0 to 0x100509855 (437 bytes)\n; \n; 1 xrefs:\n; > <???> @ 0x100b66a08\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, 0x1005096a0\nmov     rbp, rsp                                                       ; +0x1, 0x1005096a1\npush    r15                                                            ; +0x4, 0x1005096a4\npush    r14                                                            ; +0x6, 0x1005096a6\npush    rbx                                                            ; +0x8, 0x1005096a8\nsub     rsp, 38h                                                       ; +0x9, 0x1005096a9\nmov     r14, rsi                                                       ; +0xd, 0x1005096ad\nmov     rbx, rdi                                                       ; +0x10, 0x1005096b0\nmov     rax, [rsi]                                                     ; +0x13, 0x1005096b3\nmov     rdi, rsi                                                       ; +0x16, 0x1005096b6\ncall    qword ptr [rax+40h]                                            ; +0x19, 0x1005096b9\ncmp     eax, 0FFFFFFEBh                                                ; +0x1c, 0x1005096bc\njnz     loc_100509782                                                  ; +0x1f, 0x1005096bf\nadd     rbx, 408h                                                      ; +0x25, 0x1005096c5\nmov     edi, 28h ; '('; __sz                                           ; +0x2c, 0x1005096cc\ncall    __Znwm; operator new(ulong)                                    ; +0x31, 0x1005096d1\nlea     r15, [rbp+__p]                                                 ; +0x36, 0x1005096d6\nmov     [rbp+__p], rax                                                 ; +0x3a, 0x1005096da\nmov     [rbp+var_48], 29h ; ')'                                        ; +0x3e, 0x1005096de\nmov     [rbp+var_40], 26h ; '&'                                        ; +0x46, 0x1005096e6\nmov     rcx, 3F6B63617020646Eh                                         ; +0x4e, 0x1005096ee\nmov     [rax+1Eh], rcx                                                 ; +0x58, 0x1005096f8\nmovups  xmm0, xmmword ptr cs:aDoYouWantToUnr_1+10h; \"nrate this sound pack?\" ; +0x5c, 0x1005096fc\nmovups  xmmword ptr [rax+10h], xmm0                                    ; +0x63, 0x100509703\nmovups  xmm0, xmmword ptr cs:aDoYouWantToUnr_1; \"Do you want to unrate this sound pack?\" ; +0x67, 0x100509707\nmovups  xmmword ptr [rax], xmm0                                        ; +0x6e, 0x10050970e\nmov     byte ptr [rax+26h], 0                                          ; +0x71, 0x100509711\nlea     rsi, aUnrateSoundPac; \"Unrate Sound Pack\"                      ; +0x75, 0x100509715\nlea     rcx, aCancel; \"Cancel\"                                         ; +0x7c, 0x10050971c\nlea     r8, aUnrate; \"Unrate\"                                          ; +0x83, 0x100509723\nlea     rdx, [rbp+var_48]                                              ; +0x8a, 0x10050972a\nmovss   xmm0, cs:dword_100A03824                                       ; +0x8e, 0x10050972e\nmov     rdi, rbx                                                       ; +0x96, 0x100509736\ncall    FLAlertLayer__create_1                                         ; +0x99, 0x100509739\nmov     r14, rax                                                       ; +0x9e, 0x10050973e\ntest    byte ptr [rbp+var_48], 1                                       ; +0xa1, 0x100509741\njz      short loc_100509750                                            ; +0xa5, 0x100509745\nmov     rdi, [rbp+__p]; __p                                            ; +0xa7, 0x100509747\ncall    __ZdlPv; operator delete(void *)                               ; +0xab, 0x10050974b\nmov     rdi, [r14+268h]                                                ; +0xb0, 0x100509750\nlea     rsi, aGjButton06Png; \"GJ_button_06.png\"                        ; +0xb7, 0x100509757\ncall    ButtonSprite__updateBGImage                                    ; +0xbe, 0x10050975e\nmov     rax, [r14]                                                     ; +0xc3, 0x100509763\nmov     rdi, r14                                                       ; +0xc6, 0x100509766\nmov     esi, 0FFFFFFEAh                                                ; +0xc9, 0x100509769\ncall    qword ptr [rax+48h]                                            ; +0xce, 0x10050976e\nmov     rax, [r14]                                                     ; +0xd1, 0x100509771\nmov     rdi, r14                                                       ; +0xd4, 0x100509774\ncall    qword ptr [rax+520h]                                           ; +0xd7, 0x100509777\njmp     loc_10050984A                                                  ; +0xdd, 0x10050977d\nmov     rax, [r14]                                                     ; +0xe2, 0x100509782\nmov     rdi, r14                                                       ; +0xe5, 0x100509785\ncall    qword ptr [rax+40h]                                            ; +0xe8, 0x100509788\ncmp     eax, 0FFFFFFE9h                                                ; +0xeb, 0x10050978b\njnz     loc_10050984A                                                  ; +0xee, 0x10050978e\nmov     rax, [rbx]                                                     ; +0xf4, 0x100509794\nmov     rdi, rbx                                                       ; +0xf7, 0x100509797\nmov     esi, 0FFFFFFECh                                                ; +0xfa, 0x10050979a\ncall    qword ptr [rax+5B8h]                                           ; +0xff, 0x10050979f\ncvttss2si r14d, xmm0                                                   ; +0x105, 0x1005097a5\ntest    r14d, r14d                                                     ; +0x10a, 0x1005097aa\njle     loc_10050984A                                                  ; +0x10d, 0x1005097ad\ncall    GameLevelManager__sharedState                                  ; +0x113, 0x1005097b3\nmov     rcx, [rbx+410h]                                                ; +0x118, 0x1005097b8\nmov     esi, [rcx+13Ch]                                                ; +0x11f, 0x1005097bf\nmov     rdi, rax                                                       ; +0x125, 0x1005097c5\nmov     edx, r14d                                                      ; +0x128, 0x1005097c8\ncall    sub_100579B90                                                  ; +0x12b, 0x1005097cb\ntest    al, al                                                         ; +0x130, 0x1005097d0\njz      short loc_10050984A                                            ; +0x132, 0x1005097d2\ncall    GameLevelManager__sharedState                                  ; +0x134, 0x1005097d4\nlea     rcx, [rbx+400h]                                                ; +0x139, 0x1005097d9\nmov     [rax+550h], rcx                                                ; +0x140, 0x1005097e0\nmov     rax, [rbx+418h]                                                ; +0x147, 0x1005097e7\ntest    rax, rax                                                       ; +0x14e, 0x1005097ee\njz      short loc_1005097FE                                            ; +0x151, 0x1005097f1\nmov     qword ptr [rax+298h], 0                                        ; +0x153, 0x1005097f3\nlea     rdi, [rbx+3F8h]                                                ; +0x15e, 0x1005097fe\nmov     [rbp+var_30], 20h ; ' '                                        ; +0x165, 0x100509805\nmovups  xmm0, xmmword ptr cs:aUpdatingRank; \"Updating rank...\"         ; +0x169, 0x100509809\nmovups  xmmword ptr [rbp+var_30+1], xmm0                               ; +0x170, 0x100509810\nmov     [rbp+var_30+11h], 0                                            ; +0x174, 0x100509814\nlea     rsi, [rbp+var_30]                                              ; +0x178, 0x100509818\ncall    UploadActionPopup__create                                      ; +0x17c, 0x10050981c\nmov     r14, rax                                                       ; +0x181, 0x100509821\nmov     [rbx+418h], rax                                                ; +0x184, 0x100509824\ntest    [rbp+var_30], 1                                                ; +0x18b, 0x10050982b\njz      loc_100509771                                                  ; +0x18f, 0x10050982f\nmov     rdi, qword ptr [rbp+var_30+10h]; __p                           ; +0x195, 0x100509835\ncall    __ZdlPv; operator delete(void *)                               ; +0x199, 0x100509839\nmov     r14, [rbx+418h]                                                ; +0x19e, 0x10050983e\njmp     loc_100509771                                                  ; +0x1a5, 0x100509845\nadd     rsp, 38h                                                       ; +0x1aa, 0x10050984a\npop     rbx                                                            ; +0x1ae, 0x10050984e\npop     r14                                                            ; +0x1af, 0x10050984f\npop     r15                                                            ; +0x1b1, 0x100509851\npop     rbp                                                            ; +0x1b3, 0x100509853\nretn                                                                   ; +0x1b4, 0x100509854", "xrefs": ["<???> @ 0x100b66a08"], "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"}