{"type": "func", "start": 4297812864, "end": 4297813137, "name": "GJDifficultySprite::getDifficultyFrame", "pseudocode": "// \n// GJDifficultySprite::getDifficultyFrame from 0x1002b6b80 to 0x1002b6c91 (273 bytes)\n// \n// 3 xrefs:\n// > GJDifficultySprite::create @ 0x1002b6a95\n// > GJDifficultySprite::init @ 0x1002b6b20\n// > GJDifficultySprite::updateDifficultyFrame @ 0x1002b6cda\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\nstd::string *__fastcall GJDifficultySprite::getDifficultyFrame(std::string *this, int a2, int a3, double a4)\n{\n  int v5; // r14d\n  cocos2d::CCString *v6; // rax\n  const char *CString; // r13\n  size_t v8; // rax\n  std::string::size_type v9; // r12\n  char *data; // r15\n  size_t v11; // r14\n  char v13; // [rsp+0h] [rbp-40h]\n  int v14; // [rsp+14h] [rbp-2Ch]\n\n  v5 = a2;\n  v6 = (cocos2d::CCString *)sub_1007AB580(\"difficulty_%02d_\", v13);\n  CString = cocos2d::CCString::getCString(v6);\n  v8 = strlen(CString);\n  if ( v8 >= 0xFFFFFFFFFFFFFFF8LL )\n    sub_100006BF0(a4);\n  v9 = v8;\n  v14 = a3;\n  if ( v8 >= 0x17 )\n  {\n    v11 = 26;\n    if ( (v8 | 7) != 0x17 )\n      v11 = (v8 | 7) + 1;\n    data = (char *)operator new(v11);\n    this->__r_.__value_.__r.__words[2] = (std::string::size_type)data;\n    this->__r_.__value_.__r.__words[0] = v11 + 1;\n    v5 = a2;\n    this->__r_.__value_.__l.__size_ = v9;\n    goto LABEL_8;\n  }\n  this->__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v8);\n  data = this->__r_.__value_.__s.__data_;\n  if ( v8 )\nLABEL_8:\n    memmove(data, CString, v9);\n  data[v9] = 0;\n  if ( v14 != 1 || (unsigned int)(v5 - 6) >= 5 )\n  {\n    std::string::append(this, \"btn_001.png\");\n    if ( v5 == -1 )\n      std::string::assign(this, \"difficulty_auto_btn_001.png\");\n  }\n  else\n  {\n    std::string::append(this, \"btn2_001.png\");\n  }\n  return this;\n}", "assembly": "; \n; GJDifficultySprite::getDifficultyFrame from 0x1002b6b80 to 0x1002b6c91 (273 bytes)\n; \n; 3 xrefs:\n; > GJDifficultySprite::create @ 0x1002b6a95\n; > GJDifficultySprite::init @ 0x1002b6b20\n; > GJDifficultySprite::updateDifficultyFrame @ 0x1002b6cda\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, 0x1002b6b80\nmov     rbp, rsp                                                       ; +0x1, 0x1002b6b81\npush    r15                                                            ; +0x4, 0x1002b6b84\npush    r14                                                            ; +0x6, 0x1002b6b86\npush    r13                                                            ; +0x8, 0x1002b6b88\npush    r12                                                            ; +0xa, 0x1002b6b8a\npush    rbx                                                            ; +0xc, 0x1002b6b8c\nsub     rsp, 18h                                                       ; +0xd, 0x1002b6b8d\nmov     r15d, edx                                                      ; +0x11, 0x1002b6b91\nmov     r14d, esi                                                      ; +0x14, 0x1002b6b94\nmov     rbx, rdi                                                       ; +0x17, 0x1002b6b97\nlea     rdi, aDifficulty02d; \"difficulty_%02d_\"                        ; +0x1a, 0x1002b6b9a\nxor     eax, eax                                                       ; +0x21, 0x1002b6ba1\ncall    sub_1007AB580                                                  ; +0x23, 0x1002b6ba3\nmov     rdi, rax                                                       ; +0x28, 0x1002b6ba8\ncall    cocos2d__CCString__getCString                                  ; +0x2b, 0x1002b6bab\nmov     r13, rax                                                       ; +0x30, 0x1002b6bb0\nmov     rdi, rax; __s                                                  ; +0x33, 0x1002b6bb3\ncall    _strlen                                                        ; +0x36, 0x1002b6bb6\ncmp     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x3b, 0x1002b6bbb\njnb     loc_1002B6C8C                                                  ; +0x3f, 0x1002b6bbf\nmov     r12, rax                                                       ; +0x45, 0x1002b6bc5\nmov     [rbp+var_2C], r15d                                             ; +0x48, 0x1002b6bc8\ncmp     rax, 17h                                                       ; +0x4c, 0x1002b6bcc\njnb     short loc_1002B6BE3                                            ; +0x50, 0x1002b6bd0\nlea     eax, [r12+r12]                                                 ; +0x52, 0x1002b6bd2\nmov     [rbx], al                                                      ; +0x56, 0x1002b6bd6\nlea     r15, [rbx+1]                                                   ; +0x58, 0x1002b6bd8\ntest    r12, r12                                                       ; +0x5c, 0x1002b6bdc\njnz     short loc_1002B6C1D                                            ; +0x5f, 0x1002b6bdf\njmp     short loc_1002B6C2B                                            ; +0x61, 0x1002b6be1\nmov     rax, r12                                                       ; +0x63, 0x1002b6be3\nor      rax, 7                                                         ; +0x66, 0x1002b6be6\nlea     rcx, [rax+1]                                                   ; +0x6a, 0x1002b6bea\ncmp     rax, 17h                                                       ; +0x6e, 0x1002b6bee\nmov     [rbp+var_38], r14                                              ; +0x72, 0x1002b6bf2\nmov     r14d, 1Ah                                                      ; +0x76, 0x1002b6bf6\ncmovnz  r14, rcx                                                       ; +0x7c, 0x1002b6bfc\nmov     rdi, r14; __sz                                                 ; +0x80, 0x1002b6c00\ncall    __Znwm; operator new(ulong)                                    ; +0x83, 0x1002b6c03\nmov     r15, rax                                                       ; +0x88, 0x1002b6c08\nmov     [rbx+10h], rax                                                 ; +0x8b, 0x1002b6c0b\ninc     r14                                                            ; +0x8f, 0x1002b6c0f\nmov     [rbx], r14                                                     ; +0x92, 0x1002b6c12\nmov     r14, [rbp+var_38]                                              ; +0x95, 0x1002b6c15\nmov     [rbx+8], r12                                                   ; +0x99, 0x1002b6c19\nmov     rdi, r15; __dst                                                ; +0x9d, 0x1002b6c1d\nmov     rsi, r13; __src                                                ; +0xa0, 0x1002b6c20\nmov     rdx, r12; __len                                                ; +0xa3, 0x1002b6c23\ncall    _memmove                                                       ; +0xa6, 0x1002b6c26\nmov     byte ptr [r15+r12], 0                                          ; +0xab, 0x1002b6c2b\ncmp     [rbp+var_2C], 1                                                ; +0xb0, 0x1002b6c30\nsetnz   al                                                             ; +0xb4, 0x1002b6c34\nlea     ecx, [r14-6]                                                   ; +0xb7, 0x1002b6c37\ncmp     ecx, 5                                                         ; +0xbb, 0x1002b6c3b\nsetnb   cl                                                             ; +0xbe, 0x1002b6c3e\nor      cl, al                                                         ; +0xc1, 0x1002b6c41\njnz     short loc_1002B6C56                                            ; +0xc3, 0x1002b6c43\nlea     rsi, aBtn2001Png; \"btn2_001.png\"                               ; +0xc5, 0x1002b6c45\nmov     rdi, rbx; this                                                 ; +0xcc, 0x1002b6c4c\ncall    __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKc; std::string::append(char const*) ; +0xcf, 0x1002b6c4f\njmp     short loc_1002B6C7A                                            ; +0xd4, 0x1002b6c54\nlea     rsi, aBtn001Png; \"btn_001.png\"                                 ; +0xd6, 0x1002b6c56\nmov     rdi, rbx; this                                                 ; +0xdd, 0x1002b6c5d\ncall    __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKc; std::string::append(char const*) ; +0xe0, 0x1002b6c60\ncmp     r14d, 0FFFFFFFFh                                               ; +0xe5, 0x1002b6c65\njnz     short loc_1002B6C7A                                            ; +0xe9, 0x1002b6c69\nlea     rsi, aDifficultyAuto; \"difficulty_auto_btn_001.png\"            ; +0xeb, 0x1002b6c6b\nmov     rdi, rbx; this                                                 ; +0xf2, 0x1002b6c72\ncall    __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc; std::string::assign(char const*) ; +0xf5, 0x1002b6c75\nmov     rax, rbx                                                       ; +0xfa, 0x1002b6c7a\nadd     rsp, 18h                                                       ; +0xfd, 0x1002b6c7d\npop     rbx                                                            ; +0x101, 0x1002b6c81\npop     r12                                                            ; +0x102, 0x1002b6c82\npop     r13                                                            ; +0x104, 0x1002b6c84\npop     r14                                                            ; +0x106, 0x1002b6c86\npop     r15                                                            ; +0x108, 0x1002b6c88\npop     rbp                                                            ; +0x10a, 0x1002b6c8a\nretn                                                                   ; +0x10b, 0x1002b6c8b\ncall    sub_100006BF0                                                  ; +0x10c, 0x1002b6c8c", "xrefs": ["GJDifficultySprite::create @ 0x1002b6a95", "GJDifficultySprite::init @ 0x1002b6b20", "GJDifficultySprite::updateDifficultyFrame @ 0x1002b6cda"], "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"}