Skip to content

Commit

Permalink
change webpack config
Browse files Browse the repository at this point in the history
  • Loading branch information
FrenchYeti committed Nov 29, 2022
1 parent 563f808 commit 298738b
Show file tree
Hide file tree
Showing 6 changed files with 85 additions and 11 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ The home for Interruptor, a human-friendly interrupts hook library based on Frid

Interruptor is the interrupts/systemcall hooking system from Dexcalibur.


Quick start for Android app (could not work as is with obfuscated app) :
```
frida --codeshare FrenchYeti/android-arm64-strace -U -f YOUR_BINARY
Expand Down Expand Up @@ -38,6 +39,8 @@ Interruptor can be used by following different approach. I Hope you will be able

### Case A : Using Interruptor package

[See it on NPM](https://www.npmjs.com/package/@reversense/interruptor)

**It is the BEST and more reliable way to use Interruptor**

This method require Frida >= 16.x is you write your hook in Typescript.
Expand Down
7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@reversense/interruptor",
"version": "1.0.7",
"version": "1.0.8",
"description": "A Frida-based library for hook system call (and interrupts) and produce strace-like output ",
"main": "index.js",
"type": "module",
Expand All @@ -13,7 +13,10 @@
"scripts": {
"build": "npx tsc",
"test": "mocha -r ts-node/register ./test/**/*.ts",
"clean": "rm src/**/*.js src/**/*.d.ts"
"clean": "rm src/**/*.js src/**/*.d.ts",
"pack-x64": "npx webpack --config webpack.android.x64.config.js",
"pack-arm64": "npx webpack --config webpack.android.arm64.config.js",
"pack-aarch32": "npx webpack --config webpack.android.aarch32.config.js"
},
"repository": {
"type": "git",
Expand Down
51 changes: 51 additions & 0 deletions test/InterruptorFactory.linux.aarch32.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
import {LinuxAarch32InterruptorFactory} from "../src/arch/LinuxAarch32InterruptorFactory.js";
import { expect } from 'chai';

describe('[LINUX][AARCH32] InterruptorFactory tests', () => { // the tests container


describe('* Basic features', () => {

const factory = new LinuxAarch32InterruptorFactory();

it('checking default factory', () => {
expect(factory.getOptions()).to.be.null;
});

it('checking built-in utilities', () => {
const utils = factory.utils();

expect(Object.keys(utils).length).to.be.greaterThan(0);
expect(Object.values(utils).length).to.be.greaterThan(0);

expect(utils.toByteArray).to.be.a('function');
expect(utils.toScanPattern).to.be.a('function');
expect(utils.printBackTrace).to.be.a('function');
});
});

describe('* Kernel API constants', () => {

const factory = new LinuxAarch32InterruptorFactory();

it('Error Codes', () => {
/*
EPERM : [1,"Not super-user"],
ENOENT : [2,"No such file or directory"],
ESRCH : [3,"No such process"],
EINTR : [4,"Interrupted system call"],
EIO : [5,"I/O error"],
*/
expect(factory.KAPI.ERR).to.be.not.null;
expect(Object.keys(factory.KAPI.ERR).length).to.be.greaterThan(120);
expect(factory.KAPI.ERR.EPERM).to.be.equal(1);
expect(factory.KAPI.ERR.ENOENT).to.be.equal(2);
expect(factory.KAPI.ERR.ESRCH).to.be.equal(3);
expect(factory.KAPI.ERR.EINTR).to.be.equal(4);
expect(factory.KAPI.ERR.EIO).to.be.equal(5);
});

});


});
16 changes: 12 additions & 4 deletions webpack.android.aarch32.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
const path = require('path');
import * as path from 'path';
import * as url from 'url';

const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
const outputPath = path.resolve(__dirname, process.env.DXC_DIST ? 'dist':'.');

module.exports = {
const config = {
entry: './index.linux.aarch32.js',
// devtool: 'inline-source-map',
target: 'node',
//target: 'node',
mode: 'production',
output: {
path: outputPath,
Expand All @@ -14,4 +17,9 @@ module.exports = {
type: 'commonjs'
}
},
};
experiments: {
outputModule: true
}
};

export default config;
3 changes: 2 additions & 1 deletion webpack.android.arm64.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ const config = {
path: outputPath,
filename: 'android-arm64-strace.min.js',
library:{
type: 'module'
//type: 'module'
type: 'commonjs'
}
},
experiments: {
Expand Down
16 changes: 12 additions & 4 deletions webpack.android.x64.config.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
const path = require('path');
import * as path from 'path';
import * as url from 'url';

const __dirname = url.fileURLToPath(new URL('.', import.meta.url));
const outputPath = path.resolve(__dirname, process.env.DXC_DIST ? 'dist':'.');

module.exports = {
const config = {
entry: './index.linux.x64.js',
// devtool: 'inline-source-map',
target: 'node',
//target: 'node',
mode: 'production',
output: {
path: outputPath,
Expand All @@ -14,4 +17,9 @@ module.exports = {
type: 'commonjs'
}
},
};
experiments: {
outputModule: true
}
};

export default config;

0 comments on commit 298738b

Please sign in to comment.