{"type": "func", "start": 4302854288, "end": 4302854702, "name": "AchievementManager::notifyAchievementWithID", "pseudocode": "// \n// AchievementManager::notifyAchievementWithID from 0x100785890 to 0x100785a2e (414 bytes)\n// \n// 1 xrefs:\n// > AchievementManager::reportAchievementWithID @ 0x100785c30\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\nvoid __fastcall AchievementManager::notifyAchievementWithID(AchievementManager *a1, const char *a2)\n{\n  double v2; // xmm0_8\n  cocos2d::CCDictionary *m_platformAchievements; // rbx\n  size_t v4; // rax\n  size_t v5; // r14\n  _BYTE *v6; // r15\n  size_t v7; // r12\n  __int64 v8; // rbx\n  cocos2d::CCString *v9; // rax\n  const char *CString; // r14\n  cocos2d::CCString *v11; // rax\n  const char *v12; // r15\n  cocos2d::CCString *v13; // rax\n  const char *v14; // rbx\n  AchievementNotifier *v15; // rax\n  _BYTE __dst[48]; // [rsp+0h] [rbp-40h] BYREF\n\n  if ( a1->m_dontNotify )\n    return;\n  m_platformAchievements = a1->m_platformAchievements;\n  v4 = strlen(a2);\n  if ( v4 >= 0xFFFFFFFFFFFFFFF8LL )\n    sub_100006BF0(v2);\n  v5 = v4;\n  if ( v4 >= 0x17 )\n  {\n    v7 = 26;\n    if ( (v4 | 7) != 0x17 )\n      v7 = (v4 | 7) + 1;\n    v6 = operator new(v7);\n    *(_QWORD *)&__dst[16] = v6;\n    *(_QWORD *)__dst = v7 + 1;\n    *(_QWORD *)&__dst[8] = v5;\n  }\n  else\n  {\n    __dst[0] = 2 * v4;\n    v6 = &__dst[1];\n    if ( !v4 )\n      goto LABEL_10;\n  }\n  memcpy(v6, a2, v5);\nLABEL_10:\n  v6[v5] = 0;\n  v8 = cocos2d::CCDictionary::objectForKey_1((__int64)m_platformAchievements, __dst);\n  if ( (__dst[0] & 1) != 0 )\n    operator delete(*(void **)&__dst[16]);\n  if ( v8 )\n  {\n    strcpy(__dst, \"\\ntitle\");\n    v9 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(v8, (__int64)__dst);\n    CString = cocos2d::CCString::getCString(v9);\n    if ( (__dst[0] & 1) != 0 )\n      operator delete(*(void **)&__dst[16]);\n    strcpy(__dst, \"&achievedDescription\");\n    v11 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(v8, (__int64)__dst);\n    v12 = cocos2d::CCString::getCString(v11);\n    if ( (__dst[0] & 1) != 0 )\n      operator delete(*(void **)&__dst[16]);\n    __dst[0] = 8;\n    strcpy(&__dst[1], \"icon\");\n    v13 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey_1(v8, (__int64)__dst);\n    v14 = cocos2d::CCString::getCString(v13);\n    if ( (__dst[0] & 1) != 0 )\n      operator delete(*(void **)&__dst[16]);\n    v15 = AchievementNotifier::sharedState();\n    AchievementNotifier::notifyAchievement(v15, CString, v12, v14, 0);\n  }\n}", "assembly": "; \n; AchievementManager::notifyAchievementWithID from 0x100785890 to 0x100785a2e (414 bytes)\n; \n; 1 xrefs:\n; > AchievementManager::reportAchievementWithID @ 0x100785c30\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, 0x100785890\nmov     rbp, rsp                                                       ; +0x1, 0x100785891\npush    r15                                                            ; +0x4, 0x100785894\npush    r14                                                            ; +0x6, 0x100785896\npush    r13                                                            ; +0x8, 0x100785898\npush    r12                                                            ; +0xa, 0x10078589a\npush    rbx                                                            ; +0xc, 0x10078589c\nsub     rsp, 18h                                                       ; +0xd, 0x10078589d\ncmp     byte ptr [rdi+168h], 0                                         ; +0x11, 0x1007858a1\njnz     loc_100785A1A                                                  ; +0x18, 0x1007858a8\nmov     rbx, [rdi+148h]                                                ; +0x1e, 0x1007858ae\nmov     r13, rsi                                                       ; +0x25, 0x1007858b5\nmov     rdi, rsi; __s                                                  ; +0x28, 0x1007858b8\ncall    _strlen                                                        ; +0x2b, 0x1007858bb\ncmp     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x30, 0x1007858c0\njnb     loc_100785A29                                                  ; +0x34, 0x1007858c4\nmov     r14, rax                                                       ; +0x3a, 0x1007858ca\ncmp     rax, 17h                                                       ; +0x3d, 0x1007858cd\njnb     short loc_1007858E8                                            ; +0x41, 0x1007858d1\nlea     eax, [r14+r14]                                                 ; +0x43, 0x1007858d3\nmov     byte ptr [rbp+__dst], al                                       ; +0x47, 0x1007858d7\nlea     r15, [rbp+__dst+1]                                             ; +0x4a, 0x1007858da\ntest    r14, r14                                                       ; +0x4e, 0x1007858de\nmov     rsi, r13                                                       ; +0x51, 0x1007858e1\njnz     short loc_10078591E                                            ; +0x54, 0x1007858e4\njmp     short loc_100785929                                            ; +0x56, 0x1007858e6\nmov     rax, r14                                                       ; +0x58, 0x1007858e8\nor      rax, 7                                                         ; +0x5b, 0x1007858eb\nlea     rcx, [rax+1]                                                   ; +0x5f, 0x1007858ef\ncmp     rax, 17h                                                       ; +0x63, 0x1007858f3\nmov     r12d, 1Ah                                                      ; +0x67, 0x1007858f7\ncmovnz  r12, rcx                                                       ; +0x6d, 0x1007858fd\nmov     rdi, r12; __sz                                                 ; +0x71, 0x100785901\ncall    __Znwm; operator new(ulong)                                    ; +0x74, 0x100785904\nmov     r15, rax                                                       ; +0x79, 0x100785909\nmov     [rbp+__p], rax                                                 ; +0x7c, 0x10078590c\ninc     r12                                                            ; +0x80, 0x100785910\nmov     qword ptr [rbp+__dst], r12                                     ; +0x83, 0x100785913\nmov     qword ptr [rbp+__dst+8], r14                                   ; +0x87, 0x100785917\nmov     rsi, r13; __src                                                ; +0x8b, 0x10078591b\nmov     rdi, r15; __dst                                                ; +0x8e, 0x10078591e\nmov     rdx, r14; __n                                                  ; +0x91, 0x100785921\ncall    _memcpy                                                        ; +0x94, 0x100785924\nmov     byte ptr [r15+r14], 0                                          ; +0x99, 0x100785929\nlea     rsi, [rbp+__dst]                                               ; +0x9e, 0x10078592e\nmov     rdi, rbx                                                       ; +0xa2, 0x100785932\ncall    cocos2d__CCDictionary__objectForKey_1                          ; +0xa5, 0x100785935\nmov     rbx, rax                                                       ; +0xaa, 0x10078593a\ntest    byte ptr [rbp+__dst], 1                                        ; +0xad, 0x10078593d\njz      short loc_10078594C                                            ; +0xb1, 0x100785941\nmov     rdi, [rbp+__p]; __p                                            ; +0xb3, 0x100785943\ncall    __ZdlPv; operator delete(void *)                               ; +0xb7, 0x100785947\ntest    rbx, rbx                                                       ; +0xbc, 0x10078594c\njz      loc_100785A1A                                                  ; +0xbf, 0x10078594f\nmov     byte ptr [rbp+__dst], 0Ah                                      ; +0xc5, 0x100785955\nmov     dword ptr [rbp+__dst+1], 6C746974h                             ; +0xc9, 0x100785959\nmov     word ptr [rbp+__dst+5], 65h ; 'e'                              ; +0xd0, 0x100785960\nlea     rsi, [rbp+__dst]                                               ; +0xd6, 0x100785966\nmov     rdi, rbx                                                       ; +0xda, 0x10078596a\ncall    cocos2d__CCDictionary__valueForKey_1                           ; +0xdd, 0x10078596d\nmov     rdi, rax                                                       ; +0xe2, 0x100785972\ncall    cocos2d__CCString__getCString                                  ; +0xe5, 0x100785975\nmov     r14, rax                                                       ; +0xea, 0x10078597a\ntest    byte ptr [rbp+__dst], 1                                        ; +0xed, 0x10078597d\njz      short loc_10078598C                                            ; +0xf1, 0x100785981\nmov     rdi, [rbp+__p]; __p                                            ; +0xf3, 0x100785983\ncall    __ZdlPv; operator delete(void *)                               ; +0xf7, 0x100785987\nmov     byte ptr [rbp+__dst], 26h ; '&'                                ; +0xfc, 0x10078598c\nmovups  xmm0, xmmword ptr cs:aAchieveddescri; \"achievedDescription\"    ; +0x100, 0x100785990\nmovups  [rbp+__dst+1], xmm0                                            ; +0x107, 0x100785997\nmov     dword ptr [rbp+__p], 6E6F6974h                                 ; +0x10b, 0x10078599b\nmov     byte ptr [rbp+__p+4], 0                                        ; +0x112, 0x1007859a2\nlea     rsi, [rbp+__dst]                                               ; +0x116, 0x1007859a6\nmov     rdi, rbx                                                       ; +0x11a, 0x1007859aa\ncall    cocos2d__CCDictionary__valueForKey_1                           ; +0x11d, 0x1007859ad\nmov     rdi, rax                                                       ; +0x122, 0x1007859b2\ncall    cocos2d__CCString__getCString                                  ; +0x125, 0x1007859b5\nmov     r15, rax                                                       ; +0x12a, 0x1007859ba\ntest    byte ptr [rbp+__dst], 1                                        ; +0x12d, 0x1007859bd\njz      short loc_1007859CC                                            ; +0x131, 0x1007859c1\nmov     rdi, [rbp+__p]; __p                                            ; +0x133, 0x1007859c3\ncall    __ZdlPv; operator delete(void *)                               ; +0x137, 0x1007859c7\nmov     byte ptr [rbp+__dst], 8                                        ; +0x13c, 0x1007859cc\nmov     dword ptr [rbp+__dst+1], 6E6F6369h                             ; +0x140, 0x1007859d0\nmov     byte ptr [rbp+__dst+5], 0                                      ; +0x147, 0x1007859d7\nlea     rsi, [rbp+__dst]                                               ; +0x14b, 0x1007859db\nmov     rdi, rbx                                                       ; +0x14f, 0x1007859df\ncall    cocos2d__CCDictionary__valueForKey_1                           ; +0x152, 0x1007859e2\nmov     rdi, rax                                                       ; +0x157, 0x1007859e7\ncall    cocos2d__CCString__getCString                                  ; +0x15a, 0x1007859ea\nmov     rbx, rax                                                       ; +0x15f, 0x1007859ef\ntest    byte ptr [rbp+__dst], 1                                        ; +0x162, 0x1007859f2\njz      short loc_100785A01                                            ; +0x166, 0x1007859f6\nmov     rdi, [rbp+__p]; __p                                            ; +0x168, 0x1007859f8\ncall    __ZdlPv; operator delete(void *)                               ; +0x16c, 0x1007859fc\ncall    AchievementNotifier__sharedState                               ; +0x171, 0x100785a01\nmov     rdi, rax                                                       ; +0x176, 0x100785a06\nmov     rsi, r14                                                       ; +0x179, 0x100785a09\nmov     rdx, r15                                                       ; +0x17c, 0x100785a0c\nmov     rcx, rbx                                                       ; +0x17f, 0x100785a0f\nxor     r8d, r8d                                                       ; +0x182, 0x100785a12\ncall    AchievementNotifier__notifyAchievement                         ; +0x185, 0x100785a15\nadd     rsp, 18h                                                       ; +0x18a, 0x100785a1a\npop     rbx                                                            ; +0x18e, 0x100785a1e\npop     r12                                                            ; +0x18f, 0x100785a1f\npop     r13                                                            ; +0x191, 0x100785a21\npop     r14                                                            ; +0x193, 0x100785a23\npop     r15                                                            ; +0x195, 0x100785a25\npop     rbp                                                            ; +0x197, 0x100785a27\nretn                                                                   ; +0x198, 0x100785a28\ncall    sub_100006BF0                                                  ; +0x199, 0x100785a29", "xrefs": ["AchievementManager::reportAchievementWithID @ 0x100785c30"], "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"}