From 348dad3f1cbc100487e5967615484dc1041da291 Mon Sep 17 00:00:00 2001 From: b33f Date: Tue, 7 Sep 2021 22:27:45 +0100 Subject: [PATCH] +Fermion-v17 --- CHANGELOG.txt | 9 +- Fermion/assets/img/version.png | Bin 3206 -> 3121 bytes Fermion/assets/lang/frida.d.ts | 249 ++++++++++++++++++++++++++------- Fermion/core.js | 2 +- Fermion/package.json | 4 +- Fermion/src/frida.html | 11 +- Fermion/src/proc.html | 81 ++++++++++- Fermion/src/render.js | 31 +++- README.md | 6 +- 9 files changed, 325 insertions(+), 68 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 9d43a27..30341f5 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -93,4 +93,11 @@ * Disable contextIsolation for window communications * Bugfix for https://github.com/FuzzySecurity/Fermion/issues/12 * Four new themes: Amy, Oceanic Next, Tomorrow Night Blue, Vibrant Ink -* More minor UI colour changes. I'm still thinking of a full re-design for v2. \ No newline at end of file +* More minor UI colour changes. I'm still thinking of a full re-design for v2. + +-= Fermion v1.7 =- + +* Pre-built release updated to Frida v15.1.1 +* Updated language bindings +* Better process information User/PID/PPID. On devices where "parameters.icons" have a type of RGBA they are drawn to a canvas inline. In my testing Ubuntu did not have icons in which case they are not drawn. The release notes for v15 say that some devices like IOS/Android now return a PNG byte array, currently those are not drawn either, PR's welcome. +* The main UI now has a button which retrieves Device information as per the new specs in the v15 release notes. \ No newline at end of file diff --git a/Fermion/assets/img/version.png b/Fermion/assets/img/version.png index 7029c54a13411e4d083f8757f80967a6d6f54980..de9054b81bdaee2bc4414c8ab4923f7c910b06e9 100644 GIT binary patch delta 3064 zcmVy$znTLG!~syqso`lwQ^(kj?0#TG40h0#Kw zyhI4{3=kj?2uKphr+;v{?C#w?f4h5j@7+w>-wc0n?>XP^?|id+9>4QD=NeK64Z|RA z9|CyWRN6_tw3BwyLYm73a)C6H29hiFrM`S8Ztv{Q=I}7vxg%~rJiKhf^*qQl7EsJl z-0f4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>?Z4k$S0@9a1QrrC9crUQ#XxE4O?g(`1U3 z`OX_&Q#}3qGi}wAT+^Vu=VXLB{}ULv zF~>CjEwT;!^r7CR_}M5rK#%@G&Kz_T6T>t}^l?V|@2DmSBs9Ctvy%p9GcZ~zuC`S- za(T2Qe~WOo{TR11CHx%CUNri>Zh}COb1Fx4vXz^2aEv$!-UZ%|dijR}?sLAAjAmyH zV-d$0lpF8)DzlU2oNwoZMlbYdTvVeBM`u@i!KaC{a|GLMt-?9`CUe=vTrwFh#wnE9 zo9!CN?V?hf#SYw(#m1neOo(J`(Z0fW`5b^+f3rkUIHNHpyD~SXRp0R!v;kqH%CAbwCr7_kg1(_gvv1HUcYinJ4s(2nm+5gQ>a8 oBzyZtL_~xWxSNCHMiICC4}=qX7L // Francesco Tamagni // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped -// Minimum TypeScript Version: 3.5 +// Minimum TypeScript Version: 4.1 /** * Returns a hexdump of the provided ArrayBuffer or NativePointerValue target. @@ -1604,46 +1604,81 @@ declare const NativeFunction: NativeFunctionConstructor; interface NativeFunctionConstructor { - new(address: NativePointerValue, retType: NativeType, argTypes: NativeType[], abiOrOptions?: NativeABI | NativeFunctionOptions): NativeFunction; - readonly prototype: NativeFunction; + new ( + address: NativePointerValue, + retType: RetType, + argTypes: ArgTypes, + abiOrOptions?: NativeABI | NativeFunctionOptions, + ): NativeFunction< + GetNativeFunctionReturnValue, + ResolveVariadic, unknown[]>> + >; + readonly prototype: NativeFunction; } - interface NativeFunction extends NativePointer { - (...args: NativeArgumentValue[]): NativeReturnValue; - apply(thisArg: NativePointerValue | null | undefined, args: NativeArgumentValue[]): NativeReturnValue; - call(thisArg?: NativePointerValue | null, ...args: NativeArgumentValue[]): NativeReturnValue; + interface NativeFunction + extends NativePointer { + (...args: ArgTypes): RetType; + apply(thisArg: NativePointerValue | null | undefined, args: ArgTypes): RetType; + call(thisArg?: NativePointerValue | null, ...args: ArgTypes): RetType; } declare const SystemFunction: SystemFunctionConstructor; interface SystemFunctionConstructor { - new(address: NativePointerValue, retType: NativeType, argTypes: NativeType[], abiOrOptions?: NativeABI | NativeFunctionOptions): SystemFunction; - readonly prototype: SystemFunction; - } - - interface SystemFunction extends NativePointer { - (...args: NativeArgumentValue[]): SystemFunctionResult; - apply(thisArg: NativePointerValue | null | undefined, args: NativeArgumentValue[]): SystemFunctionResult; - call(thisArg?: NativePointerValue | null, ...args: NativeArgumentValue[]): SystemFunctionResult; - } - - type SystemFunctionResult = WindowsSystemFunctionResult | UnixSystemFunctionResult; + new ( + address: NativePointerValue, + retType: RetType, + argTypes: ArgTypes, + abiOrOptions?: NativeABI | NativeFunctionOptions, + ): SystemFunction< + GetNativeFunctionReturnValue, + ResolveVariadic, unknown[]>> + >; + readonly prototype: SystemFunction; + } + + interface SystemFunction + extends NativePointer { + (...args: ArgTypes): SystemFunctionResult; + apply(thisArg: NativePointerValue | null | undefined, args: ArgTypes): SystemFunctionResult; + call(thisArg?: NativePointerValue | null, ...args: ArgTypes): SystemFunctionResult; + } + + type SystemFunctionResult = + | WindowsSystemFunctionResult + | UnixSystemFunctionResult + ; - interface WindowsSystemFunctionResult { - value: NativeReturnValue; + interface WindowsSystemFunctionResult { + value: Value; lastError: number; } - interface UnixSystemFunctionResult { - value: NativeReturnValue; + interface UnixSystemFunctionResult { + value: Value; errno: number; } - declare class NativeCallback extends NativePointer { - constructor(func: NativeCallbackImplementation, retType: NativeType, argTypes: NativeType[], abi?: NativeABI); + declare class NativeCallback< + RetType extends NativeCallbackReturnType, + ArgTypes extends NativeCallbackArgumentType[] | [], + > extends NativePointer { + constructor( + func: NativeCallbackImplementation< + GetNativeCallbackReturnValue, + Extract, unknown[]> + >, + retType: RetType, + argTypes: ArgTypes, + abi?: NativeABI, + ); } - type NativeCallbackImplementation = (this: CallbackContext | InvocationContext, ...params: any[]) => any; + type NativeCallbackImplementation< + RetType extends NativeCallbackReturnValue, + ArgTypes extends NativeCallbackArgumentValue[] | [], + > = (this: CallbackContext | InvocationContext, ...args: ArgTypes) => RetType; interface CallbackContext { /** @@ -1659,11 +1694,125 @@ context: CpuContext; } - type NativeArgumentValue = NativePointerValue | UInt64 | Int64 | number | boolean | any[]; - - type NativeReturnValue = NativePointer | UInt64 | Int64 | number | boolean | any[]; - - type NativeType = string | any[]; + type Variadic = "..."; + + type ResolveVariadic = List extends [Variadic, ...infer Tail] + ? [...Array] + : List extends [infer Head, ...infer Tail] + ? [Head, ...ResolveVariadic] + : []; + + type RecursiveValuesOf = T[keyof T] | Array>; + + type RecursiveKeysOf = keyof T | Array> | []; + + type GetValue = Type[] extends T + ? Value + : T extends keyof Map + ? Map[T] + : { [P in keyof T]: T[P] extends Type ? GetValue : never }; + + // tslint:disable-next-line:interface-over-type-literal + type BaseNativeTypeMap = { + int: number; + uint: number; + long: number; + ulong: number; + char: number; + uchar: number; + float: number; + double: number; + int8: number; + uint8: number; + int16: number; + uint16: number; + int32: number; + uint32: number; + bool: number; + }; + + type NativeFunctionArgumentTypeMap = BaseNativeTypeMap & { + void: undefined; + pointer: NativePointerValue; + size_t: number | UInt64; + ssize_t: number | Int64; + int64: number | Int64; + uint64: number | UInt64; + "...": Variadic; + }; + + type NativeFunctionArgumentValue = RecursiveValuesOf; + + type NativeFunctionArgumentType = RecursiveKeysOf; + + type GetNativeFunctionArgumentValue = GetValue< + NativeFunctionArgumentTypeMap, + NativeFunctionArgumentValue, + NativeFunctionArgumentType, + T + >; + + type NativeFunctionReturnTypeMap = BaseNativeTypeMap & { + // tslint:disable-next-line:void-return + void: void; + pointer: NativePointer; + size_t: UInt64; + ssize_t: Int64; + int64: Int64; + uint64: UInt64; + }; + + type NativeFunctionReturnValue = RecursiveValuesOf; + + type NativeFunctionReturnType = RecursiveKeysOf; + + type GetNativeFunctionReturnValue = GetValue< + NativeFunctionReturnTypeMap, + NativeFunctionReturnValue, + NativeFunctionReturnType, + T + >; + + type NativeCallbackArgumentTypeMap = BaseNativeTypeMap & { + void: undefined; + pointer: NativePointer; + size_t: UInt64; + ssize_t: Int64; + int64: Int64; + uint64: UInt64; + }; + + type NativeCallbackArgumentValue = RecursiveValuesOf; + + type NativeCallbackArgumentType = RecursiveKeysOf; + + type GetNativeCallbackArgumentValue = GetValue< + NativeCallbackArgumentTypeMap, + NativeCallbackArgumentValue, + NativeCallbackArgumentType, + T + >; + + type NativeCallbackReturnTypeMap = BaseNativeTypeMap & { + // tslint:disable-next-line:void-return + void: void; + pointer: NativePointerValue; + size_t: number | UInt64; + ssize_t: number | Int64; + int64: number | Int64; + uint64: number | UInt64; + }; + + type NativeCallbackReturnValue = RecursiveValuesOf; + + type NativeCallbackReturnType = RecursiveKeysOf; + + type GetNativeCallbackReturnValue = GetValue< + NativeCallbackReturnTypeMap, + NativeCallbackReturnValue, + NativeCallbackReturnType, + T + >; type NativeABI = | "default" @@ -3065,27 +3214,27 @@ * through the constructor's second argument. */ declare class CModule { - /** - * Creates a new C module from the provided `code`. - * - * @param code C source code to compile, or a precompiled shared library. - * @param symbols Symbols to expose to the C module. Declare them as `extern`. - * This may for example be one or more memory blocks allocated using - * `Memory.alloc()`, and/or `NativeCallback` values for receiving - * callbacks from the C module. - * @param options Options for customizing the construction. - */ - constructor(code: string | ArrayBuffer, symbols?: CSymbols, options?: CModuleOptions); + /** + * Creates a new C module from the provided `code`. + * + * @param code C source code to compile, or a precompiled shared library. + * @param symbols Symbols to expose to the C module. Declare them as `extern`. + * This may for example be one or more memory blocks allocated using + * `Memory.alloc()`, and/or `NativeCallback` values for receiving + * callbacks from the C module. + * @param options Options for customizing the construction. + */ + constructor(code: string | ArrayBuffer, symbols?: CSymbols, options?: CModuleOptions); - /** - * Eagerly unmaps the module from memory. Useful for short-lived modules - * when waiting for a future garbage collection isn't desirable. - */ - dispose(): void; + /** + * Eagerly unmaps the module from memory. Useful for short-lived modules + * when waiting for a future garbage collection isn't desirable. + */ + dispose(): void; - readonly [name: string]: any; + readonly [name: string]: any; - static builtins: CModuleBuiltins; + static builtins: CModuleBuiltins; } interface CModuleOptions { @@ -3918,7 +4067,7 @@ * @param method Method to implement. * @param fn Implementation. */ - function implement(method: ObjectMethod, fn: AnyFunction): NativeCallback; + function implement(method: ObjectMethod, fn: AnyFunction): NativeCallback; /** * Creates a new class designed to act as a proxy for a target object. diff --git a/Fermion/core.js b/Fermion/core.js index 1b3f7d1..6a25e20 100644 --- a/Fermion/core.js +++ b/Fermion/core.js @@ -8,7 +8,7 @@ function createWindow() { bWin = new BrowserWindow({ contextIsolation: false, width: 1000, - height: 900, + height: 930, frame: false, show: false, backgroundColor: '#464646', diff --git a/Fermion/package.json b/Fermion/package.json index bc664cb..157cb6c 100644 --- a/Fermion/package.json +++ b/Fermion/package.json @@ -1,6 +1,6 @@ { "name": "fermion", - "version": "1.6.0", + "version": "1.7.0", "description": "Fermion is a stand-alone Frida electron tool.", "main": "core.js", "scripts": { @@ -11,7 +11,7 @@ "license": "BSD-3-Clause", "dependencies": { "electron": "13.1.6", - "frida": "15.0.2", + "frida": "15.1.1", "jquery": "^3.4.1", "monaco-editor": "0.17.0", "mutex-promise": "0.1.0" diff --git a/Fermion/src/frida.html b/Fermion/src/frida.html index 6c01ef1..6d92bec 100644 --- a/Fermion/src/frida.html +++ b/Fermion/src/frida.html @@ -33,7 +33,10 @@
  • - + +
  • +
  • +

@@ -218,7 +221,7 @@ var editor = monaco.editor.create(document.getElementById('container'), { value: [ '//-------------------------------------------//', - '// Fermion v1.6 //', + '// Fermion v1.7 //', '// ~b33f //', '//-------------------------------------------//', '', @@ -264,8 +267,8 @@