{"type": "func", "start": 11802244, "end": 11802532, "name": "FileOperation::readFile", "pseudocode": "// \n// FileOperation::readFile from 0xb41684 to 0xb417a4 (288 bytes)\n// \n// 1 xrefs:\n// > <???> @ 0xae690\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 FileOperation::readFile()\n{\n  FILE *v0; // x0\n  FILE *v1; // x20\n  char *v2; // x2\n  char *v3; // x0\n  unsigned int *v4; // x2\n  int v5; // w1\n  unsigned int *v6; // x2\n  char *filename; // [xsp+28h] [xbp+28h] BYREF\n  char s[8]; // [xsp+30h] [xbp+30h] BYREF\n  __int64 v9; // [xsp+38h] [xbp+38h]\n  __int64 v10; // [xsp+40h] [xbp+40h]\n  __int64 v11; // [xsp+48h] [xbp+48h]\n  __int64 v12; // [xsp+50h] [xbp+50h]\n  __int64 v13; // [xsp+58h] [xbp+58h]\n  __int16 v14; // [xsp+60h] [xbp+60h]\n\n  FileOperation::getFilePath(_stack_chk_guard, (__int64)&filename);\n  v0 = fopen(filename, \"r\");\n  v14 = 0;\n  *(_QWORD *)s = 0;\n  v9 = 0;\n  v10 = 0;\n  v11 = 0;\n  v12 = 0;\n  v13 = 0;\n  v1 = v0;\n  if ( v0 )\n  {\n    fgets(s, 50, v0);\n    fclose(v1);\n    v2 = filename;\n    v3 = filename - 24;\n    if ( filename - 24 == (char *)&qword_124B6B0 )\n      return;\n    if ( &pthread_create )\n    {\n      v6 = (unsigned int *)(filename - 8);\n      do\n        v5 = __ldaxr(v6);\n      while ( __stlxr(v5 - 1, v6) );\n      goto LABEL_12;\n    }\n  }\n  else\n  {\n    v2 = filename;\n    v3 = filename - 24;\n    if ( filename - 24 == (char *)&qword_124B6B0 )\n      return;\n    if ( &pthread_create )\n    {\n      v4 = (unsigned int *)(filename - 8);\n      do\n        v5 = __ldaxr(v4);\n      while ( __stlxr(v5 - 1, v4) );\n      goto LABEL_12;\n    }\n  }\n  v5 = *((_DWORD *)v2 - 2);\n  *((_DWORD *)v2 - 2) = v5 - 1;\nLABEL_12:\n  if ( v5 <= 0 )\n    operator delete(v3);\n}", "assembly": "; \n; FileOperation::readFile from 0xb41684 to 0xb417a4 (288 bytes)\n; \n; 1 xrefs:\n; > <???> @ 0xae690\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\nSTP             X29, X30, [SP,#var_70]!                                ; +0x0, 0xb41684\nMOV             X29, SP                                                ; +0x4, 0xb41688\nSTP             X19, X20, [SP,#0x70+var_60]                            ; +0x8, 0xb4168c\nADRP            X19, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0xb41690\nADD             X8, X29, #0x70+filename                                ; +0x10, 0xb41694\nLDR             X0, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x14, 0xb41698\nLDR             X0, [X0]; this                                         ; +0x18, 0xb4169c\nSTR             X0, [X29,#0x70+var_8]                                  ; +0x1c, 0xb416a0\nBL              _ZN13FileOperation11getFilePathEv; FileOperation::getFilePath(void) ; +0x20, 0xb416a4\nLDR             X0, [X29,#0x70+filename]; filename                     ; +0x24, 0xb416a8\nADRL            X1, (aShowProgressBa+0x10); modes                      ; +0x28, 0xb416ac\nBL              .fopen                                                 ; +0x30, 0xb416b4\nSTRH            WZR, [X29,#0x70+var_10]                                ; +0x34, 0xb416b8\nSTP             XZR, XZR, [X29,#0x70+s]                                ; +0x38, 0xb416bc\nSTP             XZR, XZR, [X29,#0x70+var_30]                           ; +0x3c, 0xb416c0\nSTP             XZR, XZR, [X29,#0x70+var_20]                           ; +0x40, 0xb416c4\nMOV             X20, X0                                                ; +0x44, 0xb416c8\nCBZ             X0, loc_B41720                                         ; +0x48, 0xb416cc\nMOV             X2, X0; stream                                         ; +0x4c, 0xb416d0\nMOV             W1, #0x32 ; '2'; n                                     ; +0x50, 0xb416d4\nADD             X0, X29, #0x70+s; s                                    ; +0x54, 0xb416d8\nBL              .fgets                                                 ; +0x58, 0xb416dc\nMOV             X0, X20; stream                                        ; +0x5c, 0xb416e0\nBL              .fclose                                                ; +0x60, 0xb416e4\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x64, 0xb416e8\nLDR             X2, [X29,#0x70+filename]                               ; +0x68, 0xb416ec\nSUB             X0, X2, #0x18; p                                       ; +0x6c, 0xb416f0\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x70, 0xb416f4\nCMP             X0, X1                                                 ; +0x74, 0xb416f8\nB.NE            loc_B4175C                                             ; +0x78, 0xb416fc\nLDR             X19, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x7c, 0xb41700\nLDR             X1, [X29,#0x70+var_8]                                  ; +0x80, 0xb41704\nLDR             X0, [X19]                                              ; +0x84, 0xb41708\nCMP             X1, X0                                                 ; +0x88, 0xb4170c\nB.NE            loc_B417A0                                             ; +0x8c, 0xb41710\nLDP             X19, X20, [SP,#0x70+var_60]                            ; +0x90, 0xb41714\nLDP             X29, X30, [SP+0x70+var_70],#0x70                       ; +0x94, 0xb41718\nRET                                                                    ; +0x98, 0xb4171c\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x9c, 0xb41720\nLDR             X2, [X29,#0x70+filename]                               ; +0xa0, 0xb41724\nSUB             X0, X2, #0x18                                          ; +0xa4, 0xb41728\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0xa8, 0xb4172c\nCMP             X0, X1                                                 ; +0xac, 0xb41730\nB.EQ            loc_B41700                                             ; +0xb0, 0xb41734\nADRP            X1, #pthread_create_ptr_0@PAGE                         ; +0xb4, 0xb41738\nLDR             X1, [X1,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0xb8, 0xb4173c\nCBZ             X1, loc_B41790                                         ; +0xbc, 0xb41740\nSUB             X2, X2, #8                                             ; +0xc0, 0xb41744\nLDAXR           W1, [X2]                                               ; +0xc4, 0xb41748\nSUB             W3, W1, #1                                             ; +0xc8, 0xb4174c\nSTLXR           W4, W3, [X2]                                           ; +0xcc, 0xb41750\nCBZ             W4, loc_B4177C                                         ; +0xd0, 0xb41754\nB               loc_B41748                                             ; +0xd4, 0xb41758\nADRP            X1, #pthread_create_ptr_0@PAGE                         ; +0xd8, 0xb4175c\nLDR             X1, [X1,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0xdc, 0xb41760\nCBZ             X1, loc_B41790                                         ; +0xe0, 0xb41764\nSUB             X2, X2, #8                                             ; +0xe4, 0xb41768\nLDAXR           W1, [X2]                                               ; +0xe8, 0xb4176c\nSUB             W3, W1, #1                                             ; +0xec, 0xb41770\nSTLXR           W4, W3, [X2]                                           ; +0xf0, 0xb41774\nCBNZ            W4, loc_B4176C                                         ; +0xf4, 0xb41778\nCMP             W1, WZR                                                ; +0xf8, 0xb4177c\nB.GT            loc_B41700                                             ; +0xfc, 0xb41780\nADD             X1, X29, #0x70+var_50                                  ; +0x100, 0xb41784\nBL              j__ZdlPv; operator delete(void *)                      ; +0x104, 0xb41788\nB               loc_B41700                                             ; +0x108, 0xb4178c\nLDUR            W1, [X2,#-8]                                           ; +0x10c, 0xb41790\nSUB             W3, W1, #1                                             ; +0x110, 0xb41794\nSTUR            W3, [X2,#-8]                                           ; +0x114, 0xb41798\nB               loc_B4177C                                             ; +0x118, 0xb4179c\nBL              .__stack_chk_fail                                      ; +0x11c, 0xb417a0", "xrefs": ["<???> @ 0xae690"], "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"}