Skip to content

Commit

Permalink
reorg examples +fix
Browse files Browse the repository at this point in the history
  • Loading branch information
FrenchYeti committed Jan 28, 2022
1 parent 190cd16 commit c237c2c
Show file tree
Hide file tree
Showing 8 changed files with 67 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Interruptor = require('../dist/index.js').default.LinuxArm64();
var Interruptor = require('./android-arm64-strace.min.js').target.LinuxArm64();


Interruptor.newAgentTracer({
Expand All @@ -12,6 +12,6 @@ Interruptor.newAgentTracer({
count: 2000 // stop after 2000 basic blocks captured
}
}
}).startOnLoad(/<YOUR_LIB>>/g);
}).startOnLoad(/<YOUR_LIB>/g);


Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Interruptor = require('../dist/index.js').default.LinuxArm64();
var Interruptor = require('./android-arm64-strace.min.js').target.LinuxArm64();

Interruptor
.newAgentTracer({
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Interruptor = require('../dist/index.js').default.LinuxArm64();
var Interruptor = require('./android-arm64-strace.min.js').target.LinuxArm64();

Interruptor.newAgentTracer({
exclude: {
Expand Down
15 changes: 15 additions & 0 deletions examples/android/simple_strace.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
var Interruptor = require('./android-arm64-strace.min.js').target.LinuxArm64();

// Java.deoptimizeEverything();

Java.perform(()=>{
Interruptor.newAgentTracer({
exclude: {
syscalls: ["clock_gettime"]
}
}).start();
});




17 changes: 17 additions & 0 deletions examples/linux/coverage_agent.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
var Interruptor = require('./android-arm64-strace.min.js').target.LinuxArm64();


Interruptor.newAgentTracer({
exclude: {
syscalls: ["clock_gettime"]
},
coverage: {
enabled: true,
fname: "/data/data/<YOUR_APP>/test.drcov",
stops: {
count: 2000 // stop after 2000 basic blocks captured
}
}
}).startOnLoad(/<YOUR_LIB>/g);


11 changes: 11 additions & 0 deletions examples/linux/dynamic_strace.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
var Interruptor = require('./android-arm64-strace.min.js').target.LinuxArm64();

Interruptor
.newAgentTracer({
exclude: {
syscalls: ["clock_gettime"]
}
})
.startOnLoad(/<MY_LIB>/g);


19 changes: 19 additions & 0 deletions examples/linux/simple_agent.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
var Interruptor = require('./android-arm64-strace.min.js').target.LinuxArm64();

Interruptor.newAgentTracer({
exclude: {
syscalls: ["clock_gettime"]
},
svc: {
read: {
onLeave: function(ctx){
let res = Memory.scanSync(ctx.x1, ctx.x2.toInt32(), Interruptor.utils().toScanPattern('frida'));
if(res.length > 0){
res.map( m => m.address.writeByteArray([0x41,0x41,0x41,0x41,0x41]));
console.log("remove 'frida' pattern from resulting buffer");
}
}
}
}
}).startOnLoad(/<YOUR_LIB>/g);

Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
var Interruptor = require('../dist/index.js').default.LinuxArm64();
var Interruptor = require('./android-arm64-strace.min.js').target.LinuxArm64();


Interruptor.newAgentTracer({
Expand Down

0 comments on commit c237c2c

Please sign in to comment.