frida-fs 6.0.0 → 7.0.1
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 +17 -22
- package/dist/index.js +7 -3
- package/package.json +2 -2
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: (
|
|
73
|
-
export declare const readFile: (
|
|
74
|
-
export declare const writeFile: (
|
|
75
|
-
export declare const readlink: (
|
|
76
|
-
export declare const rmdir: (
|
|
77
|
-
export declare const unlink: (
|
|
78
|
-
export declare const stat: (
|
|
79
|
-
export declare const lstat: (
|
|
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: (
|
|
82
|
+
readdir: (path: string, args_1: AsyncCallback<string[]>) => void;
|
|
88
83
|
readdirSync: typeof readdirSync;
|
|
89
84
|
list: typeof list;
|
|
90
|
-
readFile: (
|
|
91
|
-
readFileSync: (path: string, options?: ReadFileOptions
|
|
92
|
-
writeFile: (
|
|
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: (
|
|
89
|
+
readlink: (path: string, args_1: AsyncCallback<string>) => void;
|
|
95
90
|
readlinkSync: (path: string) => string;
|
|
96
|
-
rmdir: (
|
|
91
|
+
rmdir: (path: string, args_1: AsyncCallback<void>) => void;
|
|
97
92
|
rmdirSync: (path: string) => void;
|
|
98
|
-
unlink: (
|
|
93
|
+
unlink: (path: string, args_1: AsyncCallback<void>) => void;
|
|
99
94
|
unlinkSync: (path: string) => void;
|
|
100
|
-
stat: (
|
|
95
|
+
stat: (path: string, args_1: AsyncCallback<Stats>) => void;
|
|
101
96
|
statSync: (path: string) => Stats;
|
|
102
|
-
lstat: (
|
|
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
|
@@ -815,8 +815,10 @@ function statsReadField(name, path) {
|
|
|
815
815
|
return undefined;
|
|
816
816
|
}
|
|
817
817
|
const [offset, type] = field;
|
|
818
|
-
const
|
|
819
|
-
const value =
|
|
818
|
+
const address = this.buffer.add(offset);
|
|
819
|
+
const value = (typeof type === "string")
|
|
820
|
+
? NativePointer.prototype["read" + type].call(address)
|
|
821
|
+
: type.call(address, path);
|
|
820
822
|
if (value instanceof Int64 || value instanceof UInt64)
|
|
821
823
|
return value.valueOf();
|
|
822
824
|
return value;
|
|
@@ -964,7 +966,7 @@ function makeApi(spec) {
|
|
|
964
966
|
return api;
|
|
965
967
|
}, {});
|
|
966
968
|
}
|
|
967
|
-
|
|
969
|
+
let kernel32 = null;
|
|
968
970
|
const nativeOpts = (isWindows && pointerSize === 4) ? { abi: "stdcall" } : {};
|
|
969
971
|
function addApiPlaceholder(api, entry) {
|
|
970
972
|
const [name] = entry;
|
|
@@ -972,6 +974,8 @@ function addApiPlaceholder(api, entry) {
|
|
|
972
974
|
configurable: true,
|
|
973
975
|
get() {
|
|
974
976
|
const [, Ctor, retType, argTypes, wrapper] = entry;
|
|
977
|
+
if (isWindows && kernel32 === null)
|
|
978
|
+
kernel32 = Process.getModuleByName("kernel32.dll");
|
|
975
979
|
let impl = null;
|
|
976
980
|
const address = isWindows
|
|
977
981
|
? kernel32.findExportByName(name)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "frida-fs",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "7.0.1",
|
|
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.
|
|
28
|
+
"typescript": "^5.8.3"
|
|
29
29
|
}
|
|
30
30
|
}
|