{"type": "func", "start": 5371482224, "end": 5371482440, "name": "GJDifficultySprite::getDifficultyFrame", "pseudocode": "// \n// GJDifficultySprite::getDifficultyFrame from 0x1402a5070 to 0x1402a5148 (216 bytes)\n// \n// 3 xrefs:\n// > GJDifficultySprite::create @ 0x1402a5007\n// > GJDifficultySprite::updateDifficultyFrame @ 0x1402a5174\n// > <???> @ 0x1406d206c\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\n// Hidden C++ exception states: #wind=1\nvoid **__fastcall GJDifficultySprite::getDifficultyFrame(void **Src, int a2, int a3)\n{\n  cocos2d::CCString *v6; // rax\n  const char *CString; // rax\n  size_t v8; // r8\n  size_t v9; // r8\n  char *v10; // rdx\n\n  v6 = cocos2d::CCString::createWithFormat(\"difficulty_%02d_\", a2);\n  CString = cocos2d::CCString::getCString(v6);\n  *(_OWORD *)Src = 0;\n  Src[2] = nullptr;\n  Src[3] = nullptr;\n  v8 = -1;\n  do\n    ++v8;\n  while ( CString[v8] );\n  sub_14003A930(Src, CString, v8);\n  if ( a3 == 1 && (unsigned int)(a2 - 6) <= 4 )\n  {\n    v9 = 12;\n    v10 = \"btn2_001.png\";\n  }\n  else\n  {\n    v9 = 11;\n    v10 = \"btn_001.png\";\n  }\n  sub_140041270(Src, v10, v9);\n  if ( a2 == -1 )\n    sub_14003CCE0(Src, \"difficulty_auto_btn_001.png\", 0x1Bu);\n  return Src;\n}", "assembly": "; \n; GJDifficultySprite::getDifficultyFrame from 0x1402a5070 to 0x1402a5148 (216 bytes)\n; \n; 3 xrefs:\n; > GJDifficultySprite::create @ 0x1402a5007\n; > GJDifficultySprite::updateDifficultyFrame @ 0x1402a5174\n; > <???> @ 0x1406d206c\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\nmov     [rsp+arg_8], rbx                                               ; +0x0, 0x1402a5070\nmov     [rsp+arg_10], rsi                                              ; +0x5, 0x1402a5075\nmov     [rsp+arg_0], rcx                                               ; +0xa, 0x1402a507a\npush    rdi                                                            ; +0xf, 0x1402a507f\nsub     rsp, 30h                                                       ; +0x10, 0x1402a5080\nmov     esi, r8d                                                       ; +0x14, 0x1402a5084\nmov     edi, edx                                                       ; +0x17, 0x1402a5087\nmov     rbx, rcx                                                       ; +0x19, 0x1402a5089\nmov     [rsp+38h+var_18], 0                                            ; +0x1c, 0x1402a508c\nlea     rcx, aDifficulty02d; \"difficulty_%02d_\"                        ; +0x24, 0x1402a5094\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x2b, 0x1402a509b\nmov     rcx, rax                                                       ; +0x31, 0x1402a50a1\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x34, 0x1402a50a4\nxorps   xmm0, xmm0                                                     ; +0x3a, 0x1402a50aa\nmovups  xmmword ptr [rbx], xmm0                                        ; +0x3d, 0x1402a50ad\nmov     qword ptr [rbx+10h], 0                                         ; +0x40, 0x1402a50b0\nmov     qword ptr [rbx+18h], 0                                         ; +0x48, 0x1402a50b8\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0x50, 0x1402a50c0\nnop     word ptr [rax+rax+00000000h]                                   ; +0x57, 0x1402a50c7\ninc     r8                                                             ; +0x60, 0x1402a50d0\ncmp     byte ptr [rax+r8], 0                                           ; +0x63, 0x1402a50d3\njnz     short loc_1402A50D0                                            ; +0x68, 0x1402a50d8\nmov     rdx, rax                                                       ; +0x6a, 0x1402a50da\nmov     rcx, rbx                                                       ; +0x6d, 0x1402a50dd\ncall    sub_14003A930                                                  ; +0x70, 0x1402a50e0\nmov     [rsp+38h+var_18], 1                                            ; +0x75, 0x1402a50e5\ncmp     esi, 1                                                         ; +0x7d, 0x1402a50ed\njnz     short loc_1402A5107                                            ; +0x80, 0x1402a50f0\nlea     eax, [rdi-6]                                                   ; +0x82, 0x1402a50f2\ncmp     eax, 4                                                         ; +0x85, 0x1402a50f5\nja      short loc_1402A5107                                            ; +0x88, 0x1402a50f8\nlea     r8d, [rsi+0Bh]                                                 ; +0x8a, 0x1402a50fa\nlea     rdx, aBtn2001Png; \"btn2_001.png\"                               ; +0x8e, 0x1402a50fe\njmp     short loc_1402A5114                                            ; +0x95, 0x1402a5105\nmov     r8d, 0Bh; Size                                                 ; +0x97, 0x1402a5107\nlea     rdx, aBtn001Png; \"btn_001.png\"                                 ; +0x9d, 0x1402a510d\nmov     rcx, rbx; Src                                                  ; +0xa4, 0x1402a5114\ncall    sub_140041270                                                  ; +0xa7, 0x1402a5117\ncmp     edi, 0FFFFFFFFh                                                ; +0xac, 0x1402a511c\njnz     short loc_1402A5134                                            ; +0xaf, 0x1402a511f\nlea     r8d, [rdi+1Ch]; Size                                           ; +0xb1, 0x1402a5121\nlea     rdx, aDifficultyAuto; \"difficulty_auto_btn_001.png\"            ; +0xb5, 0x1402a5125\nmov     rcx, rbx; void *                                               ; +0xbc, 0x1402a512c\ncall    sub_14003CCE0                                                  ; +0xbf, 0x1402a512f\nmov     rax, rbx                                                       ; +0xc4, 0x1402a5134\nmov     rbx, [rsp+38h+arg_8]                                           ; +0xc7, 0x1402a5137\nmov     rsi, [rsp+38h+arg_10]                                          ; +0xcc, 0x1402a513c\nadd     rsp, 30h                                                       ; +0xd1, 0x1402a5141\npop     rdi                                                            ; +0xd5, 0x1402a5145\nretn                                                                   ; +0xd6, 0x1402a5146\ndb 0CCh                                                                ; +0xd7, 0x1402a5147", "xrefs": ["GJDifficultySprite::create @ 0x1402a5007", "GJDifficultySprite::updateDifficultyFrame @ 0x1402a5174", "<???> @ 0x1406d206c"], "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"}