Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Download the zip, decompress it, then:
cd release/
java -jar ReScue.jar
```
Sample output should be:
Sample output:
```
Input regex: (?=(a+)+b)aaabx
(?=(a+)+b)aaabx
Expand Down
4 changes: 4 additions & 0 deletions release/Readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ java -jar rescue.jar <-sl string length> <-pz population size> <-g generations>
-q Quiet mode, do not show input message, usage:
java -jar rescue.jar -q
or combine with other options

--regex-file Inputs text file of regexes to program, usage:
java -jar rescue.jar
> Input regex: regex.txt

For example:
java -jar rescue.jar
Expand Down
18 changes: 11 additions & 7 deletions src/cn/edu/nju/moon/redos/attackers/pp/Pumper.java
Original file line number Diff line number Diff line change
@@ -1,18 +1,21 @@
package cn.edu.nju.moon.redos.attackers.pp;

import cn.edu.nju.moon.redos.RedosAttacker;
import com.google.gson.Gson;
import cn.edu.nju.moon.redos.Trace;
import cn.edu.nju.moon.redos.regex.ReScueMatcher;
import cn.edu.nju.moon.redos.regex.ReScuePattern;

public class Pumper {
private int MAX_LEN = 128; // Max repeat times of the effective sub-string

public Pumper(int max_len){
this.MAX_LEN = max_len;
}

/**
private int MAX_LEN = 128; // Max repeat times of the effective sub-string


public Pumper(int max_len) {
this.MAX_LEN = max_len;
}


/**
* Repeating the most effective sub-string of the attack string
* @param p
* @param t
Expand Down Expand Up @@ -96,6 +99,7 @@ public Trace reRepeat(ReScuePattern p, Trace t) {
Trace tp = vm.find();
if (tp.attackSuccess()) {
t = tp;
System.out.println("Prefix, pump, and suffix as JSON:\t" + new Gson().toJson(nprefix + npump + nsuffix));
}
}
System.out.println(t.getMatchSteps() + " : " + pump_time + " : " + t.str);
Expand Down
Loading