{"type": "func", "start": 4298356224, "end": 4298356667, "name": "CCAnimatedSprite::initWithType", "pseudocode": "// \n// CCAnimatedSprite::initWithType from 0x10033b600 to 0x10033b7bb (443 bytes)\n// \n// 4 xrefs:\n// > AnimatedShopKeeper::create @ 0x10030fea2\n// > AnimatedShopKeeper::init @ 0x100313e54\n// > CCAnimatedSprite::createWithType @ 0x10033b5ba\n// > GJRobotSprite::init @ 0x1006ad77e\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 12:28:41 +0000\n// \n\n__int64 __fastcall CCAnimatedSprite::initWithType(std::string *a1, __int64 a2, __int64 a3, int a4)\n{\n  unsigned __int8 v4; // r13\n  __int64 v5; // r12\n  __int64 v6; // r14\n  __int64 v7; // rax\n  __int64 Definition; // rax\n  void *v9; // rax\n  const char *CString; // r12\n  size_t v11; // rax\n  std::string::size_type v12; // r13\n  char *data; // r14\n  __int64 v14; // rax\n  std::string::pointer v15; // rsi\n  size_t v16; // rbx\n  __int64 result; // rax\n  unsigned int v18; // ebx\n  char v19; // [rsp+10h] [rbp-60h] BYREF\n  void *v20[3]; // [rsp+11h] [rbp-5Fh] BYREF\n  int v21; // [rsp+2Ch] [rbp-44h]\n  std::string __dst; // [rsp+30h] [rbp-40h] BYREF\n\n  v4 = a4;\n  v5 = a3;\n  v6 = a2;\n  if ( a3 )\n    goto LABEL_17;\n  v21 = a4;\n  v7 = ObjectManager::instance();\n  Definition = ObjectManager::getDefinition(v7, a2);\n  v19 = 22;\n  strcpy((char *)v20, \"spriteSheet\");\n  v9 = cocos2d::CCDictionary::valueForKey(Definition, (__int64)&v19);\n  CString = (const char *)cocos2d::CCString::getCString(v9);\n  v11 = strlen(CString);\n  if ( v11 >= 0xFFFFFFFFFFFFFFF8LL )\n    sub_100003630();\n  v12 = v11;\n  if ( v11 >= 0x17 )\n  {\n    v16 = 26;\n    if ( (v11 | 7) != 0x17 )\n      v16 = (v11 | 7) + 1;\n    data = (char *)operator new(v16);\n    __dst.__r_.__value_.__r.__words[2] = (std::string::size_type)data;\n    __dst.__r_.__value_.__r.__words[0] = v16 | 1;\n    __dst.__r_.__value_.__l.__size_ = v12;\n  }\n  else\n  {\n    __dst.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v11);\n    data = __dst.__r_.__value_.__s.__data_;\n    if ( !v11 )\n    {\n      __dst.__r_.__value_.__s.__data_[0] = 0;\n      if ( (v19 & 1) == 0 )\n        goto LABEL_7;\n      goto LABEL_6;\n    }\n  }\n  memmove(data, CString, v12);\n  data[v12] = 0;\n  if ( (v19 & 1) != 0 )\nLABEL_6:\n    operator delete(*(void **)((char *)&v20[1] + 7));\nLABEL_7:\n  std::string::append(&__dst, \".png\");\n  v6 = a2;\n  v4 = v21;\n  v14 = cocos2d::CCTextureCache::sharedTextureCache(&__dst);\n  if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )\n    v15 = __dst.__r_.__value_.__l.__data_;\n  else\n    v15 = __dst.__r_.__value_.__s.__data_;\n  v5 = cocos2d::CCTextureCache::addImage(v14, v15, 0);\n  if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )\n    operator delete(__dst.__r_.__value_.__l.__data_);\nLABEL_17:\n  sub_100278270((__int64)&__dst, 0.0, 0.0, (__m128)0LL, (__m128)0LL);\n  result = cocos2d::CCSprite::initWithTexture_1((__int64)a1, v5, (__int64)&__dst);\n  if ( (_BYTE)result )\n  {\n    a1[23].__r_.__value_.__s.__data_[6] = 1;\n    v18 = result;\n    std::string::assign(a1 + 25, \"\");\n    CCAnimatedSprite::loadType(a1, v6, v5, v4);\n    return v18;\n  }\n  return result;\n}", "assembly": "; \n; CCAnimatedSprite::initWithType from 0x10033b600 to 0x10033b7bb (443 bytes)\n; \n; 4 xrefs:\n; > AnimatedShopKeeper::create @ 0x10030fea2\n; > AnimatedShopKeeper::init @ 0x100313e54\n; > CCAnimatedSprite::createWithType @ 0x10033b5ba\n; > GJRobotSprite::init @ 0x1006ad77e\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 12:28:41 +0000\n; \npush    rbp                                                            ; +0x0, 0x10033b600\nmov     rbp, rsp                                                       ; +0x1, 0x10033b601\npush    r15                                                            ; +0x4, 0x10033b604\npush    r14                                                            ; +0x6, 0x10033b606\npush    r13                                                            ; +0x8, 0x10033b608\npush    r12                                                            ; +0xa, 0x10033b60a\npush    rbx                                                            ; +0xc, 0x10033b60c\nsub     rsp, 48h                                                       ; +0xd, 0x10033b60d\nmov     r13d, ecx                                                      ; +0x11, 0x10033b611\nmov     r12, rdx                                                       ; +0x14, 0x10033b614\nmov     r14, rsi                                                       ; +0x17, 0x10033b617\nmov     r15, rdi                                                       ; +0x1a, 0x10033b61a\ntest    rdx, rdx                                                       ; +0x1d, 0x10033b61d\njnz     loc_10033B74C                                                  ; +0x20, 0x10033b620\nmov     [rbp+var_44], r13d                                             ; +0x26, 0x10033b626\ncall    ObjectManager__instance                                        ; +0x2a, 0x10033b62a\nmov     rdi, rax                                                       ; +0x2f, 0x10033b62f\nmov     [rbp+var_68], r14                                              ; +0x32, 0x10033b632\nmov     rsi, r14                                                       ; +0x36, 0x10033b636\ncall    ObjectManager__getDefinition                                   ; +0x39, 0x10033b639\nmov     [rbp+var_60], 16h                                              ; +0x3e, 0x10033b63e\nmov     rcx, 6853657469727073h                                         ; +0x42, 0x10033b642\nmov     [rbp+var_5F], rcx                                              ; +0x4c, 0x10033b64c\nmov     dword ptr [rbp+var_5F+7], 74656568h                            ; +0x50, 0x10033b650\nmov     byte ptr [rbp-54h], 0                                          ; +0x57, 0x10033b657\nlea     rsi, [rbp+var_60]                                              ; +0x5b, 0x10033b65b\nmov     rdi, rax                                                       ; +0x5f, 0x10033b65f\ncall    cocos2d__CCDictionary__valueForKey                             ; +0x62, 0x10033b662\nmov     rdi, rax                                                       ; +0x67, 0x10033b667\ncall    cocos2d__CCString__getCString                                  ; +0x6a, 0x10033b66a\nmov     r12, rax                                                       ; +0x6f, 0x10033b66f\nmov     rdi, rax; __s                                                  ; +0x72, 0x10033b672\ncall    _strlen                                                        ; +0x75, 0x10033b675\ncmp     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x7a, 0x10033b67a\njnb     loc_10033B7B6                                                  ; +0x7e, 0x10033b67e\nmov     r13, rax                                                       ; +0x84, 0x10033b684\ncmp     rax, 17h                                                       ; +0x87, 0x10033b687\njnb     short loc_10033B6DE                                            ; +0x8b, 0x10033b68b\nlea     eax, ds:0[r13*2]                                               ; +0x8d, 0x10033b68d\nmov     byte ptr [rbp+__dst.__r_.__value_], al                         ; +0x95, 0x10033b695\nlea     r14, [rbp+__dst.__r_.__value_+1]                               ; +0x98, 0x10033b698\ntest    r13, r13                                                       ; +0x9c, 0x10033b69c\njnz     short loc_10033B711                                            ; +0x9f, 0x10033b69f\nmov     byte ptr [r14+r13], 0                                          ; +0xa1, 0x10033b6a1\ntest    [rbp+var_60], 1                                                ; +0xa6, 0x10033b6a6\njz      short loc_10033B6B5                                            ; +0xaa, 0x10033b6aa\nmov     rdi, [rbp+__p]; __p                                            ; +0xac, 0x10033b6ac\ncall    __ZdlPv; operator delete(void *)                               ; +0xb0, 0x10033b6b0\nlea     rsi, aPng; \".png\"                                              ; +0xb5, 0x10033b6b5\nlea     rdi, [rbp+__dst]; this                                         ; +0xbc, 0x10033b6bc\ncall    __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6appendEPKc; std::string::append(char const*) ; +0xc0, 0x10033b6c0\nmov     r14, [rbp+var_68]                                              ; +0xc5, 0x10033b6c5\nmov     r13d, [rbp+var_44]                                             ; +0xc9, 0x10033b6c9\ncall    cocos2d__CCTextureCache__sharedTextureCache                    ; +0xcd, 0x10033b6cd\ntest    byte ptr [rbp+__dst.__r_.__value_], 1                          ; +0xd2, 0x10033b6d2\njz      short loc_10033B72C                                            ; +0xd6, 0x10033b6d6\nmov     rsi, qword ptr [rbp+__dst.__r_.__value_+10h]                   ; +0xd8, 0x10033b6d8\njmp     short loc_10033B730                                            ; +0xdc, 0x10033b6dc\nmov     rax, r13                                                       ; +0xde, 0x10033b6de\nor      rax, 7                                                         ; +0xe1, 0x10033b6e1\nlea     rcx, [rax+1]                                                   ; +0xe5, 0x10033b6e5\ncmp     rax, 17h                                                       ; +0xe9, 0x10033b6e9\nmov     ebx, 1Ah                                                       ; +0xed, 0x10033b6ed\ncmovnz  rbx, rcx                                                       ; +0xf2, 0x10033b6f2\nmov     rdi, rbx; __sz                                                 ; +0xf6, 0x10033b6f6\ncall    __Znwm; operator new(ulong)                                    ; +0xf9, 0x10033b6f9\nmov     r14, rax                                                       ; +0xfe, 0x10033b6fe\nmov     qword ptr [rbp+__dst.__r_.__value_+10h], rax                   ; +0x101, 0x10033b701\nor      rbx, 1                                                         ; +0x105, 0x10033b705\nmov     qword ptr [rbp+__dst.__r_.__value_], rbx                       ; +0x109, 0x10033b709\nmov     qword ptr [rbp+__dst.__r_.__value_+8], r13                     ; +0x10d, 0x10033b70d\nmov     rdi, r14; __dst                                                ; +0x111, 0x10033b711\nmov     rsi, r12; __src                                                ; +0x114, 0x10033b714\nmov     rdx, r13; __len                                                ; +0x117, 0x10033b717\ncall    _memmove                                                       ; +0x11a, 0x10033b71a\nmov     byte ptr [r14+r13], 0                                          ; +0x11f, 0x10033b71f\ntest    [rbp+var_60], 1                                                ; +0x124, 0x10033b724\njnz     short loc_10033B6AC                                            ; +0x128, 0x10033b728\njmp     short loc_10033B6B5                                            ; +0x12a, 0x10033b72a\nlea     rsi, [rbp+__dst.__r_.__value_+1]                               ; +0x12c, 0x10033b72c\nmov     rdi, rax                                                       ; +0x130, 0x10033b730\nxor     edx, edx                                                       ; +0x133, 0x10033b733\ncall    cocos2d__CCTextureCache__addImage                              ; +0x135, 0x10033b735\nmov     r12, rax                                                       ; +0x13a, 0x10033b73a\ntest    byte ptr [rbp+__dst.__r_.__value_], 1                          ; +0x13d, 0x10033b73d\njz      short loc_10033B74C                                            ; +0x141, 0x10033b741\nmov     rdi, qword ptr [rbp+__dst.__r_.__value_+10h]; __p              ; +0x143, 0x10033b743\ncall    __ZdlPv; operator delete(void *)                               ; +0x147, 0x10033b747\nlea     rbx, [rbp+__dst]                                               ; +0x14c, 0x10033b74c\nxorps   xmm0, xmm0                                                     ; +0x150, 0x10033b750\nxorps   xmm1, xmm1                                                     ; +0x153, 0x10033b753\nxorps   xmm2, xmm2                                                     ; +0x156, 0x10033b756\nxorps   xmm3, xmm3                                                     ; +0x159, 0x10033b759\nmov     rdi, rbx                                                       ; +0x15c, 0x10033b75c\ncall    sub_100278270                                                  ; +0x15f, 0x10033b75f\nmov     rdi, r15                                                       ; +0x164, 0x10033b764\nmov     rsi, r12                                                       ; +0x167, 0x10033b767\nmov     rdx, rbx                                                       ; +0x16a, 0x10033b76a\ncall    cocos2d__CCSprite__initWithTexture_1                           ; +0x16d, 0x10033b76d\ntest    al, al                                                         ; +0x172, 0x10033b772\njz      short loc_10033B7A7                                            ; +0x174, 0x10033b774\nmov     byte ptr [r15+22Fh], 1                                         ; +0x176, 0x10033b776\nlea     rdi, [r15+258h]; this                                          ; +0x17e, 0x10033b77e\nlea     rsi, asc_100A41668; \"\"                                         ; +0x185, 0x10033b785\nmov     ebx, eax                                                       ; +0x18c, 0x10033b78c\ncall    __ZNSt3__112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6assignEPKc; std::string::assign(char const*) ; +0x18e, 0x10033b78e\nmovzx   ecx, r13b                                                      ; +0x193, 0x10033b793\nmov     rdi, r15                                                       ; +0x197, 0x10033b797\nmov     rsi, r14                                                       ; +0x19a, 0x10033b79a\nmov     rdx, r12                                                       ; +0x19d, 0x10033b79d\ncall    CCAnimatedSprite__loadType                                     ; +0x1a0, 0x10033b7a0\nmov     eax, ebx                                                       ; +0x1a5, 0x10033b7a5\nadd     rsp, 48h                                                       ; +0x1a7, 0x10033b7a7\npop     rbx                                                            ; +0x1ab, 0x10033b7ab\npop     r12                                                            ; +0x1ac, 0x10033b7ac\npop     r13                                                            ; +0x1ae, 0x10033b7ae\npop     r14                                                            ; +0x1b0, 0x10033b7b0\npop     r15                                                            ; +0x1b2, 0x10033b7b2\npop     rbp                                                            ; +0x1b4, 0x10033b7b4\nretn                                                                   ; +0x1b5, 0x10033b7b5\ncall    sub_100003630                                                  ; +0x1b6, 0x10033b7b6", "xrefs": ["AnimatedShopKeeper::create @ 0x10030fea2", "AnimatedShopKeeper::init @ 0x100313e54", "CCAnimatedSprite::createWithType @ 0x10033b5ba", "GJRobotSprite::init @ 0x1006ad77e"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}