Skip to content

Commit

Permalink
+Fermion-v05
Browse files Browse the repository at this point in the history
  • Loading branch information
FuzzySecurity committed Jun 9, 2019
1 parent 83b9e31 commit 4f18494
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 10 deletions.
29 changes: 29 additions & 0 deletions Examples/CallNativeFunction.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
//--------------------------//
// Calling Native Functions //
//--------------------------//

// Native function pointer
var pMessageBoxA = Module.findExportByName("User32.dll","MessageBoxA");

// Function prototype
var fMessageBox = new NativeFunction(
pMessageBoxA,
"int",
[
"pointer",
"pointer",
"pointer",
"uint"
]
);

// Function parameters
var lpText = Memory.allocAnsiString("Hello from Frida!");
var lpCaption = Memory.allocAnsiString("b33f");

// Call function
send("[+] Calling MessageBoxA in remote proc..");
var CallResult = fMessageBox(ptr(0), lpText, lpCaption, 1);

// Print function return value
send(" |-> CallResult => " + CallResult);
Binary file modified Fermion/assets/img/version.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
41 changes: 33 additions & 8 deletions Fermion/assets/lang/frida.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1503,14 +1503,28 @@ declare interface ObjectWrapper {

declare type NativePointerValue = NativePointer | ObjectWrapper;

declare class NativeFunction extends NativePointer {
constructor(address: NativePointerValue, retType: NativeType, argTypes: NativeType[], abiOrOptions?: NativeABI | NativeFunctionOptions);
declare const NativeFunction: NativeFunctionConstructor;

declare interface NativeFunctionConstructor {
new(address: NativePointerValue, retType: NativeType, argTypes: NativeType[], abiOrOptions?: NativeABI | NativeFunctionOptions): NativeFunction;
readonly prototype: NativeFunction;
}

declare interface NativeFunction extends NativePointer {
(...args: NativeArgumentValue[]): NativeReturnValue;
apply(thisArg: NativePointerValue | null | undefined, args: NativeArgumentValue[]): NativeReturnValue;
call(thisArg?: NativePointerValue | null, ...args: NativeArgumentValue[]): NativeReturnValue;
}

declare class SystemFunction extends NativePointer {
constructor(address: NativePointerValue, retType: NativeType, argTypes: NativeType[], abiOrOptions?: NativeABI | NativeFunctionOptions);
declare const SystemFunction: SystemFunctionConstructor;

declare interface SystemFunctionConstructor {
new(address: NativePointerValue, retType: NativeType, argTypes: NativeType[], abiOrOptions?: NativeABI | NativeFunctionOptions): SystemFunction;
readonly prototype: SystemFunction;
}

declare interface SystemFunction extends NativePointer {
(...args: NativeArgumentValue[]): SystemFunctionResult;
apply(thisArg: NativePointerValue | null | undefined, args: NativeArgumentValue[]): SystemFunctionResult;
call(thisArg?: NativePointerValue | null, ...args: NativeArgumentValue[]): SystemFunctionResult;
}
Expand Down Expand Up @@ -2141,13 +2155,14 @@ declare class File {
declare class SqliteDatabase {
/**
* Opens the SQLite v3 database at `path` on the filesystem. The database
* will be opened read-write, and the returned `SqliteDatabase` object will
* allow you to perform queries on it. Throws an exception if the database
* cannot be opened.
* will by default be opened read-write, and the returned `SqliteDatabase`
* object will allow you to perform queries on it. Throws an exception if
* the database cannot be opened.
*
* @param path Filesystem path to database.
* @param options Options to customize how the database should be opened.
*/
static open(path: string): SqliteDatabase;
static open(path: string, options?: SqliteOpenOptions): SqliteDatabase;

/**
* Just like `open()` but the contents of the database is provided as a
Expand Down Expand Up @@ -2198,6 +2213,16 @@ declare class SqliteDatabase {
dump(): string;
}

declare interface SqliteOpenOptions {
flags?: SqliteOpenFlag[];
}

declare const enum SqliteOpenFlag {
ReadOnly = "readonly",
ReadWrite = "readwrite",
Create = "create",
}

/**
* Pre-compiled SQL statement.
*/
Expand Down
2 changes: 1 addition & 1 deletion Fermion/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fermion",
"version": "0.4.0",
"version": "0.5.0",
"description": "Fermion is a stand-alone Frida electron tool.",
"main": "core.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion Fermion/src/frida.html
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@
var editor = monaco.editor.create(document.getElementById('container'), {
value: [
'//-------------------------------------------//',
'// Fermion v0.4 //',
'// Fermion v0.5 //',
'// ~b33f //',
'//-------------------------------------------//',
'',
Expand Down

0 comments on commit 4f18494

Please sign in to comment.