{"type": "func", "start": 5147776, "end": 5147906, "name": "ChanceTriggerGameObject::remapChanceObjects", "pseudocode": "// \n// ChanceTriggerGameObject::remapChanceObjects from 0x4e8c80 to 0x4e8d02 (130 bytes)\n// \n// 1 xrefs:\n// > GJBaseGameLayer::applyRemap @ 0x5a7ac0\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:51:07 +0000\n// \n\nunsigned int __fastcall ChanceTriggerGameObject::remapChanceObjects(unsigned int result, _DWORD *a2)\n{\n  int v3; // r4\n  unsigned int v4; // r6\n  unsigned int v5; // r10\n  unsigned int v6; // r7\n  int v7; // r11\n  _DWORD *v8; // r2\n  _DWORD *i; // r5\n  int v10; // r1\n  int v11; // [sp+4h] [bp-8h]\n\n  v3 = *(_DWORD *)(result + 1648);\n  v11 = *(_DWORD *)(result + 1652);\nLABEL_2:\n  while ( 1 )\n  {\n    v3 += 16;\n    if ( v11 == v3 - 16 )\n      return result;\n    v4 = a2[1];\n    v5 = *(_DWORD *)(v3 - 16);\n    if ( v4 )\n    {\n      v6 = v4 - 1;\n      if ( ((v4 - 1) & v4) != 0 )\n      {\n        result = v5 / v4;\n        v7 = v5 % v4;\n      }\n      else\n      {\n        v7 = v5 & v6;\n      }\n      v8 = *(_DWORD **)(*a2 + 4 * v7);\n      if ( v8 )\n      {\n        for ( i = (_DWORD *)*v8; i; i = (_DWORD *)*i )\n        {\n          result = i[1];\n          if ( ((v4 - 1) & v4) != 0 )\n          {\n            v10 = result % v4;\n            result /= v4;\n          }\n          else\n          {\n            v10 = v6 & result;\n          }\n          if ( v10 != v7 )\n            break;\n          if ( i[2] == v5 )\n          {\n            *(_DWORD *)(v3 - 16) = i[3];\n            goto LABEL_2;\n          }\n        }\n      }\n    }\n  }\n}", "assembly": "; \n; ChanceTriggerGameObject::remapChanceObjects from 0x4e8c80 to 0x4e8d02 (130 bytes)\n; \n; 1 xrefs:\n; > GJBaseGameLayer::applyRemap @ 0x5a7ac0\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:51:07 +0000\n; \nPUSH.W          {R0-R2,R4-R11,LR}                                      ; +0x0, 0x4e8c80\nMOV             R8, R1                                                 ; +0x4, 0x4e8c84\nLDR.W           R3, [R0,#0x674]                                        ; +0x6, 0x4e8c86\nLDR.W           R4, [R0,#0x670]                                        ; +0xa, 0x4e8c8a\nSTR             R3, [SP,#0xC+var_8]                                    ; +0xe, 0x4e8c8e\nADDS            R4, #0x10                                              ; +0x10, 0x4e8c90\nLDR             R3, [SP,#0xC+var_8]                                    ; +0x12, 0x4e8c92\nSUB.W           R2, R4, #0x10                                          ; +0x14, 0x4e8c94\nCMP             R3, R2                                                 ; +0x18, 0x4e8c98\nBEQ             loc_4E8CFC                                             ; +0x1a, 0x4e8c9a\nLDR.W           R6, [R8,#4]                                            ; +0x1c, 0x4e8c9c\nLDR.W           R10, [R4,#-0x10]                                       ; +0x20, 0x4e8ca0\nCMP             R6, #0                                                 ; +0x24, 0x4e8ca4\nBEQ             loc_4E8C90                                             ; +0x26, 0x4e8ca6\nSUBS            R7, R6, #1                                             ; +0x28, 0x4e8ca8\nANDS.W          R9, R7, R6                                             ; +0x2a, 0x4e8caa\nBNE             loc_4E8CB6                                             ; +0x2e, 0x4e8cae\nAND.W           R11, R10, R7                                           ; +0x30, 0x4e8cb0\nB               loc_4E8CC0                                             ; +0x34, 0x4e8cb4\nMOV             R0, R10                                                ; +0x36, 0x4e8cb6\nMOV             R1, R6                                                 ; +0x38, 0x4e8cb8\nBLX             __aeabi_uidivmod                                       ; +0x3a, 0x4e8cba\nMOV             R11, R1                                                ; +0x3e, 0x4e8cbe\nLDR.W           R2, [R8]                                               ; +0x40, 0x4e8cc0\nLDR.W           R2, [R2,R11,LSL#2]                                     ; +0x44, 0x4e8cc4\nCMP             R2, #0                                                 ; +0x48, 0x4e8cc8\nBEQ             loc_4E8C90                                             ; +0x4a, 0x4e8cca\nLDR             R5, [R2]                                               ; +0x4c, 0x4e8ccc\nCMP             R5, #0                                                 ; +0x4e, 0x4e8cce\nBEQ             loc_4E8C90                                             ; +0x50, 0x4e8cd0\nLDR             R0, [R5,#4]                                            ; +0x52, 0x4e8cd2\nCMP.W           R9, #0                                                 ; +0x54, 0x4e8cd4\nBNE             loc_4E8CE0                                             ; +0x58, 0x4e8cd8\nAND.W           R1, R7, R0                                             ; +0x5a, 0x4e8cda\nB               loc_4E8CE6                                             ; +0x5e, 0x4e8cde\nMOV             R1, R6                                                 ; +0x60, 0x4e8ce0\nBLX             __aeabi_uidivmod                                       ; +0x62, 0x4e8ce2\nCMP             R1, R11                                                ; +0x66, 0x4e8ce6\nBNE             loc_4E8C90                                             ; +0x68, 0x4e8ce8\nLDR             R2, [R5,#8]                                            ; +0x6a, 0x4e8cea\nCMP             R2, R10                                                ; +0x6c, 0x4e8cec\nBEQ             loc_4E8CF4                                             ; +0x6e, 0x4e8cee\nLDR             R5, [R5]                                               ; +0x70, 0x4e8cf0\nB               loc_4E8CCE                                             ; +0x72, 0x4e8cf2\nLDR             R2, [R5,#0xC]                                          ; +0x74, 0x4e8cf4\nSTR.W           R2, [R4,#-0x10]                                        ; +0x76, 0x4e8cf6\nB               loc_4E8C90                                             ; +0x7a, 0x4e8cfa\nADD             SP, SP, #0xC                                           ; +0x7c, 0x4e8cfc\nPOP.W           {R4-R11,PC}                                            ; +0x7e, 0x4e8cfe", "xrefs": ["GJBaseGameLayer::applyRemap @ 0x5a7ac0"], "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"}