{"type": "func", "start": 5371862176, "end": 5371862643, "name": "LevelLeaderboard::getSpriteButton", "pseudocode": "// \n// LevelLeaderboard::getSpriteButton from 0x140301ca0 to 0x140301e73 (467 bytes)\n// \n// 4 xrefs:\n// > LevelLeaderboard::init @ 0x140301005\n// > LevelLeaderboard::init @ 0x1403010dd\n// > LevelLeaderboard::init @ 0x140301294\n// > <???> @ 0x1406d437c\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=2\nCCMenuItemSpriteExtra *__fastcall LevelLeaderboard::getSpriteButton(\n        cocos2d::CCObject *a1,\n        const char *a2,\n        cocos2d::SEL_MenuHandler *a3,\n        __int64 a4,\n        int a5,\n        __int64 a6,\n        int a7)\n{\n  cocos2d::CCString *v11; // rax\n  const char *CString; // rax\n  size_t v13; // r8\n  const char *v14; // rcx\n  cocos2d::CCSprite *v15; // rax\n  int v16; // r8d\n  void **v17; // rcx\n  ButtonSprite *v18; // rbx\n  __int64 v19; // rax\n  CCMenuItemSpriteExtra *v20; // rbx\n  void *v21; // rcx\n  bool v23; // [rsp+28h] [rbp-A0h]\n  cocos2d::CCPoint v24[2]; // [rsp+40h] [rbp-88h] BYREF\n  void *Block[2]; // [rsp+50h] [rbp-78h] BYREF\n  __m128i si128; // [rsp+60h] [rbp-68h]\n\n  v24[1] = (cocos2d::CCPoint)a2;\n  v11 = cocos2d::CCString::createWithFormat(\"GJ_button_%02d.png\", a7);\n  CString = cocos2d::CCString::getCString(v11);\n  *(_OWORD *)Block = 0;\n  si128 = 0;\n  v13 = -1;\n  do\n    ++v13;\n  while ( CString[v13] );\n  sub_14003A930(Block, CString, v13);\n  v14 = a2;\n  if ( *((_QWORD *)a2 + 3) > 0xFu )\n    v14 = *(const char **)a2;\n  v15 = cocos2d::CCSprite::createWithSpriteFrameName(v14);\n  v17 = Block;\n  if ( si128.m128i_i64[1] > 0xFuLL )\n    v17 = (void **)Block[0];\n  v18 = ButtonSprite::create(v15, 32, v16, 32.0, 1.0, v23, (const char *)v17, 0);\n  cocos2d::CCPoint::CCPoint(v24);\n  cocos2d::CCPoint::operator=(&v18->m_spritePosition, v19);\n  ButtonSprite::updateSpriteBGSize(v18);\n  v20 = CCMenuItemSpriteExtra::create(v18, nullptr, a1, a3);\n  ((void (__fastcall *)(CCMenuItemSpriteExtra *))v20->setScale_0)(v20);\n  HIDWORD(v20->m_pDisabledImage) = a5;\n  if ( a4 )\n    (*(void (__fastcall **)(__int64, CCMenuItemSpriteExtra *))(*(_QWORD *)a4 + 448LL))(a4, v20);\n  if ( si128.m128i_i64[1] > 0xFuLL )\n  {\n    v21 = Block[0];\n    if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )\n    {\n      v21 = *((void **)Block[0] - 1);\n      if ( (unsigned __int64)((char *)Block[0] - (char *)v21 - 8) > 0x1F )\n        invalid_parameter_noinfo_noreturn();\n    }\n    j_j_free(v21);\n  }\n  si128 = _mm_load_si128((const __m128i *)&xmmword_140623F30);\n  LOBYTE(Block[0]) = 0;\n  sub_14003A830((__int64)a2);\n  return v20;\n}", "assembly": "; \n; LevelLeaderboard::getSpriteButton from 0x140301ca0 to 0x140301e73 (467 bytes)\n; \n; 4 xrefs:\n; > LevelLeaderboard::init @ 0x140301005\n; > LevelLeaderboard::init @ 0x1403010dd\n; > LevelLeaderboard::init @ 0x140301294\n; > <???> @ 0x1406d437c\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, 0x140301ca0\npush    rbp                                                            ; +0x2, 0x140301ca2\npush    rsi                                                            ; +0x3, 0x140301ca3\npush    rdi                                                            ; +0x4, 0x140301ca4\npush    r14                                                            ; +0x5, 0x140301ca5\npush    r15                                                            ; +0x7, 0x140301ca7\nsub     rsp, 98h                                                       ; +0x9, 0x140301ca9\nmovaps  [rsp+0C8h+var_48], xmm6                                        ; +0x10, 0x140301cb0\nmov     rax, cs:__security_cookie                                      ; +0x18, 0x140301cb8\nxor     rax, rsp                                                       ; +0x1f, 0x140301cbf\nmov     [rsp+0C8h+var_58], rax                                         ; +0x22, 0x140301cc2\nmov     rsi, r9                                                        ; +0x27, 0x140301cc7\nmov     r14, r8                                                        ; +0x2a, 0x140301cca\nmov     rdi, rdx                                                       ; +0x2d, 0x140301ccd\nmov     rbp, rcx                                                       ; +0x30, 0x140301cd0\nmov     [rsp+0C8h+var_80], rdx                                         ; +0x33, 0x140301cd3\nmov     r15, [rsp+0C8h+arg_28]                                         ; +0x38, 0x140301cd8\nmov     edx, [rsp+0C8h+arg_30]                                         ; +0x40, 0x140301ce0\nlea     rcx, aGjButton02dPng; \"GJ_button_%02d.png\"                     ; +0x47, 0x140301ce7\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x4e, 0x140301cee\nmov     rcx, rax                                                       ; +0x54, 0x140301cf4\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x57, 0x140301cf7\nxorps   xmm0, xmm0                                                     ; +0x5d, 0x140301cfd\nmovups  xmmword ptr [rsp+0C8h+Block], xmm0                             ; +0x60, 0x140301d00\nxorps   xmm1, xmm1                                                     ; +0x65, 0x140301d05\nmovdqu  [rsp+0C8h+var_68], xmm1                                        ; +0x68, 0x140301d08\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0x6e, 0x140301d0e\ninc     r8                                                             ; +0x75, 0x140301d15\ncmp     byte ptr [rax+r8], 0                                           ; +0x78, 0x140301d18\njnz     short loc_140301D15                                            ; +0x7d, 0x140301d1d\nmov     rdx, rax                                                       ; +0x7f, 0x140301d1f\nlea     rcx, [rsp+0C8h+Block]                                          ; +0x82, 0x140301d22\ncall    sub_14003A930                                                  ; +0x87, 0x140301d27\nnop                                                                    ; +0x8c, 0x140301d2c\nmov     rcx, rdi                                                       ; +0x8d, 0x140301d2d\ncmp     qword ptr [rdi+18h], 0Fh                                       ; +0x90, 0x140301d30\njbe     short loc_140301D3A                                            ; +0x95, 0x140301d35\nmov     rcx, [rdi]                                                     ; +0x97, 0x140301d37\ncall    cs:?createWithSpriteFrameName@CCSprite@cocos2d@@SAPEAV12@PEBD@Z; cocos2d::CCSprite::createWithSpriteFrameName(char const *) ; +0x9a, 0x140301d3a\nlea     rcx, [rsp+0C8h+Block]                                          ; +0xa0, 0x140301d40\ncmp     qword ptr [rsp+0C8h+var_68+8], 0Fh                             ; +0xa5, 0x140301d45\ncmova   rcx, [rsp+0C8h+Block]                                          ; +0xab, 0x140301d4b\nmov     [rsp+0C8h+var_90], 0                                           ; +0xb1, 0x140301d51\nmov     [rsp+0C8h+var_98], rcx                                         ; +0xb6, 0x140301d56\nmovss   xmm0, cs:flt_140622C24                                         ; +0xbb, 0x140301d5b\nmovss   [rsp+0C8h+var_A8], xmm0                                        ; +0xc3, 0x140301d63\nmovss   xmm3, cs:dword_140623180                                       ; +0xc9, 0x140301d69\nmov     edx, 20h ; ' '                                                 ; +0xd1, 0x140301d71\nmov     rcx, rax                                                       ; +0xd6, 0x140301d76\ncall    ButtonSprite__create                                           ; +0xd9, 0x140301d79\nmov     rbx, rax                                                       ; +0xde, 0x140301d7e\nmov     rdx, r15                                                       ; +0xe1, 0x140301d81\nlea     rcx, [rsp+0C8h+var_88]                                         ; +0xe4, 0x140301d84\ncall    cs:??0CCPoint@cocos2d@@QEAA@AEBV01@@Z; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const &) ; +0xe9, 0x140301d89\nlea     rcx, [rbx+298h]                                                ; +0xef, 0x140301d8f\nmov     rdx, rax                                                       ; +0xf6, 0x140301d96\ncall    cs:??4CCPoint@cocos2d@@QEAAAEAV01@AEBV01@@Z; cocos2d::CCPoint::operator=(cocos2d::CCPoint const &) ; +0xf9, 0x140301d99\nmov     rcx, rbx                                                       ; +0xff, 0x140301d9f\ncall    ButtonSprite__updateSpriteBGSize                               ; +0x102, 0x140301da2\nmov     r9, r14                                                        ; +0x107, 0x140301da7\nmov     r8, rbp                                                        ; +0x10a, 0x140301daa\nxor     edx, edx                                                       ; +0x10d, 0x140301dad\nmov     rcx, rbx                                                       ; +0x10f, 0x140301daf\ncall    CCMenuItemSpriteExtra__create                                  ; +0x112, 0x140301db2\nmov     rbx, rax                                                       ; +0x117, 0x140301db7\nmov     rdx, [rax]                                                     ; +0x11a, 0x140301dba\nmovss   xmm6, [rsp+0C8h+arg_20]                                        ; +0x11d, 0x140301dbd\nmovaps  xmm1, xmm6                                                     ; +0x126, 0x140301dc6\nmov     rcx, rax                                                       ; +0x129, 0x140301dc9\ncall    qword ptr [rdx+0A0h]                                           ; +0x12c, 0x140301dcc\nmovss   dword ptr [rbx+194h], xmm6                                     ; +0x132, 0x140301dd2\ntest    rsi, rsi                                                       ; +0x13a, 0x140301dda\njz      short loc_140301DF0                                            ; +0x13d, 0x140301ddd\nmov     r8, [rsi]                                                      ; +0x13f, 0x140301ddf\nmov     rdx, rbx                                                       ; +0x142, 0x140301de2\nmov     rcx, rsi                                                       ; +0x145, 0x140301de5\ncall    qword ptr [r8+1C0h]                                            ; +0x148, 0x140301de8\nnop                                                                    ; +0x14f, 0x140301def\nmov     rdx, qword ptr [rsp+0C8h+var_68+8]                             ; +0x150, 0x140301df0\ncmp     rdx, 0Fh                                                       ; +0x155, 0x140301df5\njbe     short loc_140301E30                                            ; +0x159, 0x140301df9\ninc     rdx                                                            ; +0x15b, 0x140301dfb\nmov     rcx, [rsp+0C8h+Block]; Block                                   ; +0x15e, 0x140301dfe\nmov     rax, rcx                                                       ; +0x163, 0x140301e03\ncmp     rdx, 1000h                                                     ; +0x166, 0x140301e06\njb      short loc_140301E2B                                            ; +0x16d, 0x140301e0d\nadd     rdx, 27h ; '''                                                 ; +0x16f, 0x140301e0f\nmov     rcx, [rcx-8]                                                   ; +0x173, 0x140301e13\nsub     rax, rcx                                                       ; +0x177, 0x140301e17\nadd     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x17a, 0x140301e1a\ncmp     rax, 1Fh                                                       ; +0x17e, 0x140301e1e\njbe     short loc_140301E2B                                            ; +0x182, 0x140301e22\ncall    cs:_invalid_parameter_noinfo_noreturn                          ; +0x184, 0x140301e24\ndb 0CCh                                                                ; +0x18a, 0x140301e2a\ncall    j_j_free                                                       ; +0x18b, 0x140301e2b\nmovdqa  xmm0, cs:xmmword_140623F30                                     ; +0x190, 0x140301e30\nmovdqu  [rsp+0C8h+var_68], xmm0                                        ; +0x198, 0x140301e38\nmov     byte ptr [rsp+0C8h+Block], 0                                   ; +0x19e, 0x140301e3e\nmov     rcx, rdi                                                       ; +0x1a3, 0x140301e43\ncall    sub_14003A830                                                  ; +0x1a6, 0x140301e46\nmov     rax, rbx                                                       ; +0x1ab, 0x140301e4b\nmov     rcx, [rsp+0C8h+var_58]                                         ; +0x1ae, 0x140301e4e\nxor     rcx, rsp; StackCookie                                          ; +0x1b3, 0x140301e53\ncall    __security_check_cookie                                        ; +0x1b6, 0x140301e56\nmovaps  xmm6, [rsp+0C8h+var_48]                                        ; +0x1bb, 0x140301e5b\nadd     rsp, 98h                                                       ; +0x1c3, 0x140301e63\npop     r15                                                            ; +0x1ca, 0x140301e6a\npop     r14                                                            ; +0x1cc, 0x140301e6c\npop     rdi                                                            ; +0x1ce, 0x140301e6e\npop     rsi                                                            ; +0x1cf, 0x140301e6f\npop     rbp                                                            ; +0x1d0, 0x140301e70\npop     rbx                                                            ; +0x1d1, 0x140301e71\nretn                                                                   ; +0x1d2, 0x140301e72", "xrefs": ["LevelLeaderboard::init @ 0x140301005", "LevelLeaderboard::init @ 0x1403010dd", "LevelLeaderboard::init @ 0x140301294", "<???> @ 0x1406d437c"], "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"}