{"type": "func", "start": 3929000, "end": 3929380, "name": "AchievementManager::achievementForUnlock", "pseudocode": "// \n// AchievementManager::achievementForUnlock from 0x3bf3a8 to 0x3bf524 (380 bytes)\n// \n// 6 xrefs:\n// > GJGarageLayer::achievementForUnlock @ 0x50c258\n// > GJGarageLayer::titleForUnlock @ 0x50c4b8\n// > GJGarageLayer::descriptionForUnlock @ 0x50c56c\n// > ItemInfoPopup::init @ 0x50db9a\n// > GameStatsManager::getItemUnlockStateLite @ 0x528dbc\n// > GameStatsManager::generateItemUnlockableData @ 0x52b790\n// \n// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\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 11:46:29 +0000\n// \n\nint *__fastcall AchievementManager::achievementForUnlock(int *a1, int a2, int a3, int a4)\n{\n  const char *v7; // r3\n  unsigned int v8; // r4\n  int v9; // r9\n  size_t v10; // r0\n  cocos2d::CCString *v11; // r0\n  const char *CString; // r0\n  const char *v13; // r9\n  size_t v14; // r0\n  int v16[3]; // [sp+8h] [bp-210h] BYREF\n  unsigned int v17; // [sp+14h] [bp-204h] BYREF\n  unsigned int v18; // [sp+18h] [bp-200h]\n  char *v19; // [sp+1Ch] [bp-1FCh]\n  _BYTE v20[500]; // [sp+20h] [bp-1F8h] BYREF\n\n  v18 = 500;\n  v19 = v20;\n  v17 = 0;\n  switch ( a4 )\n  {\n    case 1:\n      v7 = \"icon_\";\n      break;\n    case 2:\n      v7 = \"color_\";\n      break;\n    case 3:\n      v7 = \"color2_\";\n      break;\n    case 4:\n      v7 = \"ship_\";\n      break;\n    case 5:\n      v7 = \"ball_\";\n      break;\n    case 6:\n      v7 = \"bird_\";\n      break;\n    case 7:\n      v7 = \"dart_\";\n      break;\n    case 8:\n      v7 = \"robot_\";\n      break;\n    case 9:\n      v7 = \"spider_\";\n      break;\n    case 10:\n      v7 = \"special_\";\n      break;\n    case 11:\n      v7 = \"death_\";\n      break;\n    case 12:\n      v7 = \"item_\";\n      break;\n    case 13:\n      v7 = \"swing_\";\n      break;\n    case 14:\n      v7 = \"jetpack_\";\n      break;\n    case 15:\n      v7 = \"shipstreak_\";\n      break;\n    default:\n      v7 = \" _\";\n      break;\n  }\n  fmt::BasicWriter<char>::operator<<(&v17, v7, 0);\n  if ( a3 <= 9 )\n    fmt::BasicWriter<char>::operator<<(&v17, \"0\", 0);\n  fmt::BasicWriter<char>::FormatInt<int,fmt::IntFormatSpec<int,fmt::TypeSpec<(char)0>,char>>(&v17, a3);\n  v8 = v17;\n  v9 = *(_DWORD *)(a2 + 272);\n  if ( v17 + 1 > v18 )\n    fmt::internal::Array<char,500u>::grow((int)&v17, v17 + 1);\n  v19[v8] = 0;\n  memset(v16, 0, sizeof(v16));\n  v10 = strlen(v19);\n  std::string::__init(v16, v19, v10);\n  v11 = (cocos2d::CCString *)cocos2d::CCDictionary::valueForKey(v9, v16);\n  CString = (const char *)cocos2d::CCString::getCString(v11);\n  *a1 = 0;\n  a1[1] = 0;\n  v13 = CString;\n  a1[2] = 0;\n  v14 = strlen(CString);\n  std::string::__init(a1, v13, v14);\n  std::string::~string((int)v16);\n  if ( v19 != v20 && v19 )\n    operator delete[](v19);\n  return a1;\n}", "assembly": "; \n; AchievementManager::achievementForUnlock from 0x3bf3a8 to 0x3bf524 (380 bytes)\n; \n; 6 xrefs:\n; > GJGarageLayer::achievementForUnlock @ 0x50c258\n; > GJGarageLayer::titleForUnlock @ 0x50c4b8\n; > GJGarageLayer::descriptionForUnlock @ 0x50c56c\n; > ItemInfoPopup::init @ 0x50db9a\n; > GameStatsManager::getItemUnlockStateLite @ 0x528dbc\n; > GameStatsManager::generateItemUnlockableData @ 0x52b790\n; \n; This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\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 11:46:29 +0000\n; \nPUSH.W          {R4-R10,LR}                                            ; +0x0, 0x3bf3a8\nMOV             R9, R2                                                 ; +0x4, 0x3bf3ac\nLDR             R6, =(__stack_chk_guard_ptr - 0x3BF3BC)                ; +0x6, 0x3bf3ae\nSUB.W           SP, SP, #0x218                                         ; +0x8, 0x3bf3b0\nADD             R5, SP, #0x218+var_204                                 ; +0xc, 0x3bf3b4\nSUBS            R3, #1; switch 15 cases                                ; +0xe, 0x3bf3b6\nADD             R6, PC; __stack_chk_guard_ptr                          ; +0x10, 0x3bf3b8\nLDR             R6, [R6]; __stack_chk_guard                            ; +0x12, 0x3bf3ba\nMOV             R10, R1                                                ; +0x14, 0x3bf3bc\nADD.W           R8, SP, #0x218+var_1F8                                 ; +0x16, 0x3bf3be\nMOV.W           R1, #0x1F4                                             ; +0x1a, 0x3bf3c2\nLDR             R2, [R6]                                               ; +0x1e, 0x3bf3c6\nMOV             R7, R0                                                 ; +0x20, 0x3bf3c8\nSTR             R1, [R5,#4]                                            ; +0x22, 0x3bf3ca\nMOV             R4, SP                                                 ; +0x24, 0x3bf3cc\nSTR.W           R8, [R5,#8]                                            ; +0x26, 0x3bf3ce\nSTR             R2, [SP,#0x218+var_4]                                  ; +0x2a, 0x3bf3d2\nMOVS            R2, #0                                                 ; +0x2c, 0x3bf3d4\nSTR             R2, [R5]                                               ; +0x2e, 0x3bf3d6\nCMP             R3, #0xE                                               ; +0x30, 0x3bf3d8\nBHI             def_3BF3DC; jumptable 003BF3DC default case            ; +0x32, 0x3bf3da\nTBB.W           [PC,R3]; switch jump                                   ; +0x34, 0x3bf3dc\nDCB 8; jump table for switch statement                                 ; +0x38, 0x3bf3e0\nDCB 0xB                                                                ; +0x39, 0x3bf3e1\nDCB 0xE                                                                ; +0x3a, 0x3bf3e2\nDCB 0x11                                                               ; +0x3b, 0x3bf3e3\nDCB 0x14                                                               ; +0x3c, 0x3bf3e4\nDCB 0x17                                                               ; +0x3d, 0x3bf3e5\nDCB 0x1A                                                               ; +0x3e, 0x3bf3e6\nDCB 0x1D                                                               ; +0x3f, 0x3bf3e7\nDCB 0x20                                                               ; +0x40, 0x3bf3e8\nDCB 0x23                                                               ; +0x41, 0x3bf3e9\nDCB 0x26                                                               ; +0x42, 0x3bf3ea\nDCB 0x2F                                                               ; +0x43, 0x3bf3eb\nDCB 0x29                                                               ; +0x44, 0x3bf3ec\nDCB 0x2C                                                               ; +0x45, 0x3bf3ed\nDCB 0x32                                                               ; +0x46, 0x3bf3ee\nALIGN 2                                                                ; +0x47, 0x3bf3ef\nLDR             R3, =(aIcon_0 - 0x3BF3F6); jumptable 003BF3DC case 1   ; +0x48, 0x3bf3f0\nADD             R3, PC; \"icon_\"                                        ; +0x4a, 0x3bf3f2\nB               loc_3BF44E                                             ; +0x4c, 0x3bf3f4\nLDR             R3, =(aColor - 0x3BF3FC); jumptable 003BF3DC case 2    ; +0x4e, 0x3bf3f6\nADD             R3, PC; \"color_\"                                       ; +0x50, 0x3bf3f8\nB               loc_3BF44E                                             ; +0x52, 0x3bf3fa\nLDR             R3, =(aColor2 - 0x3BF402); jumptable 003BF3DC case 3   ; +0x54, 0x3bf3fc\nADD             R3, PC; \"color2_\"                                      ; +0x56, 0x3bf3fe\nB               loc_3BF44E                                             ; +0x58, 0x3bf400\nLDR             R3, =(aShip - 0x3BF408); jumptable 003BF3DC case 4     ; +0x5a, 0x3bf402\nADD             R3, PC; \"ship_\"                                        ; +0x5c, 0x3bf404\nB               loc_3BF44E                                             ; +0x5e, 0x3bf406\nLDR             R3, =(aBall - 0x3BF40E); jumptable 003BF3DC case 5     ; +0x60, 0x3bf408\nADD             R3, PC; \"ball_\"                                        ; +0x62, 0x3bf40a\nB               loc_3BF44E                                             ; +0x64, 0x3bf40c\nLDR             R3, =(aBird - 0x3BF414); jumptable 003BF3DC case 6     ; +0x66, 0x3bf40e\nADD             R3, PC; \"bird_\"                                        ; +0x68, 0x3bf410\nB               loc_3BF44E                                             ; +0x6a, 0x3bf412\nLDR             R3, =(aDart - 0x3BF41A); jumptable 003BF3DC case 7     ; +0x6c, 0x3bf414\nADD             R3, PC; \"dart_\"                                        ; +0x6e, 0x3bf416\nB               loc_3BF44E                                             ; +0x70, 0x3bf418\nLDR             R3, =(aRobot - 0x3BF420); jumptable 003BF3DC case 8    ; +0x72, 0x3bf41a\nADD             R3, PC; \"robot_\"                                       ; +0x74, 0x3bf41c\nB               loc_3BF44E                                             ; +0x76, 0x3bf41e\nLDR             R3, =(aSpider - 0x3BF426); jumptable 003BF3DC case 9   ; +0x78, 0x3bf420\nADD             R3, PC; \"spider_\"                                      ; +0x7a, 0x3bf422\nB               loc_3BF44E                                             ; +0x7c, 0x3bf424\nLDR             R3, =(aSpecial - 0x3BF42C); jumptable 003BF3DC case 10 ; +0x7e, 0x3bf426\nADD             R3, PC; \"special_\"                                     ; +0x80, 0x3bf428\nB               loc_3BF44E                                             ; +0x82, 0x3bf42a\nLDR             R3, =(aDeath - 0x3BF432); jumptable 003BF3DC case 11   ; +0x84, 0x3bf42c\nADD             R3, PC; \"death_\"                                       ; +0x86, 0x3bf42e\nB               loc_3BF44E                                             ; +0x88, 0x3bf430\nLDR             R3, =(aSwing - 0x3BF438); jumptable 003BF3DC case 13   ; +0x8a, 0x3bf432\nADD             R3, PC; \"swing_\"                                       ; +0x8c, 0x3bf434\nB               loc_3BF44E                                             ; +0x8e, 0x3bf436\nLDR             R3, =(aJetpack - 0x3BF43E); jumptable 003BF3DC case 14 ; +0x90, 0x3bf438\nADD             R3, PC; \"jetpack_\"                                     ; +0x92, 0x3bf43a\nB               loc_3BF44E                                             ; +0x94, 0x3bf43c\nLDR             R3, =(aItem - 0x3BF444); jumptable 003BF3DC case 12    ; +0x96, 0x3bf43e\nADD             R3, PC; \"item_\"                                        ; +0x98, 0x3bf440\nB               loc_3BF44E                                             ; +0x9a, 0x3bf442\nLDR             R3, =(aShipstreak - 0x3BF44A); jumptable 003BF3DC case 15 ; +0x9c, 0x3bf444\nADD             R3, PC; \"shipstreak_\"                                  ; +0x9e, 0x3bf446\nB               loc_3BF44E                                             ; +0xa0, 0x3bf448\nLDR             R3, =(asc_B79E73 - 0x3BF450); jumptable 003BF3DC default case ; +0xa2, 0x3bf44a\nADD             R3, PC; \" _\"                                           ; +0xa4, 0x3bf44c\nSTR             R3, [R4]                                               ; +0xa6, 0x3bf44e\nMOV             R0, R5                                                 ; +0xa8, 0x3bf450\nSTR             R2, [R4,#4]                                            ; +0xaa, 0x3bf452\nLDM.W           R4, {R1,R2}                                            ; +0xac, 0x3bf454\nBL              _ZN3fmt11BasicWriterIcElsENS_14BasicStringRefIcEE; fmt::BasicWriter<char>::operator<<(fmt::BasicStringRef<char>) ; +0xb0, 0x3bf458\nCMP.W           R9, #9                                                 ; +0xb4, 0x3bf45c\nBGT             loc_3BF476                                             ; +0xb8, 0x3bf460\nLDR             R3, =(a0 - 0x3BF46A); \"0\"                              ; +0xba, 0x3bf462\nMOV             R0, R5                                                 ; +0xbc, 0x3bf464\nADD             R3, PC; \"0\"                                            ; +0xbe, 0x3bf466\nSTR             R3, [R4]                                               ; +0xc0, 0x3bf468\nMOVS            R3, #0                                                 ; +0xc2, 0x3bf46a\nSTR             R3, [R4,#4]                                            ; +0xc4, 0x3bf46c\nLDM.W           R4, {R1,R2}                                            ; +0xc6, 0x3bf46e\nBL              _ZN3fmt11BasicWriterIcElsENS_14BasicStringRefIcEE; fmt::BasicWriter<char>::operator<<(fmt::BasicStringRef<char>) ; +0xca, 0x3bf472\nMOV             R0, R5                                                 ; +0xce, 0x3bf476\nMOV             R1, R9                                                 ; +0xd0, 0x3bf478\nMOV             R2, R4                                                 ; +0xd2, 0x3bf47a\nSTR.W           R9, [R4]                                               ; +0xd4, 0x3bf47c\nBL              _ZN3fmt11BasicWriterIcE9FormatIntIiNS_13IntFormatSpecIiNS_8TypeSpecILc0EEEcEEEEvT_RKT0_; fmt::BasicWriter<char>::FormatInt<int,fmt::IntFormatSpec<int,fmt::TypeSpec<(char)0>,char>>(int,fmt::IntFormatSpec<int,fmt::TypeSpec<(char)0>,char> const&) ; +0xd8, 0x3bf480\nLDR             R4, [R5]                                               ; +0xdc, 0x3bf484\nLDR             R3, [R5,#4]                                            ; +0xde, 0x3bf486\nADDS            R1, R4, #1; unsigned int                               ; +0xe0, 0x3bf488\nLDR.W           R9, [R10,#0x110]                                       ; +0xe2, 0x3bf48a\nCMP             R1, R3                                                 ; +0xe6, 0x3bf48e\nBHI             loc_3BF4B6                                             ; +0xe8, 0x3bf490\nLDR             R2, [R5,#8]                                            ; +0xea, 0x3bf492\nMOVS            R3, #0                                                 ; +0xec, 0x3bf494\nSTRB            R3, [R2,R4]                                            ; +0xee, 0x3bf496\nADD             R4, SP, #0x218+var_210                                 ; +0xf0, 0x3bf498\nLDR.W           R10, [R5,#8]                                           ; +0xf2, 0x3bf49a\nSTR             R3, [R4]                                               ; +0xf6, 0x3bf49e\nSTR             R3, [R4,#4]                                            ; +0xf8, 0x3bf4a0\nSTR             R3, [R4,#8]                                            ; +0xfa, 0x3bf4a2\nMOV             R0, R10; char *                                        ; +0xfc, 0x3bf4a4\nBLX             strlen                                                 ; +0xfe, 0x3bf4a6\nMOV             R1, R10                                                ; +0x102, 0x3bf4aa\nMOV             R2, R0                                                 ; +0x104, 0x3bf4ac\nMOV             R0, R4                                                 ; +0x106, 0x3bf4ae\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj; std::string::__init(char const*,uint) ; +0x108, 0x3bf4b0\nB               loc_3BF4BE                                             ; +0x10c, 0x3bf4b4\nMOV             R0, R5; int                                            ; +0x10e, 0x3bf4b6\nBL              _ZN3fmt8internal5ArrayIcLj500EE4growEj; fmt::internal::Array<char,500u>::grow(uint) ; +0x110, 0x3bf4b8\nB               loc_3BF492                                             ; +0x114, 0x3bf4bc\nMOV             R0, R9                                                 ; +0x116, 0x3bf4be\nMOV             R1, R4                                                 ; +0x118, 0x3bf4c0\nBL              _ZN7cocos2d12CCDictionary11valueForKeyERKNSt6__ndk112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE; cocos2d::CCDictionary::valueForKey(std::string const&) ; +0x11a, 0x3bf4c2\nBL              _ZNK7cocos2d8CCString10getCStringEv; cocos2d::CCString::getCString(void) ; +0x11e, 0x3bf4c6\nMOVS            R3, #0                                                 ; +0x122, 0x3bf4ca\nSTR             R3, [R7]                                               ; +0x124, 0x3bf4cc\nSTR             R3, [R7,#4]                                            ; +0x126, 0x3bf4ce\nMOV             R9, R0                                                 ; +0x128, 0x3bf4d0\nSTR             R3, [R7,#8]                                            ; +0x12a, 0x3bf4d2\nBLX             strlen                                                 ; +0x12c, 0x3bf4d4\nMOV             R1, R9                                                 ; +0x130, 0x3bf4d8\nMOV             R2, R0                                                 ; +0x132, 0x3bf4da\nMOV             R0, R7                                                 ; +0x134, 0x3bf4dc\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj; std::string::__init(char const*,uint) ; +0x136, 0x3bf4de\nMOV             R0, R4                                                 ; +0x13a, 0x3bf4e2\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x13c, 0x3bf4e4\nLDR             R0, [R5,#8]; void *                                    ; +0x140, 0x3bf4e8\nCMP             R0, R8                                                 ; +0x142, 0x3bf4ea\nBEQ             loc_3BF50E                                             ; +0x144, 0x3bf4ec\nCBZ             R0, loc_3BF50E                                         ; +0x146, 0x3bf4ee\nBL              _ZdaPv; operator delete[](void *)                      ; +0x148, 0x3bf4f0\nB               loc_3BF50E                                             ; +0x14c, 0x3bf4f4\nMOV             R0, R4                                                 ; +0x14e, 0x3bf4f6\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x150, 0x3bf4f8\nB               loc_3BF4FE                                             ; +0x154, 0x3bf4fc\nLDR             R0, [R5,#8]; void *                                    ; +0x156, 0x3bf4fe\nCMP             R0, R8                                                 ; +0x158, 0x3bf500\nBEQ             loc_3BF50A                                             ; +0x15a, 0x3bf502\nCBZ             R0, loc_3BF50A                                         ; +0x15c, 0x3bf504\nBL              _ZdaPv; operator delete[](void *)                      ; +0x15e, 0x3bf506\nBL              __cxa_end_cleanup                                      ; +0x162, 0x3bf50a\nLDR             R2, [SP,#0x218+var_4]                                  ; +0x166, 0x3bf50e\nMOV             R0, R7                                                 ; +0x168, 0x3bf510\nLDR             R3, [R6]                                               ; +0x16a, 0x3bf512\nCMP             R2, R3                                                 ; +0x16c, 0x3bf514\nBEQ             loc_3BF51C                                             ; +0x16e, 0x3bf516\nBLX             __stack_chk_fail                                       ; +0x170, 0x3bf518\nADD.W           SP, SP, #0x218                                         ; +0x174, 0x3bf51c\nPOP.W           {R4-R10,PC}                                            ; +0x178, 0x3bf520", "xrefs": ["GJGarageLayer::achievementForUnlock @ 0x50c258", "GJGarageLayer::titleForUnlock @ 0x50c4b8", "GJGarageLayer::descriptionForUnlock @ 0x50c56c", "ItemInfoPopup::init @ 0x50db9a", "GameStatsManager::getItemUnlockStateLite @ 0x528dbc", "GameStatsManager::generateItemUnlockableData @ 0x52b790"], "is_objc": false, "is_32_bit": true, "is_64_bit": false, "idp_name": "arm", "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"}