{"type": "func", "start": 4301254016, "end": 4301254634, "name": "GJSongBrowser::loadPage", "pseudocode": "// \n// GJSongBrowser::loadPage from 0x1005fed80 to 0x1005fefea (618 bytes)\n// \n// 3 xrefs:\n// > GJSongBrowser::init @ 0x1005fed70\n// > GJSongBrowser::onPrevPage @ 0x1005ff37d\n// > GJSongBrowser::onNextPage @ 0x1005ff39d\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\nvoid __fastcall GJSongBrowser::loadPage(GJSongBrowser *a1, int a2)\n{\n  unsigned int v4; // eax\n  __int64 v5; // r15\n  cocos2d::CCArray *m_downloadedSongs; // rsi\n  __int64 v7; // rdi\n  unsigned int v8; // r12d\n  __int64 v9; // r14\n  MusicDownloadManager *v10; // rax\n  cocos2d::CCArray *v11; // r15\n  int v12; // r14d\n  unsigned int v13; // r12d\n  __int64 v14; // rax\n  unsigned int v16; // r12d\n  unsigned int v17; // eax\n  cocos2d::CCString *v18; // rax\n  const char *CString; // rax\n  CustomListView *v20; // rax\n  char v21; // [rsp+0h] [rbp-40h]\n  int v22; // [rsp+14h] [rbp-2Ch]\n\n  a1->m_page = a2;\n  ((void (__fastcall *)(CCMenuItemSpriteExtra *, bool))a1->m_leftArrow->setVisible)(a1->m_leftArrow, a2 > 0);\n  v4 = sub_100720070(a1->m_downloadedSongs);\n  v5 = sub_10071FD00(v4);\n  m_downloadedSongs = a1->m_downloadedSongs;\n  sub_100720050(v5, m_downloadedSongs);\n  v7 = v5;\n  if ( (unsigned int)sub_100720070(v5) )\n  {\n    v8 = 0;\n    do\n    {\n      v9 = sub_1007200C0(v5, v8);\n      v10 = MusicDownloadManager::sharedState();\n      m_downloadedSongs = (cocos2d::CCArray *)*(unsigned int *)(v9 + 316);\n      if ( !MusicDownloadManager::isSongDownloaded(v10, (int)m_downloadedSongs) )\n      {\n        m_downloadedSongs = (cocos2d::CCArray *)v9;\n        sub_100720220(a1->m_downloadedSongs, v9, 1);\n      }\n      ++v8;\n      v7 = v5;\n    }\n    while ( v8 < (unsigned int)sub_100720070(v5) );\n  }\n  v11 = (cocos2d::CCArray *)sub_10071F9E0(v7, m_downloadedSongs);\n  v12 = 10 * a2;\n  v22 = sub_100720070(a1->m_downloadedSongs);\n  if ( (unsigned int)sub_100720070(a1->m_downloadedSongs) )\n  {\n    v13 = 10 * a2;\n    do\n    {\n      if ( v13 > (unsigned int)sub_100720070(a1->m_downloadedSongs) - 1 )\n        break;\n      v14 = sub_1007200C0(a1->m_downloadedSongs, v13);\n      sub_10071FCD0(v11, v14);\n    }\n    while ( (int)v13++ < v12 + 9 );\n  }\n  v16 = v12 + sub_100720070(v11);\n  v17 = sub_100720070(a1->m_downloadedSongs);\n  ((void (__fastcall *)(CCMenuItemSpriteExtra *, bool))a1->m_rightArrow->setVisible)(a1->m_rightArrow, v16 < v17);\n  ((void (__fastcall *)(CCMenuItemSpriteExtra *, bool))a1->m_leftArrow->setVisible)(a1->m_leftArrow, a2 != 0);\n  ((void (__fastcall *)(CCMenuItemSpriteExtra *, bool))a1->m_rightArrow->setVisible)(a1->m_rightArrow, v12 + 10 < v22);\n  v18 = (cocos2d::CCString *)sub_1007AB580(\"%i to %i of %i\", v21);\n  CString = cocos2d::CCString::getCString(v18);\n  ((void (__fastcall *)(cocos2d::CCLabelBMFont *, const char *))a1->m_countText->setString)(a1->m_countText, CString);\n  ((void (__fastcall *)(GJListLayer *, __int64, __int64))a1->m_listLayer->removeChildByTag_0)(a1->m_listLayer, 9, 1);\n  v20 = CustomListView::create(v11, &a1->TableViewCellDelegate, 220.0, 356.0, 0, CustomSong, 0.0);\n  a1->m_listView = v20;\n  ((void (__fastcall *)(CustomListView *, __int64))v20->setTag)(v20, 9);\n  ((void (__fastcall *)(GJListLayer *, CustomListView *, __int64))a1->m_listLayer->addChild_0)(\n    a1->m_listLayer,\n    a1->m_listView,\n    6);\n}", "assembly": "; \n; GJSongBrowser::loadPage from 0x1005fed80 to 0x1005fefea (618 bytes)\n; \n; 3 xrefs:\n; > GJSongBrowser::init @ 0x1005fed70\n; > GJSongBrowser::onPrevPage @ 0x1005ff37d\n; > GJSongBrowser::onNextPage @ 0x1005ff39d\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, 0x1005fed80\nmov     rbp, rsp                                                       ; +0x1, 0x1005fed81\npush    r15                                                            ; +0x4, 0x1005fed84\npush    r14                                                            ; +0x6, 0x1005fed86\npush    r13                                                            ; +0x8, 0x1005fed88\npush    r12                                                            ; +0xa, 0x1005fed8a\npush    rbx                                                            ; +0xc, 0x1005fed8c\nsub     rsp, 18h                                                       ; +0xd, 0x1005fed8d\nmov     r13d, esi                                                      ; +0x11, 0x1005fed91\nmov     rbx, rdi                                                       ; +0x14, 0x1005fed94\nmov     [rdi+270h], esi                                                ; +0x17, 0x1005fed97\nxor     esi, esi                                                       ; +0x1d, 0x1005fed9d\ntest    r13d, r13d                                                     ; +0x1f, 0x1005fed9f\nsetnle  sil                                                            ; +0x22, 0x1005feda2\nmov     rdi, [rdi+288h]                                                ; +0x26, 0x1005feda6\nmov     rax, [rdi]                                                     ; +0x2d, 0x1005fedad\ncall    qword ptr [rax+148h]                                           ; +0x30, 0x1005fedb0\nmov     rdi, [rbx+2A0h]                                                ; +0x36, 0x1005fedb6\ncall    sub_100720070                                                  ; +0x3d, 0x1005fedbd\nmov     edi, eax                                                       ; +0x42, 0x1005fedc2\ncall    sub_10071FD00                                                  ; +0x44, 0x1005fedc4\nmov     r15, rax                                                       ; +0x49, 0x1005fedc9\nmov     rsi, [rbx+2A0h]                                                ; +0x4c, 0x1005fedcc\nmov     rdi, rax                                                       ; +0x53, 0x1005fedd3\ncall    sub_100720050                                                  ; +0x56, 0x1005fedd6\nmov     rdi, r15                                                       ; +0x5b, 0x1005feddb\ncall    sub_100720070                                                  ; +0x5e, 0x1005fedde\ntest    eax, eax                                                       ; +0x63, 0x1005fede3\njz      short loc_1005FEE3C                                            ; +0x65, 0x1005fede5\nxor     r12d, r12d                                                     ; +0x67, 0x1005fede7\njmp     short loc_1005FEE00                                            ; +0x6a, 0x1005fedea\nalign 10h                                                              ; +0x6c, 0x1005fedec\ninc     r12d                                                           ; +0x70, 0x1005fedf0\nmov     rdi, r15                                                       ; +0x73, 0x1005fedf3\ncall    sub_100720070                                                  ; +0x76, 0x1005fedf6\ncmp     r12d, eax                                                      ; +0x7b, 0x1005fedfb\njnb     short loc_1005FEE3C                                            ; +0x7e, 0x1005fedfe\nmov     rdi, r15                                                       ; +0x80, 0x1005fee00\nmov     esi, r12d                                                      ; +0x83, 0x1005fee03\ncall    sub_1007200C0                                                  ; +0x86, 0x1005fee06\nmov     r14, rax                                                       ; +0x8b, 0x1005fee0b\ncall    MusicDownloadManager__sharedState                              ; +0x8e, 0x1005fee0e\nmov     esi, [r14+13Ch]                                                ; +0x93, 0x1005fee13\nmov     rdi, rax                                                       ; +0x9a, 0x1005fee1a\ncall    MusicDownloadManager__isSongDownloaded                         ; +0x9d, 0x1005fee1d\ntest    al, al                                                         ; +0xa2, 0x1005fee22\njnz     short loc_1005FEDF0                                            ; +0xa4, 0x1005fee24\nmov     rdi, [rbx+2A0h]                                                ; +0xa6, 0x1005fee26\nmov     rsi, r14                                                       ; +0xad, 0x1005fee2d\nmov     edx, 1                                                         ; +0xb0, 0x1005fee30\ncall    sub_100720220                                                  ; +0xb5, 0x1005fee35\njmp     short loc_1005FEDF0                                            ; +0xba, 0x1005fee3a\ncall    sub_10071F9E0                                                  ; +0xbc, 0x1005fee3c\nmov     r15, rax                                                       ; +0xc1, 0x1005fee41\nmov     [rbp+var_38], r13                                              ; +0xc4, 0x1005fee44\nlea     eax, ds:0[r13*2]                                               ; +0xc8, 0x1005fee48\nlea     r14d, [rax+rax*4]                                              ; +0xd0, 0x1005fee50\nmov     rdi, [rbx+2A0h]                                                ; +0xd4, 0x1005fee54\ncall    sub_100720070                                                  ; +0xdb, 0x1005fee5b\nmov     [rbp+var_2C], eax                                              ; +0xe0, 0x1005fee60\nmov     rdi, [rbx+2A0h]                                                ; +0xe3, 0x1005fee63\ncall    sub_100720070                                                  ; +0xea, 0x1005fee6a\ntest    eax, eax                                                       ; +0xef, 0x1005fee6f\njz      short loc_1005FEEBA                                            ; +0xf1, 0x1005fee71\nlea     r13d, [r14+9]                                                  ; +0xf3, 0x1005fee73\nmov     r12d, r14d                                                     ; +0xf7, 0x1005fee77\nnop     word ptr [rax+rax+00h]                                         ; +0xfa, 0x1005fee7a\nmov     rdi, [rbx+2A0h]                                                ; +0x100, 0x1005fee80\ncall    sub_100720070                                                  ; +0x107, 0x1005fee87\ndec     eax                                                            ; +0x10c, 0x1005fee8c\ncmp     r12d, eax                                                      ; +0x10e, 0x1005fee8e\nja      short loc_1005FEEBA                                            ; +0x111, 0x1005fee91\nmov     rdi, [rbx+2A0h]                                                ; +0x113, 0x1005fee93\nmov     esi, r12d                                                      ; +0x11a, 0x1005fee9a\ncall    sub_1007200C0                                                  ; +0x11d, 0x1005fee9d\nmov     rdi, r15                                                       ; +0x122, 0x1005feea2\nmov     rsi, rax                                                       ; +0x125, 0x1005feea5\ncall    sub_10071FCD0                                                  ; +0x128, 0x1005feea8\nlea     eax, [r12+1]                                                   ; +0x12d, 0x1005feead\ncmp     r12d, r13d                                                     ; +0x132, 0x1005feeb2\nmov     r12d, eax                                                      ; +0x135, 0x1005feeb5\njl      short loc_1005FEE80                                            ; +0x138, 0x1005feeb8\nmov     rdi, r15                                                       ; +0x13a, 0x1005feeba\ncall    sub_100720070                                                  ; +0x13d, 0x1005feebd\nmov     r12d, eax                                                      ; +0x142, 0x1005feec2\nadd     r12d, r14d                                                     ; +0x145, 0x1005feec5\nmov     rdi, [rbx+2A0h]                                                ; +0x148, 0x1005feec8\ncall    sub_100720070                                                  ; +0x14f, 0x1005feecf\nxor     esi, esi                                                       ; +0x154, 0x1005feed4\ncmp     r12d, eax                                                      ; +0x156, 0x1005feed6\nsetb    sil                                                            ; +0x159, 0x1005feed9\nmov     rdi, [rbx+280h]                                                ; +0x15d, 0x1005feedd\nmov     rax, [rdi]                                                     ; +0x164, 0x1005feee4\ncall    qword ptr [rax+148h]                                           ; +0x167, 0x1005feee7\nxor     esi, esi                                                       ; +0x16d, 0x1005feeed\ncmp     dword ptr [rbp+var_38], 0                                      ; +0x16f, 0x1005feeef\nsetnz   sil                                                            ; +0x173, 0x1005feef3\nmov     rdi, [rbx+288h]                                                ; +0x177, 0x1005feef7\nmov     rax, [rdi]                                                     ; +0x17e, 0x1005feefe\ncall    qword ptr [rax+148h]                                           ; +0x181, 0x1005fef01\nlea     eax, [r14+0Ah]                                                 ; +0x187, 0x1005fef07\nmov     rdi, [rbx+280h]                                                ; +0x18b, 0x1005fef0b\nmov     rcx, [rdi]                                                     ; +0x192, 0x1005fef12\nxor     esi, esi                                                       ; +0x195, 0x1005fef15\nmov     r13d, [rbp+var_2C]                                             ; +0x197, 0x1005fef17\ncmp     eax, r13d                                                      ; +0x19b, 0x1005fef1b\nsetl    sil                                                            ; +0x19e, 0x1005fef1e\nmov     r12d, r13d                                                     ; +0x1a2, 0x1005fef22\ncmovl   r12d, eax                                                      ; +0x1a5, 0x1005fef25\ncall    qword ptr [rcx+148h]                                           ; +0x1a9, 0x1005fef29\nor      r14d, 1                                                        ; +0x1af, 0x1005fef2f\nlea     rdi, aIToIOfI; \"%i to %i of %i\"                                ; +0x1b3, 0x1005fef33\nmov     esi, r14d                                                      ; +0x1ba, 0x1005fef3a\nmov     edx, r12d                                                      ; +0x1bd, 0x1005fef3d\nmov     ecx, r13d                                                      ; +0x1c0, 0x1005fef40\nxor     eax, eax                                                       ; +0x1c3, 0x1005fef43\ncall    sub_1007AB580                                                  ; +0x1c5, 0x1005fef45\nmov     rdi, rax                                                       ; +0x1ca, 0x1005fef4a\ncall    cocos2d__CCString__getCString                                  ; +0x1cd, 0x1005fef4d\nmov     rdi, [rbx+290h]                                                ; +0x1d2, 0x1005fef52\nmov     rcx, [rdi]                                                     ; +0x1d9, 0x1005fef59\nmov     rsi, rax                                                       ; +0x1dc, 0x1005fef5c\ncall    qword ptr [rcx+390h]                                           ; +0x1df, 0x1005fef5f\nmov     rdi, [rbx+238h]                                                ; +0x1e5, 0x1005fef65\nmov     rax, [rdi]                                                     ; +0x1ec, 0x1005fef6c\nmov     esi, 9                                                         ; +0x1ef, 0x1005fef6f\nmov     edx, 1                                                         ; +0x1f4, 0x1005fef74\ncall    qword ptr [rax+228h]                                           ; +0x1f9, 0x1005fef79\nlea     rsi, [rbx+268h]                                                ; +0x1ff, 0x1005fef7f\nmovss   xmm0, cs:dword_100815BB0                                       ; +0x206, 0x1005fef86\nmovss   xmm1, cs:dword_100815BB4                                       ; +0x20e, 0x1005fef8e\nxorps   xmm2, xmm2                                                     ; +0x216, 0x1005fef96\nmov     rdi, r15                                                       ; +0x219, 0x1005fef99\nxor     edx, edx                                                       ; +0x21c, 0x1005fef9c\nmov     ecx, 0Fh                                                       ; +0x21e, 0x1005fef9e\ncall    CustomListView__create                                         ; +0x223, 0x1005fefa3\nmov     [rbx+2A8h], rax                                                ; +0x228, 0x1005fefa8\nmov     rcx, [rax]                                                     ; +0x22f, 0x1005fefaf\nmov     rdi, rax                                                       ; +0x232, 0x1005fefb2\nmov     esi, 9                                                         ; +0x235, 0x1005fefb5\ncall    qword ptr [rcx+48h]                                            ; +0x23a, 0x1005fefba\nmov     rdi, [rbx+238h]                                                ; +0x23d, 0x1005fefbd\nmov     rsi, [rbx+2A8h]                                                ; +0x244, 0x1005fefc4\nmov     rax, [rdi]                                                     ; +0x24b, 0x1005fefcb\nmov     rax, [rax+1C0h]                                                ; +0x24e, 0x1005fefce\nmov     edx, 6                                                         ; +0x255, 0x1005fefd5\nadd     rsp, 18h                                                       ; +0x25a, 0x1005fefda\npop     rbx                                                            ; +0x25e, 0x1005fefde\npop     r12                                                            ; +0x25f, 0x1005fefdf\npop     r13                                                            ; +0x261, 0x1005fefe1\npop     r14                                                            ; +0x263, 0x1005fefe3\npop     r15                                                            ; +0x265, 0x1005fefe5\npop     rbp                                                            ; +0x267, 0x1005fefe7\njmp     rax                                                            ; +0x268, 0x1005fefe8", "xrefs": ["GJSongBrowser::init @ 0x1005fed70", "GJSongBrowser::onPrevPage @ 0x1005ff37d", "GJSongBrowser::onNextPage @ 0x1005ff39d"], "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"}