Created
March 28, 2015 12:18
-
-
Save flankerhqd/c621f5aee06dad53e37c to your computer and use it in GitHub Desktop.
frida test
This file contains hidden or 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
script = session.create_script(''' | |
Dalvik.perform(function () { | |
var Activity = Dalvik.use("com.example.myapp.MyActivity"); | |
Activity.hookMe.overload("java.lang.String").implementation = function () { | |
Activity.hookMe.overload("java.lang.String").call(args[0], "foo");//comment out this line won't crash | |
return "foo"; | |
}; | |
}); | |
''') | |
// This result in immediate crash | |
// Question: Is args[0] refer to this? How do I refer args, like accessing arg in hookMe? | |
//Test Android Code | |
@Override | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.main); | |
Button button = (Button) findViewById(R.id.button); | |
button.setOnClickListener(new View.OnClickListener() { | |
@Override | |
public void onClick(View v) { | |
Toast.makeText(getApplicationContext(), hookMe("test"), Toast.LENGTH_SHORT).show(); | |
} | |
}); | |
} | |
public String hookMe(String arg) | |
{ | |
return arg+"I'm memeda"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment