{"type": "func", "start": 4298440432, "end": 4298440875, "name": "CCAnimatedSprite::initWithType", "pseudocode": "// \n// CCAnimatedSprite::initWithType from 0x10034fef0 to 0x1003500ab (443 bytes)\n// \n// 4 xrefs:\n// > AnimatedShopKeeper::create @ 0x100324842\n// > AnimatedShopKeeper::init @ 0x1003286f4\n// > CCAnimatedSprite::createWithType @ 0x10034feaa\n// > GJRobotSprite::init @ 0x1005dbe6e\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\nbool __fastcall CCAnimatedSprite::initWithType(CCAnimatedSprite *a1, const char *a2, cocos2d::CCTexture2D *a3, bool a4)\n{\n  double v4; // xmm0_8\n  bool v5; // r13\n  cocos2d::CCTexture2D *v6; // r12\n  const char *v7; // r14\n  ObjectManager *v8; // rax\n  cocos2d::CCDictionary *Definition; // rax\n  cocos2d::CCString *v10; // rax\n  const char *CString; // r12\n  size_t v12; // rax\n  std::string::size_type v13; // r13\n  char *data; // r14\n  cocos2d::CCTextureCache *v15; // rax\n  const char *v16; // rsi\n  size_t v17; // rbx\n  bool result; // al\n  bool v19; // bl\n  char v20; // [rsp+10h] [rbp-60h] BYREF\n  void *v21[3]; // [rsp+11h] [rbp-5Fh] BYREF\n  _BOOL4 v22; // [rsp+2Ch] [rbp-44h]\n  std::string __dst; // [rsp+30h] [rbp-40h] BYREF\n\n  v5 = a4;\n  v6 = a3;\n  v7 = a2;\n  if ( a3 )\n    goto LABEL_17;\n  v22 = a4;\n  v8 = ObjectManager::instance();\n  Definition = ObjectManager::getDefinition(v8, a2);\n  v20 = 22;\n  strcpy((char *)v21, \"spriteSheet\");\n  v10 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1((__int64)Definition, (__int64)&v20);\n  CString = cocos2d::CCString::getCString(v10);\n  v12 = strlen(CString);\n  if ( v12 >= 0xFFFFFFFFFFFFFFF8LL )\n    sub_100006BF0(v4);\n  v13 = v12;\n  if ( v12 >= 0x17 )\n  {\n    v17 = 26;\n    if ( (v12 | 7) != 0x17 )\n      v17 = (v12 | 7) + 1;\n    data = (char *)operator new(v17);\n    __dst.__r_.__value_.__r.__words[2] = (std::string::size_type)data;\n    __dst.__r_.__value_.__r.__words[0] = v17 | 1;\n    __dst.__r_.__value_.__l.__size_ = v13;\n  }\n  else\n  {\n    __dst.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v12);\n    data = __dst.__r_.__value_.__s.__data_;\n    if ( !v12 )\n    {\n      __dst.__r_.__value_.__s.__data_[0] = 0;\n      if ( (v20 & 1) == 0 )\n        goto LABEL_7;\n      goto LABEL_6;\n    }\n  }\n  memmove(data, CString, v13);\n  data[v13] = 0;\n  if ( (v20 & 1) != 0 )\nLABEL_6:\n    operator delete(*(void **)((char *)&v21[1] + 7));\nLABEL_7:\n  std::string::append(&__dst, \".png\");\n  v7 = a2;\n  v5 = v22;\n  v15 = cocos2d::CCTextureCache::sharedTextureCache();\n  if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )\n    v16 = __dst.__r_.__value_.__l.__data_;\n  else\n    v16 = __dst.__r_.__value_.__s.__data_;\n  v6 = cocos2d::CCTextureCache::addImage(v15, v16, 0);\n  if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )\n    operator delete(__dst.__r_.__value_.__l.__data_);\nLABEL_17:\n  sub_10028CC00((__int64)&__dst, 0.0, 0.0, (__m128)0LL, (__m128)0LL);\n  result = cocos2d::CCSprite::initWithTexture_1(a1, v6, (const cocos2d::CCRect *)&__dst);\n  if ( result )\n  {\n    a1->m_bDontDraw = 1;\n    v19 = result;\n    std::string::assign((std::string *)&a1->m_unkString1, \"\");\n    CCAnimatedSprite::loadType(a1, v7, v6, v5);\n    return v19;\n  }\n  return result;\n}", "assembly": "; \n; CCAnimatedSprite::initWithType from 0x10034fef0 to 0x1003500ab (443 bytes)\n; \n; 4 xrefs:\n; > AnimatedShopKeeper::create @ 0x100324842\n; > AnimatedShopKeeper::init @ 0x1003286f4\n; > CCAnimatedSprite::createWithType @ 0x10034feaa\n; > GJRobotSprite::init @ 0x1005dbe6e\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, 0x10034fef0\nmov     rbp, rsp                                                       ; +0x1, 0x10034fef1\npush    r15                                                            ; +0x4, 0x10034fef4\npush    r14                                                            ; +0x6, 0x10034fef6\npush    r13                                                            ; +0x8, 0x10034fef8\npush    r12                                                            ; +0xa, 0x10034fefa\npush    rbx                                                            ; +0xc, 0x10034fefc\nsub     rsp, 48h                                                       ; +0xd, 0x10034fefd\nmov     r13d, ecx                                                      ; +0x11, 0x10034ff01\nmov     r12, rdx                                                       ; +0x14, 0x10034ff04\nmov     r14, rsi                                                       ; +0x17, 0x10034ff07\nmov     r15, rdi                                                       ; +0x1a, 0x10034ff0a\ntest    rdx, rdx                                                       ; +0x1d, 0x10034ff0d\njnz     loc_10035003C                                                  ; +0x20, 0x10034ff10\nmov     [rbp+var_44], r13d                                             ; +0x26, 0x10034ff16\ncall    ObjectManager__instance                                        ; +0x2a, 0x10034ff1a\nmov     rdi, rax                                                       ; +0x2f, 0x10034ff1f\nmov     [rbp+var_68], r14                                              ; +0x32, 0x10034ff22\nmov     rsi, r14                                                       ; +0x36, 0x10034ff26\ncall    ObjectManager__getDefinition                                   ; +0x39, 0x10034ff29\nmov     [rbp+var_60], 16h                                              ; +0x3e, 0x10034ff2e\nmov     rcx, 6853657469727073h                                         ; +0x42, 0x10034ff32\nmov     [rbp+var_5F], rcx                                              ; +0x4c, 0x10034ff3c\nmov     dword ptr [rbp+var_5F+7], 74656568h                            ; +0x50, 0x10034ff40\nmov     byte ptr [rbp-54h], 0                                          ; +0x57, 0x10034ff47\nlea     rsi, [rbp+var_60]                                              ; +0x5b, 0x10034ff4b\nmov     rdi, rax                                                       ; +0x5f, 0x10034ff4f\ncall    cocos2d__CCDictionary__valueForKey_1                           ; +0x62, 0x10034ff52\nmov     rdi, rax                                                       ; +0x67, 0x10034ff57\ncall    cocos2d__CCString__getCString                                  ; +0x6a, 0x10034ff5a\nmov     r12, rax                                                       ; +0x6f, 0x10034ff5f\nmov     rdi, rax; __s                                                  ; +0x72, 0x10034ff62\ncall    _strlen                                                        ; +0x75, 0x10034ff65\ncmp     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x7a, 0x10034ff6a\njnb     loc_1003500A6                                                  ; +0x7e, 0x10034ff6e\nmov     r13, rax                                                       ; +0x84, 0x10034ff74\ncmp     rax, 17h                                                       ; +0x87, 0x10034ff77\njnb     short loc_10034FFCE                                            ; +0x8b, 0x10034ff7b\nlea     eax, ds:0[r13*2]                                               ; +0x8d, 0x10034ff7d\nmov     byte ptr [rbp+__dst.__r_.__value_], al                         ; +0x95, 0x10034ff85\nlea     r14, [rbp+__dst.__r_.__value_+1]                               ; +0x98, 0x10034ff88\ntest    r13, r13                                                       ; +0x9c, 0x10034ff8c\njnz     short loc_100350001                                            ; +0x9f, 0x10034ff8f\nmov     byte ptr [r14+r13], 0                                          ; +0xa1, 0x10034ff91\ntest    [rbp+var_60], 1                                                ; +0xa6, 0x10034ff96\njz      short loc_10034FFA5                                            ; +0xaa, 0x10034ff9a\nmov     rdi, [rbp+__p]; __p                                            ; +0xac, 0x10034ff9c\ncall    __ZdlPv; operator delete(void *)                               ; +0xb0, 0x10034ffa0\nlea     rsi, aPng; \".png\"                                              ; +0xb5, 0x10034ffa5\nlea     rdi, [rbp+__dst]; this                                         ; +0xbc, 0x10034ffac\ncall    __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKc; std::string::append(char const*) ; +0xc0, 0x10034ffb0\nmov     r14, [rbp+var_68]                                              ; +0xc5, 0x10034ffb5\nmov     r13d, [rbp+var_44]                                             ; +0xc9, 0x10034ffb9\ncall    cocos2d__CCTextureCache__sharedTextureCache                    ; +0xcd, 0x10034ffbd\ntest    byte ptr [rbp+__dst.__r_.__value_], 1                          ; +0xd2, 0x10034ffc2\njz      short loc_10035001C                                            ; +0xd6, 0x10034ffc6\nmov     rsi, qword ptr [rbp+__dst.__r_.__value_+10h]                   ; +0xd8, 0x10034ffc8\njmp     short loc_100350020                                            ; +0xdc, 0x10034ffcc\nmov     rax, r13                                                       ; +0xde, 0x10034ffce\nor      rax, 7                                                         ; +0xe1, 0x10034ffd1\nlea     rcx, [rax+1]                                                   ; +0xe5, 0x10034ffd5\ncmp     rax, 17h                                                       ; +0xe9, 0x10034ffd9\nmov     ebx, 1Ah                                                       ; +0xed, 0x10034ffdd\ncmovnz  rbx, rcx                                                       ; +0xf2, 0x10034ffe2\nmov     rdi, rbx; __sz                                                 ; +0xf6, 0x10034ffe6\ncall    __Znwm; operator new(ulong)                                    ; +0xf9, 0x10034ffe9\nmov     r14, rax                                                       ; +0xfe, 0x10034ffee\nmov     qword ptr [rbp+__dst.__r_.__value_+10h], rax                   ; +0x101, 0x10034fff1\nor      rbx, 1                                                         ; +0x105, 0x10034fff5\nmov     qword ptr [rbp+__dst.__r_.__value_], rbx                       ; +0x109, 0x10034fff9\nmov     qword ptr [rbp+__dst.__r_.__value_+8], r13                     ; +0x10d, 0x10034fffd\nmov     rdi, r14; __dst                                                ; +0x111, 0x100350001\nmov     rsi, r12; __src                                                ; +0x114, 0x100350004\nmov     rdx, r13; __len                                                ; +0x117, 0x100350007\ncall    _memmove                                                       ; +0x11a, 0x10035000a\nmov     byte ptr [r14+r13], 0                                          ; +0x11f, 0x10035000f\ntest    [rbp+var_60], 1                                                ; +0x124, 0x100350014\njnz     short loc_10034FF9C                                            ; +0x128, 0x100350018\njmp     short loc_10034FFA5                                            ; +0x12a, 0x10035001a\nlea     rsi, [rbp+__dst.__r_.__value_+1]                               ; +0x12c, 0x10035001c\nmov     rdi, rax                                                       ; +0x130, 0x100350020\nxor     edx, edx                                                       ; +0x133, 0x100350023\ncall    cocos2d__CCTextureCache__addImage                              ; +0x135, 0x100350025\nmov     r12, rax                                                       ; +0x13a, 0x10035002a\ntest    byte ptr [rbp+__dst.__r_.__value_], 1                          ; +0x13d, 0x10035002d\njz      short loc_10035003C                                            ; +0x141, 0x100350031\nmov     rdi, qword ptr [rbp+__dst.__r_.__value_+10h]; __p              ; +0x143, 0x100350033\ncall    __ZdlPv; operator delete(void *)                               ; +0x147, 0x100350037\nlea     rbx, [rbp+__dst]                                               ; +0x14c, 0x10035003c\nxorps   xmm0, xmm0                                                     ; +0x150, 0x100350040\nxorps   xmm1, xmm1                                                     ; +0x153, 0x100350043\nxorps   xmm2, xmm2                                                     ; +0x156, 0x100350046\nxorps   xmm3, xmm3                                                     ; +0x159, 0x100350049\nmov     rdi, rbx                                                       ; +0x15c, 0x10035004c\ncall    sub_10028CC00                                                  ; +0x15f, 0x10035004f\nmov     rdi, r15                                                       ; +0x164, 0x100350054\nmov     rsi, r12                                                       ; +0x167, 0x100350057\nmov     rdx, rbx                                                       ; +0x16a, 0x10035005a\ncall    cocos2d__CCSprite__initWithTexture_1                           ; +0x16d, 0x10035005d\ntest    al, al                                                         ; +0x172, 0x100350062\njz      short loc_100350097                                            ; +0x174, 0x100350064\nmov     byte ptr [r15+22Fh], 1                                         ; +0x176, 0x100350066\nlea     rdi, [r15+258h]; this                                          ; +0x17e, 0x10035006e\nlea     rsi, __src; \"\"                                                 ; +0x185, 0x100350075\nmov     ebx, eax                                                       ; +0x18c, 0x10035007c\ncall    __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc; std::string::assign(char const*) ; +0x18e, 0x10035007e\nmovzx   ecx, r13b                                                      ; +0x193, 0x100350083\nmov     rdi, r15                                                       ; +0x197, 0x100350087\nmov     rsi, r14                                                       ; +0x19a, 0x10035008a\nmov     rdx, r12                                                       ; +0x19d, 0x10035008d\ncall    CCAnimatedSprite__loadType                                     ; +0x1a0, 0x100350090\nmov     eax, ebx                                                       ; +0x1a5, 0x100350095\nadd     rsp, 48h                                                       ; +0x1a7, 0x100350097\npop     rbx                                                            ; +0x1ab, 0x10035009b\npop     r12                                                            ; +0x1ac, 0x10035009c\npop     r13                                                            ; +0x1ae, 0x10035009e\npop     r14                                                            ; +0x1b0, 0x1003500a0\npop     r15                                                            ; +0x1b2, 0x1003500a2\npop     rbp                                                            ; +0x1b4, 0x1003500a4\nretn                                                                   ; +0x1b5, 0x1003500a5\ncall    sub_100006BF0                                                  ; +0x1b6, 0x1003500a6", "xrefs": ["AnimatedShopKeeper::create @ 0x100324842", "AnimatedShopKeeper::init @ 0x1003286f4", "CCAnimatedSprite::createWithType @ 0x10034feaa", "GJRobotSprite::init @ 0x1005dbe6e"], "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"}