Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

自定义脚本 #37

Open
book9602 opened this issue Dec 7, 2022 · 2 comments
Open

自定义脚本 #37

book9602 opened this issue Dec 7, 2022 · 2 comments

Comments

@book9602
Copy link

book9602 commented Dec 7, 2022

自定义脚本那里,我用下面代码在原来的frida能用,但在window你这工具没信息显示?
Java.perform(function() {
var targetClass='com.shandui.common.utils.MD5Util';
var methodName='getMD5';
var gclass = Java.use(targetClass);
gclass[methodName].overload('java.lang.String').implementation = function(arg0) {
console.log('\nGDA[Hook getMD5(java.lang.String)]'+'\n\targ0 = '+arg0);
var i=thismethodName;
console.log('\treturn '+i);
return i;
}
})

日志以下,没显示
2022-12-07 09:44:59 default.js init hook success
2022-12-07 09:45:00 加载appinfo
2022-12-07 09:49:23 default.js init hook success
2022-12-07 09:49:23 加载appinfo

@book9602
Copy link
Author

book9602 commented Dec 7, 2022

Java.perform(function() {
var targetClass='com.shandui.common.utils.MD5Util';
var methodName='getMD5';
var gclass = Java.use(targetClass);
gclass[methodName].overload('java.lang.String').implementation = function(arg0) {
console.log('\nGDA[Hook getMD5(java.lang.String)]'+'\n\targ0 = '+arg0);
klog(arg0)
var i=thismethodName;
console.log('\treturn '+i);
klog(i)
console.log(Java.use("android.util.Log").getStackTraceString(Java.use("java.lang.Throwable").$new()));
return i;
}
})

function klog(data){
var message={};
message["jsname"]="%customName%";
message["data"]=data;
send(message);
}
function klogData(data,key,value){
var message={};
message["jsname"]="%customName%";
message["data"]=data;
message[key]=value;
send(message);
}

好像又知道怎样用了,用上面的代码又可以正常打印信息了

@dqzg12300
Copy link
Owner

嗯。是的。参考模版里面的用法打印信息即可

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants