{"type": "func", "start": 784840, "end": 785014, "name": "sub_BF9C8", "pseudocode": "// \n// sub_BF9C8 from 0xbf9c8 to 0xbfa76 (174 bytes)\n// \n// 0 xrefs:\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\nint __fastcall sub_BF9C8(int a1, int a2, int *a3)\n{\n  int result; // r0\n  int v7; // r0\n  int v8; // r4\n  int v9; // r6\n  int v10; // r4\n  FILE *v11; // r0\n  int v12; // r4\n  int v13; // [sp+4h] [bp-1Ch] BYREF\n\n  v13 = 0;\n  result = sub_BFE7C(&v13);\n  if ( !result )\n  {\n    v7 = (*(int (__fastcall **)(int, int, const char *, const char *))(*(_DWORD *)v13 + 452))(\n           v13,\n           gFMODClass,\n           \"fileDescriptorFromUri\",\n           \"(Ljava/lang/String;)I\");\n    if ( v7 )\n    {\n      v8 = v7;\n      v9 = (*(int (__fastcall **)(int, int))(*(_DWORD *)v13 + 668))(v13, a2);\n      v10 = sub_BFA88(v13, gFMODClass, v8, v9);\n      (*(void (__fastcall **)(int, int))(*(_DWORD *)v13 + 92))(v13, v9);\n      if ( v10 == -1 )\n      {\n        return 18;\n      }\n      else\n      {\n        v11 = fdopen(v10, \"rb\");\n        *(_DWORD *)(a1 + 4) = v11;\n        if ( !v11 )\n          return 13;\n        if ( fseek(v11, 0, 2) )\n          return 13;\n        v12 = ftell(*(FILE **)(a1 + 4));\n        if ( fseek(*(FILE **)(a1 + 4), 0, 0) )\n        {\n          return 13;\n        }\n        else\n        {\n          *a3 = v12;\n          return 0;\n        }\n      }\n    }\n    else\n    {\n      return 28;\n    }\n  }\n  return result;\n}", "assembly": "; \n; sub_BF9C8 from 0xbf9c8 to 0xbfa76 (174 bytes)\n; \n; 0 xrefs:\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            {R4-R7,LR}                                             ; +0x0, 0xbf9c8\nADD             R7, SP, #0xC                                           ; +0x2, 0xbf9ca\nPUSH.W          {R6-R9,R11}                                            ; +0x4, 0xbf9cc\nMOV             R9, R0                                                 ; +0x8, 0xbf9d0\nMOVS            R0, #0                                                 ; +0xa, 0xbf9d2\nSTR             R0, [SP,#8+var_4]                                      ; +0xc, 0xbf9d4\nADD             R0, SP, #8+var_4                                       ; +0xe, 0xbf9d6\nMOV             R8, R2                                                 ; +0x10, 0xbf9d8\nMOV             R6, R1                                                 ; +0x12, 0xbf9da\nBL              sub_BFE7C                                              ; +0x14, 0xbf9dc\nCBZ             R0, loc_BF9E8                                          ; +0x18, 0xbf9e0\nPOP.W           {R2,R3,R8,R9,R11}                                      ; +0x1a, 0xbf9e2\nPOP             {R4-R7,PC}                                             ; +0x1e, 0xbf9e6\nLDR             R0, [SP,#8+var_4]                                      ; +0x20, 0xbf9e8\nLDR             R1, [R0]                                               ; +0x22, 0xbf9ea\nLDR.W           R4, [R1,#0x1C4]                                        ; +0x24, 0xbf9ec\nLDR             R1, =(gFMODClass_ptr - 0xBF9F6)                        ; +0x28, 0xbf9f0\nADD             R1, PC; gFMODClass_ptr                                 ; +0x2a, 0xbf9f2\nLDR             R5, [R1]; gFMODClass                                   ; +0x2c, 0xbf9f4\nLDR             R1, [R5]                                               ; +0x2e, 0xbf9f6\nLDR             R2, =(aFiledescriptor - 0xBFA00); \"fileDescriptorFromUri\" ... ; +0x30, 0xbf9f8\nLDR             R3, =(aLjavaLangStrin_1 - 0xBFA02); \"(Ljava/lang/String;)I\" ... ; +0x32, 0xbf9fa\nADD             R2, PC; \"fileDescriptorFromUri\"                        ; +0x34, 0xbf9fc\nADD             R3, PC; \"(Ljava/lang/String;)I\"                        ; +0x36, 0xbf9fe\nBLX             R4                                                     ; +0x38, 0xbfa00\nCBZ             R0, loc_BFA66                                          ; +0x3a, 0xbfa02\nMOV             R4, R0                                                 ; +0x3c, 0xbfa04\nLDR             R0, [SP,#8+var_4]                                      ; +0x3e, 0xbfa06\nLDR             R1, [R0]                                               ; +0x40, 0xbfa08\nLDR.W           R2, [R1,#0x29C]                                        ; +0x42, 0xbfa0a\nMOV             R1, R6                                                 ; +0x46, 0xbfa0e\nBLX             R2                                                     ; +0x48, 0xbfa10\nMOV             R6, R0                                                 ; +0x4a, 0xbfa12\nLDR             R1, [R5]                                               ; +0x4c, 0xbfa14\nLDR             R0, [SP,#8+var_4]                                      ; +0x4e, 0xbfa16\nMOV             R2, R4                                                 ; +0x50, 0xbfa18\nMOV             R3, R6                                                 ; +0x52, 0xbfa1a\nBL              sub_BFA88                                              ; +0x54, 0xbfa1c\nMOV             R4, R0                                                 ; +0x58, 0xbfa20\nLDR             R0, [SP,#8+var_4]                                      ; +0x5a, 0xbfa22\nLDR             R1, [R0]                                               ; +0x5c, 0xbfa24\nLDR             R2, [R1,#0x5C]                                         ; +0x5e, 0xbfa26\nMOV             R1, R6                                                 ; +0x60, 0xbfa28\nBLX             R2                                                     ; +0x62, 0xbfa2a\nADDS            R0, R4, #1                                             ; +0x64, 0xbfa2c\nBEQ             loc_BFA6A                                              ; +0x66, 0xbfa2e\nLDR             R1, =(aRb - 0xBFA38); \"rb\" ...                         ; +0x68, 0xbfa30\nMOV             R0, R4; fd                                             ; +0x6a, 0xbfa32\nADD             R1, PC; \"rb\"                                           ; +0x6c, 0xbfa34\nBLX             fdopen                                                 ; +0x6e, 0xbfa36\nSTR.W           R0, [R9,#4]                                            ; +0x72, 0xbfa3a\nCBZ             R0, loc_BFA62                                          ; +0x76, 0xbfa3e\nMOVS            R1, #0; off                                            ; +0x78, 0xbfa40\nMOVS            R2, #2; whence                                         ; +0x7a, 0xbfa42\nBLX             fseek                                                  ; +0x7c, 0xbfa44\nCBNZ            R0, loc_BFA62                                          ; +0x80, 0xbfa48\nLDR.W           R0, [R9,#4]; stream                                    ; +0x82, 0xbfa4a\nBLX             ftell                                                  ; +0x86, 0xbfa4e\nMOV             R4, R0                                                 ; +0x8a, 0xbfa52\nLDR.W           R0, [R9,#4]; stream                                    ; +0x8c, 0xbfa54\nMOVS            R1, #0; off                                            ; +0x90, 0xbfa58\nMOVS            R2, #0; whence                                         ; +0x92, 0xbfa5a\nBLX             fseek                                                  ; +0x94, 0xbfa5c\nCBZ             R0, loc_BFA6E                                          ; +0x98, 0xbfa60\nMOVS            R0, #0xD                                               ; +0x9a, 0xbfa62\nB               loc_BF9E2                                              ; +0x9c, 0xbfa64\nMOVS            R0, #0x1C                                              ; +0x9e, 0xbfa66\nB               loc_BF9E2                                              ; +0xa0, 0xbfa68\nMOVS            R0, #0x12                                              ; +0xa2, 0xbfa6a\nB               loc_BF9E2                                              ; +0xa4, 0xbfa6c\nMOVS            R0, #0                                                 ; +0xa6, 0xbfa6e\nSTR.W           R4, [R8]                                               ; +0xa8, 0xbfa70\nB               loc_BF9E2                                              ; +0xac, 0xbfa74", "xrefs": [], "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"}