{"type": "func", "start": 4300586976, "end": 4300587230, "name": "GJGameLevel::getAudioFileName", "pseudocode": "// \n// GJGameLevel::getAudioFileName from 0x10055bfe0 to 0x10055c0de (254 bytes)\n// \n// 10 xrefs:\n// > PlayLayer::setupHasCompleted @ 0x1000ae019\n// > PlayLayer::prepareMusic @ 0x1000b2dfe\n// > GJBaseGameLayer::processActivatedAudioTriggers @ 0x100160786\n// > EditLevelLayer::onEdit @ 0x1001fbd93\n// > EditLevelLayer::playStep2 @ 0x1001fdf56\n// > SongSelectNode::getSongFileName @ 0x100219a95\n// > EditorPauseLayer::playStep2 @ 0x100294d1a\n// > LevelInfoLayer::playStep2 @ 0x1002c4256\n// > GJWorldNode::playStep2 @ 0x1003c4d66\n// > LevelPage::playStep2 @ 0x1004374d6\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\nsize_t *__fastcall GJGameLevel::getAudioFileName(size_t *a1, __int64 a2, double a3)\n{\n  const char *data; // r14\n  size_t v4; // rax\n  size_t v5; // r15\n  _BYTE *v6; // r12\n  size_t v8; // r13\n  std::string v9; // [rsp+0h] [rbp-40h] BYREF\n\n  if ( !*(_DWORD *)(a2 + 600) )\n  {\n    LevelTools::getAudioFileName((__int64)a1, *(_DWORD *)(a2 + 596));\n    return a1;\n  }\n  MusicDownloadManager::sharedState();\n  MusicDownloadManager::pathForSong(&v9);\n  if ( (*(_BYTE *)&v9.__r_.__value_.__s.0 & 1) != 0 )\n    data = v9.__r_.__value_.__l.__data_;\n  else\n    data = v9.__r_.__value_.__s.__data_;\n  v4 = strlen(data);\n  if ( v4 >= 0xFFFFFFFFFFFFFFF8LL )\n    sub_100006BF0(a3);\n  v5 = v4;\n  if ( v4 >= 0x17 )\n  {\n    v8 = 26;\n    if ( (v4 | 7) != 0x17 )\n      v8 = (v4 | 7) + 1;\n    v6 = operator new(v8);\n    a1[2] = (size_t)v6;\n    *a1 = v8 | 1;\n    a1[1] = v5;\nLABEL_15:\n    memmove(v6, data, v5);\n    v6[v5] = 0;\n    if ( (*(_BYTE *)&v9.__r_.__value_.__s.0 & 1) == 0 )\n      return a1;\n    goto LABEL_10;\n  }\n  *(_BYTE *)a1 = 2 * v4;\n  v6 = (char *)a1 + 1;\n  if ( v4 )\n    goto LABEL_15;\n  *v6 = 0;\n  if ( (*(_BYTE *)&v9.__r_.__value_.__s.0 & 1) != 0 )\nLABEL_10:\n    operator delete(v9.__r_.__value_.__l.__data_);\n  return a1;\n}", "assembly": "; \n; GJGameLevel::getAudioFileName from 0x10055bfe0 to 0x10055c0de (254 bytes)\n; \n; 10 xrefs:\n; > PlayLayer::setupHasCompleted @ 0x1000ae019\n; > PlayLayer::prepareMusic @ 0x1000b2dfe\n; > GJBaseGameLayer::processActivatedAudioTriggers @ 0x100160786\n; > EditLevelLayer::onEdit @ 0x1001fbd93\n; > EditLevelLayer::playStep2 @ 0x1001fdf56\n; > SongSelectNode::getSongFileName @ 0x100219a95\n; > EditorPauseLayer::playStep2 @ 0x100294d1a\n; > LevelInfoLayer::playStep2 @ 0x1002c4256\n; > GJWorldNode::playStep2 @ 0x1003c4d66\n; > LevelPage::playStep2 @ 0x1004374d6\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, 0x10055bfe0\nmov     rbp, rsp                                                       ; +0x1, 0x10055bfe1\npush    r15                                                            ; +0x4, 0x10055bfe4\npush    r14                                                            ; +0x6, 0x10055bfe6\npush    r13                                                            ; +0x8, 0x10055bfe8\npush    r12                                                            ; +0xa, 0x10055bfea\npush    rbx                                                            ; +0xc, 0x10055bfec\nsub     rsp, 18h                                                       ; +0xd, 0x10055bfed\nmov     r14, rsi                                                       ; +0x11, 0x10055bff1\nmov     rbx, rdi                                                       ; +0x14, 0x10055bff4\ncmp     dword ptr [rsi+258h], 0                                        ; +0x17, 0x10055bff7\njz      short loc_10055C024                                            ; +0x1e, 0x10055bffe\ncall    MusicDownloadManager__sharedState                              ; +0x20, 0x10055c000\nmov     edx, [r14+258h]                                                ; +0x25, 0x10055c005\nlea     rdi, [rbp+var_40]; this                                        ; +0x2c, 0x10055c00c\nmov     rsi, rax                                                       ; +0x30, 0x10055c010\ncall    MusicDownloadManager__pathForSong                              ; +0x33, 0x10055c013\ntest    byte ptr [rbp+var_40.__r_.__value_], 1                         ; +0x38, 0x10055c018\njz      short loc_10055C035                                            ; +0x3c, 0x10055c01c\nmov     r14, qword ptr [rbp+var_40.__r_.__value_+10h]                  ; +0x3e, 0x10055c01e\njmp     short loc_10055C039                                            ; +0x42, 0x10055c022\nmov     esi, [r14+254h]                                                ; +0x44, 0x10055c024\nmov     rdi, rbx                                                       ; +0x4b, 0x10055c02b\ncall    LevelTools__getAudioFileName                                   ; +0x4e, 0x10055c02e\njmp     short loc_10055C079                                            ; +0x53, 0x10055c033\nlea     r14, [rbp+var_40.__r_.__value_+1]                              ; +0x55, 0x10055c035\nmov     rdi, r14; __s                                                  ; +0x59, 0x10055c039\ncall    _strlen                                                        ; +0x5c, 0x10055c03c\ncmp     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x61, 0x10055c041\njnb     loc_10055C0D9                                                  ; +0x65, 0x10055c045\nmov     r15, rax                                                       ; +0x6b, 0x10055c04b\ncmp     rax, 17h                                                       ; +0x6e, 0x10055c04e\njnb     short loc_10055C08B                                            ; +0x72, 0x10055c052\nlea     eax, [r15+r15]                                                 ; +0x74, 0x10055c054\nmov     [rbx], al                                                      ; +0x78, 0x10055c058\nmov     r12, rbx                                                       ; +0x7a, 0x10055c05a\ninc     r12                                                            ; +0x7d, 0x10055c05d\ntest    r15, r15                                                       ; +0x80, 0x10055c060\njnz     short loc_10055C0BE                                            ; +0x83, 0x10055c063\nmov     byte ptr [r12+r15], 0                                          ; +0x85, 0x10055c065\ntest    byte ptr [rbp+var_40.__r_.__value_], 1                         ; +0x8a, 0x10055c06a\njz      short loc_10055C079                                            ; +0x8e, 0x10055c06e\nmov     rdi, qword ptr [rbp+var_40.__r_.__value_+10h]; __p             ; +0x90, 0x10055c070\ncall    __ZdlPv; operator delete(void *)                               ; +0x94, 0x10055c074\nmov     rax, rbx                                                       ; +0x99, 0x10055c079\nadd     rsp, 18h                                                       ; +0x9c, 0x10055c07c\npop     rbx                                                            ; +0xa0, 0x10055c080\npop     r12                                                            ; +0xa1, 0x10055c081\npop     r13                                                            ; +0xa3, 0x10055c083\npop     r14                                                            ; +0xa5, 0x10055c085\npop     r15                                                            ; +0xa7, 0x10055c087\npop     rbp                                                            ; +0xa9, 0x10055c089\nretn                                                                   ; +0xaa, 0x10055c08a\nmov     rax, r15                                                       ; +0xab, 0x10055c08b\nor      rax, 7                                                         ; +0xae, 0x10055c08e\nlea     rcx, [rax+1]                                                   ; +0xb2, 0x10055c092\ncmp     rax, 17h                                                       ; +0xb6, 0x10055c096\nmov     r13d, 1Ah                                                      ; +0xba, 0x10055c09a\ncmovnz  r13, rcx                                                       ; +0xc0, 0x10055c0a0\nmov     rdi, r13; __sz                                                 ; +0xc4, 0x10055c0a4\ncall    __Znwm; operator new(ulong)                                    ; +0xc7, 0x10055c0a7\nmov     r12, rax                                                       ; +0xcc, 0x10055c0ac\nmov     [rbx+10h], rax                                                 ; +0xcf, 0x10055c0af\nor      r13, 1                                                         ; +0xd3, 0x10055c0b3\nmov     [rbx], r13                                                     ; +0xd7, 0x10055c0b7\nmov     [rbx+8], r15                                                   ; +0xda, 0x10055c0ba\nmov     rdi, r12; __dst                                                ; +0xde, 0x10055c0be\nmov     rsi, r14; __src                                                ; +0xe1, 0x10055c0c1\nmov     rdx, r15; __len                                                ; +0xe4, 0x10055c0c4\ncall    _memmove                                                       ; +0xe7, 0x10055c0c7\nmov     byte ptr [r12+r15], 0                                          ; +0xec, 0x10055c0cc\ntest    byte ptr [rbp+var_40.__r_.__value_], 1                         ; +0xf1, 0x10055c0d1\njnz     short loc_10055C070                                            ; +0xf5, 0x10055c0d5\njmp     short loc_10055C079                                            ; +0xf7, 0x10055c0d7\ncall    sub_100006BF0                                                  ; +0xf9, 0x10055c0d9", "xrefs": ["PlayLayer::setupHasCompleted @ 0x1000ae019", "PlayLayer::prepareMusic @ 0x1000b2dfe", "GJBaseGameLayer::processActivatedAudioTriggers @ 0x100160786", "EditLevelLayer::onEdit @ 0x1001fbd93", "EditLevelLayer::playStep2 @ 0x1001fdf56", "SongSelectNode::getSongFileName @ 0x100219a95", "EditorPauseLayer::playStep2 @ 0x100294d1a", "LevelInfoLayer::playStep2 @ 0x1002c4256", "GJWorldNode::playStep2 @ 0x1003c4d66", "LevelPage::playStep2 @ 0x1004374d6"], "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"}