{"type": "func", "start": 6443119040, "end": 6443119331, "name": "cocos2d::ZipUtils::base64URLEncode", "pseudocode": "// \n// cocos2d::ZipUtils::base64URLEncode from 0x1800a31c0 to 0x1800a32e3 (291 bytes)\n// \n// 2 xrefs:\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b7a64\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_QWORD *__fastcall cocos2d::ZipUtils::base64URLEncode(_QWORD *a1, __int64 a2)\n{\n  __int64 v2; // rax\n  __int64 v4; // rdx\n  int v5; // eax\n  __int64 v6; // rdi\n  void *Src; // [rsp+30h] [rbp-48h] BYREF\n  __int128 v9; // [rsp+40h] [rbp-38h] BYREF\n  __int128 v10; // [rsp+50h] [rbp-28h]\n\n  v2 = a2;\n  Src = a1;\n  v4 = *(_QWORD *)(a2 + 16);\n  if ( v4 )\n  {\n    Src = nullptr;\n    if ( *(_QWORD *)(v2 + 24) > 0xFu )\n      v2 = *(_QWORD *)v2;\n    v5 = base64Encode((unsigned __int8 *)v2, v4, &Src, 1);\n    if ( v5 <= 0 )\n    {\n      if ( Src )\n        j_j_free_0(Src);\n      *(_OWORD *)a1 = 0;\n      a1[2] = 0;\n      a1[3] = 15;\n      *(_BYTE *)a1 = 0;\n    }\n    else\n    {\n      v9 = 0;\n      *(_QWORD *)&v10 = 0;\n      *((_QWORD *)&v10 + 1) = 15;\n      LOBYTE(v9) = 0;\n      v6 = v5;\n      if ( (unsigned __int64)v5 > 0xF )\n      {\n        sub_180007900(&v9, v5, 0, Src, v5);\n      }\n      else\n      {\n        *(_QWORD *)&v10 = v5;\n        memmove(&v9, Src, v5);\n        *((_BYTE *)&v9 + v6) = 0;\n      }\n      if ( Src )\n        j_j_free_0(Src);\n      *(_OWORD *)a1 = v9;\n      *((_OWORD *)a1 + 1) = v10;\n    }\n  }\n  else\n  {\n    sub_180016C80((__int64)a1, v2);\n  }\n  return a1;\n}", "assembly": "; \n; cocos2d::ZipUtils::base64URLEncode from 0x1800a31c0 to 0x1800a32e3 (291 bytes)\n; \n; 2 xrefs:\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b7a64\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\nmov     [rsp+arg_10], rbx                                              ; +0x0, 0x1800a31c0\nmov     [rsp+arg_18], rsi                                              ; +0x5, 0x1800a31c5\npush    rdi                                                            ; +0xa, 0x1800a31ca\nsub     rsp, 70h                                                       ; +0xb, 0x1800a31cb\nmov     rax, cs:__security_cookie                                      ; +0xf, 0x1800a31cf\nxor     rax, rsp                                                       ; +0x16, 0x1800a31d6\nmov     [rsp+78h+var_18], rax                                          ; +0x19, 0x1800a31d9\nmov     rax, rdx                                                       ; +0x1e, 0x1800a31de\nmov     rbx, rcx                                                       ; +0x21, 0x1800a31e1\nmov     [rsp+78h+Src], rcx                                             ; +0x24, 0x1800a31e4\nxor     esi, esi                                                       ; +0x29, 0x1800a31e9\nmov     rdx, [rdx+10h]                                                 ; +0x2b, 0x1800a31eb\ntest    rdx, rdx                                                       ; +0x2f, 0x1800a31ef\njnz     short loc_1800A3201                                            ; +0x32, 0x1800a31f2\nmov     rdx, rax                                                       ; +0x34, 0x1800a31f4\ncall    sub_180016C80                                                  ; +0x37, 0x1800a31f7\njmp     loc_1800A32C1                                                  ; +0x3c, 0x1800a31fc\nmov     [rsp+78h+Src], rsi                                             ; +0x41, 0x1800a3201\ncmp     qword ptr [rax+18h], 0Fh                                       ; +0x46, 0x1800a3206\njbe     short loc_1800A3210                                            ; +0x4b, 0x1800a320b\nmov     rax, [rax]                                                     ; +0x4d, 0x1800a320d\nmov     r9b, 1                                                         ; +0x50, 0x1800a3210\nlea     r8, [rsp+78h+Src]                                              ; +0x53, 0x1800a3213\nmov     rcx, rax                                                       ; +0x58, 0x1800a3218\ncall    base64Encode                                                   ; +0x5b, 0x1800a321b\ntest    eax, eax                                                       ; +0x60, 0x1800a3220\njle     short loc_1800A329D                                            ; +0x62, 0x1800a3222\nxorps   xmm0, xmm0                                                     ; +0x64, 0x1800a3224\nmovups  [rsp+78h+var_38], xmm0                                         ; +0x67, 0x1800a3227\nmov     qword ptr [rsp+78h+var_28], rsi                                ; +0x6c, 0x1800a322c\nmov     qword ptr [rsp+78h+var_28+8], 0Fh                              ; +0x71, 0x1800a3231\nmov     byte ptr [rsp+78h+var_38], sil                                 ; +0x7a, 0x1800a323a\nmovsxd  rdi, eax                                                       ; +0x7f, 0x1800a323f\nlea     rcx, [rsp+78h+var_38]; Src                                     ; +0x82, 0x1800a3242\ncmp     rdi, 0Fh                                                       ; +0x87, 0x1800a3247\nja      short loc_1800A3266                                            ; +0x8b, 0x1800a324b\nmov     qword ptr [rsp+78h+var_28], rdi                                ; +0x8d, 0x1800a324d\nmov     r8, rdi; Size                                                  ; +0x92, 0x1800a3252\nmov     rdx, [rsp+78h+Src]; Src                                        ; +0x95, 0x1800a3255\ncall    memmove                                                        ; +0x9a, 0x1800a325a\nmov     byte ptr [rsp+rdi+78h+var_38], 0                               ; +0x9f, 0x1800a325f\njmp     short loc_1800A327B                                            ; +0xa4, 0x1800a3264\nmov     [rsp+78h+Size], rdi; Size                                      ; +0xa6, 0x1800a3266\nmov     r9, [rsp+78h+Src]                                              ; +0xab, 0x1800a326b\nxor     r8d, r8d                                                       ; +0xb0, 0x1800a3270\nmov     rdx, rdi                                                       ; +0xb3, 0x1800a3273\ncall    sub_180007900                                                  ; +0xb6, 0x1800a3276\nmov     rcx, [rsp+78h+Src]; Block                                      ; +0xbb, 0x1800a327b\ntest    rcx, rcx                                                       ; +0xc0, 0x1800a3280\njz      short loc_1800A328A                                            ; +0xc3, 0x1800a3283\ncall    j_j_free_0                                                     ; +0xc5, 0x1800a3285\nmovups  xmm0, [rsp+78h+var_38]                                         ; +0xca, 0x1800a328a\nmovups  xmmword ptr [rbx], xmm0                                        ; +0xcf, 0x1800a328f\nmovups  xmm1, [rsp+78h+var_28]                                         ; +0xd2, 0x1800a3292\nmovups  xmmword ptr [rbx+10h], xmm1                                    ; +0xd7, 0x1800a3297\njmp     short loc_1800A32C1                                            ; +0xdb, 0x1800a329b\nmov     rcx, [rsp+78h+Src]; Block                                      ; +0xdd, 0x1800a329d\ntest    rcx, rcx                                                       ; +0xe2, 0x1800a32a2\njz      short loc_1800A32AC                                            ; +0xe5, 0x1800a32a5\ncall    j_j_free_0                                                     ; +0xe7, 0x1800a32a7\nxorps   xmm0, xmm0                                                     ; +0xec, 0x1800a32ac\nmovups  xmmword ptr [rbx], xmm0                                        ; +0xef, 0x1800a32af\nmov     [rbx+10h], rsi                                                 ; +0xf2, 0x1800a32b2\nmov     qword ptr [rbx+18h], 0Fh                                       ; +0xf6, 0x1800a32b6\nmov     [rbx], sil                                                     ; +0xfe, 0x1800a32be\nmov     rax, rbx                                                       ; +0x101, 0x1800a32c1\nmov     rcx, [rsp+78h+var_18]                                          ; +0x104, 0x1800a32c4\nxor     rcx, rsp; StackCookie                                          ; +0x109, 0x1800a32c9\ncall    __security_check_cookie                                        ; +0x10c, 0x1800a32cc\nlea     r11, [rsp+78h+var_8]                                           ; +0x111, 0x1800a32d1\nmov     rbx, [r11+20h]                                                 ; +0x116, 0x1800a32d6\nmov     rsi, [r11+28h]                                                 ; +0x11a, 0x1800a32da\nmov     rsp, r11                                                       ; +0x11e, 0x1800a32de\npop     rdi                                                            ; +0x121, 0x1800a32e1\nretn                                                                   ; +0x122, 0x1800a32e2", "xrefs": ["<???> @ 0x1801438a8", "<???> @ 0x1801b7a64"], "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"}