forked from Ch0pin/medusa
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added option to dump libs from memory
- Loading branch information
Showing
11 changed files
with
147 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
rpc.exports = { | ||
|
||
memorydump: function (address, size) { | ||
Memory.protect(ptr(address), size, "rwx"); | ||
var a = Memory.readByteArray(ptr(address),size-1000); | ||
// var baseAddress = parseInt(address,16); | ||
// var endAddress = baseAddress + size; | ||
|
||
// Process.enumerateRanges('r--').forEach(function (range) { | ||
// try { | ||
// Memory.scanSync(address, range.size, "??").forEach(function (match) { | ||
// var curent = parceInt(match.address); | ||
|
||
// if(curent >= baseAddress && curent <= endAddress) | ||
|
||
// if (range.file && range.file.path | ||
// && (// range.file.path.startsWith("/data/app/") || | ||
// range.file.path.startsWith("/data/dalvik-cache/") || | ||
// range.file.path.startsWith("/system/"))) { | ||
// return; | ||
// } | ||
|
||
// if (verify(match.address, range, false)) { | ||
// var dex_size = match.address.add(0x20).readUInt(); | ||
// result.push({ | ||
// "addr": match.address, | ||
// "size": dex_size | ||
// }); | ||
// } | ||
// }); | ||
|
||
|
||
|
||
|
||
|
||
// console.log('pointer: Address: '+address + ' Size:'+size) | ||
return a; | ||
}, | ||
|
||
moduleaddress: function (lib){ | ||
try{ | ||
|
||
var ret = []; | ||
var module = Process.findModuleByName(lib); | ||
var address = Module.findBaseAddress(lib); | ||
var sz = module.size; | ||
|
||
|
||
// console.log('Address: '+address + ' Size:'+sz) | ||
|
||
ret.push({ | ||
"addr": address, | ||
"size": sz | ||
}); | ||
return ret; | ||
} | ||
catch(err){ | ||
console.log('[!] Error: '+err); | ||
} | ||
|
||
|
||
|
||
}, | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -56,4 +56,4 @@ function enumerateModules(){ | |
|
||
Java.perform(function() { | ||
enumerateModules(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,3 +25,4 @@ The array type signature of the array class java.lang.Object[] is: | |
} | ||
}) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#Description: 'void Get<PrimitiveType>ArrayRegion(JNIEnv *env, ArrayType array,jsize start, jsize len, const NativeType *buf)' | ||
|
||
#Help: A family of functions that copies back a region of a primitive array from a buffer. | ||
|
||
#Code: | ||
|
||
Interceptor.attach(getJNIFunctionAdress(jnienv_addr,"GetByteArrayRegion"),{ | ||
onEnter: function(args){ | ||
|
||
var bytebuffer = Memory.readUtf8String(args[4]); | ||
|
||
|
||
console.log("GetByteArrayRegion :"); | ||
colorLog(bytebuffer,{c: Color.Green}); | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.