public static boolean containsBytes(byte[] request, byte[] value) { return helpers.indexOf(request, value, false, 1, request.length - 1) != -1; }
static int countMatches(byte[] response, byte[] match) { int matches = 0; if (match.length < 4) { return matches; } int start = 0; while (start < response.length) { start = helpers.indexOf(response, match, true, start, response.length); if (start == -1) break; matches += 1; start += match.length; } return matches; }
static int countMatches(byte[] response, byte[] match) { int matches = 0; if (match.length < 4) { return matches; } int start = 0; // Utilities.out("#"+response.length); while (start < response.length) { start = helpers.indexOf(response, match, true, start, response.length); if (start == -1) break; matches += 1; start += match.length; } return matches; }
static int countMatches(byte[] response, byte[] match) { int matches = 0; if (match.length < 4) { return matches; } int start = 0; // Utilities.out("#"+response.length); while (start < response.length) { start = helpers.indexOf(response, match, true, start, response.length); if (start == -1) break; matches += 1; start += match.length; } return matches; }
static List<int[]> getMatches(byte[] response, byte[] match, int giveUpAfter) { if (giveUpAfter == -1) { giveUpAfter = response.length; } List<int[]> matches = new ArrayList<>(); if (match.length < 4) { return matches; } int start = 0; while (start < giveUpAfter) { start = helpers.indexOf(response, match, true, start, giveUpAfter); if (start == -1) break; matches.add(new int[]{start, start + match.length}); start += match.length; } return matches; }
static List<int[]> getMatches(byte[] response, byte[] match, int giveUpAfter) { if (giveUpAfter == -1) { giveUpAfter = response.length; } List<int[]> matches = new ArrayList<>(); // if (match.length < 4) { // return matches; // } int start = 0; while (start < giveUpAfter) { start = helpers.indexOf(response, match, true, start, giveUpAfter); if (start == -1) break; matches.add(new int[]{start, start + match.length}); start += match.length; } return matches; }
/** * Helper method to search a response for occurrences of a literal match * string and return a list of start/end offsets */ public static List<int[]> getMatches(byte[] response, byte[] match, IExtensionHelpers helpers) { List<int[]> matches = new ArrayList<int[]>(); int start = 0; while (start < response.length) { start = helpers.indexOf(response, match, true, start, response.length); if (start == -1) { break; } matches.add(new int[]{start, start + match.length}); start += match.length; } return matches; }
static List<int[]> getMatches(byte[] response, byte[] match, int giveUpAfter) { if (giveUpAfter == -1) { giveUpAfter = response.length; } List<int[]> matches = new ArrayList<>(); // if (match.length < 4) { // return matches; // } int start = 0; while (start < giveUpAfter) { start = helpers.indexOf(response, match, true, start, giveUpAfter); if (start == -1) break; matches.add(new int[]{start, start + match.length}); start += match.length; } return matches; }
private List<int[]> buildRequestHighlights(String payload, IHttpRequestResponse sentRequestResponse) { List<int[]> requestHighlights = new ArrayList<>(); int startOfPayload = helpers.indexOf(sentRequestResponse.getRequest(), helpers.stringToBytes(payload), true, 0, sentRequestResponse.getRequest().length); if (startOfPayload != -1) { requestHighlights.add(new int[]{startOfPayload, startOfPayload + payload.length()}); } return requestHighlights; }
private List<int[]> buildRequestHighlights( String payload, IHttpRequestResponse sentRequestResponse) { List<int[]> requestHighlights = new ArrayList<int[]>(); int startOfPayload = helpers.indexOf( sentRequestResponse.getRequest(), helpers.stringToBytes(payload), true, 0, sentRequestResponse.getRequest().length); if (startOfPayload != -1) { requestHighlights.add(new int[] { startOfPayload, startOfPayload + payload.length() }); } return requestHighlights; }
int formTagOffset = helpers.indexOf(responseBytes, htmlFormPattern, false, 0, responseBytes.length); if (formTagOffset == -1) { return null;
byte[] scanBaseGrep = Utilities.helpers.stringToBytes(insertionPoint.calculateValue(scanBasePayload)); int start = Utilities.helpers.indexOf(req, scanBaseGrep, true, 0, req.length); int end = start + scanBaseGrep.length; IScannerInsertionPoint valueInsertionPoint = new RawInsertionPoint(req, start, end);