frida-fs 6.0.0 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,8 +1,3 @@
1
- /// <reference types="node" resolution-mode="require"/>
2
- /// <reference types="node" resolution-mode="require"/>
3
- /// <reference types="frida-gum" />
4
- /// <reference types="node" resolution-mode="require"/>
5
- /// <reference types="node" resolution-mode="require"/>
6
1
  import { Buffer } from "buffer";
7
2
  import stream from "stream";
8
3
  declare const constants: {
@@ -69,14 +64,14 @@ declare class Stats {
69
64
  type AsyncCallback<T> = (error: Error | null, result?: T) => void;
70
65
  export declare function createReadStream(path: string): ReadStream;
71
66
  export declare function createWriteStream(path: string): WriteStream;
72
- export declare const readdir: (args_0: string, args_1: AsyncCallback<string[]>) => void;
73
- export declare const readFile: (args_0: string, args_1: ReadFileOptions | undefined, args_2: AsyncCallback<string | Buffer>) => void;
74
- export declare const writeFile: (args_0: string, args_1: string | NodeJS.ArrayBufferView, args_2: WriteFileOptions | undefined, args_3: AsyncCallback<void>) => void;
75
- export declare const readlink: (args_0: string, args_1: AsyncCallback<string>) => void;
76
- export declare const rmdir: (args_0: string, args_1: AsyncCallback<void>) => void;
77
- export declare const unlink: (args_0: string, args_1: AsyncCallback<void>) => void;
78
- export declare const stat: (args_0: string, args_1: AsyncCallback<Stats>) => void;
79
- export declare const lstat: (args_0: string, args_1: AsyncCallback<Stats>) => void;
67
+ export declare const readdir: (path: string, args_1: AsyncCallback<string[]>) => void;
68
+ export declare const readFile: (path: string, options: ReadFileOptions | undefined, args_2: AsyncCallback<string | Buffer<ArrayBufferLike>>) => void;
69
+ export declare const writeFile: (path: string, data: string | NodeJS.ArrayBufferView<ArrayBufferLike>, options: WriteFileOptions | undefined, args_3: AsyncCallback<void>) => void;
70
+ export declare const readlink: (path: string, args_1: AsyncCallback<string>) => void;
71
+ export declare const rmdir: (path: string, args_1: AsyncCallback<void>) => void;
72
+ export declare const unlink: (path: string, args_1: AsyncCallback<void>) => void;
73
+ export declare const stat: (path: string, args_1: AsyncCallback<Stats>) => void;
74
+ export declare const lstat: (path: string, args_1: AsyncCallback<Stats>) => void;
80
75
  export { constants, readdirSync, list, readFileSync, writeFileSync, readlinkSync, rmdirSync, unlinkSync, statSync, lstatSync, Stats, };
81
76
  declare const _default: {
82
77
  constants: {
@@ -84,22 +79,22 @@ declare const _default: {
84
79
  };
85
80
  createReadStream: typeof createReadStream;
86
81
  createWriteStream: typeof createWriteStream;
87
- readdir: (args_0: string, args_1: AsyncCallback<string[]>) => void;
82
+ readdir: (path: string, args_1: AsyncCallback<string[]>) => void;
88
83
  readdirSync: typeof readdirSync;
89
84
  list: typeof list;
90
- readFile: (args_0: string, args_1: ReadFileOptions | undefined, args_2: AsyncCallback<string | Buffer>) => void;
91
- readFileSync: (path: string, options?: ReadFileOptions | undefined) => string | Buffer;
92
- writeFile: (args_0: string, args_1: string | NodeJS.ArrayBufferView, args_2: WriteFileOptions | undefined, args_3: AsyncCallback<void>) => void;
85
+ readFile: (path: string, options: ReadFileOptions | undefined, args_2: AsyncCallback<string | Buffer<ArrayBufferLike>>) => void;
86
+ readFileSync: (path: string, options?: ReadFileOptions) => string | Buffer;
87
+ writeFile: (path: string, data: string | NodeJS.ArrayBufferView<ArrayBufferLike>, options: WriteFileOptions | undefined, args_3: AsyncCallback<void>) => void;
93
88
  writeFileSync: typeof writeFileSync;
94
- readlink: (args_0: string, args_1: AsyncCallback<string>) => void;
89
+ readlink: (path: string, args_1: AsyncCallback<string>) => void;
95
90
  readlinkSync: (path: string) => string;
96
- rmdir: (args_0: string, args_1: AsyncCallback<void>) => void;
91
+ rmdir: (path: string, args_1: AsyncCallback<void>) => void;
97
92
  rmdirSync: (path: string) => void;
98
- unlink: (args_0: string, args_1: AsyncCallback<void>) => void;
93
+ unlink: (path: string, args_1: AsyncCallback<void>) => void;
99
94
  unlinkSync: (path: string) => void;
100
- stat: (args_0: string, args_1: AsyncCallback<Stats>) => void;
95
+ stat: (path: string, args_1: AsyncCallback<Stats>) => void;
101
96
  statSync: (path: string) => Stats;
102
- lstat: (args_0: string, args_1: AsyncCallback<Stats>) => void;
97
+ lstat: (path: string, args_1: AsyncCallback<Stats>) => void;
103
98
  lstatSync: (path: string) => Stats;
104
99
  Stats: typeof Stats;
105
100
  };
package/dist/index.js CHANGED
@@ -964,7 +964,7 @@ function makeApi(spec) {
964
964
  return api;
965
965
  }, {});
966
966
  }
967
- const kernel32 = isWindows ? Process.getModuleByName("kernel32.dll") : null;
967
+ let kernel32 = null;
968
968
  const nativeOpts = (isWindows && pointerSize === 4) ? { abi: "stdcall" } : {};
969
969
  function addApiPlaceholder(api, entry) {
970
970
  const [name] = entry;
@@ -972,6 +972,8 @@ function addApiPlaceholder(api, entry) {
972
972
  configurable: true,
973
973
  get() {
974
974
  const [, Ctor, retType, argTypes, wrapper] = entry;
975
+ if (isWindows && kernel32 === null)
976
+ kernel32 = Process.getModuleByName("kernel32.dll");
975
977
  let impl = null;
976
978
  const address = isWindows
977
979
  ? kernel32.findExportByName(name)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "frida-fs",
3
- "version": "6.0.0",
3
+ "version": "7.0.0",
4
4
  "description": "Create a stream from a filesystem resource",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -25,6 +25,6 @@
25
25
  "devDependencies": {
26
26
  "@types/frida-gum": "^19.0.0",
27
27
  "@types/node": "^18.15.3",
28
- "typescript": "^5.1.3"
28
+ "typescript": "^5.8.3"
29
29
  }
30
30
  }