From 0af74215dbc7b21711c8be8fd0c55b3e8bc174d1 Mon Sep 17 00:00:00 2001 From: yellows8 Date: Fri, 5 Jun 2015 21:33:26 -0400 Subject: [PATCH] Implemented --stride. --- ropgadget_patternfinder.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/ropgadget_patternfinder.c b/ropgadget_patternfinder.c index 9a10682..0dd6706 100644 --- a/ropgadget_patternfinder.c +++ b/ropgadget_patternfinder.c @@ -106,6 +106,7 @@ int main(int argc, char **argv) unsigned char *inhashptr; size_t filebufsz=0, pos, hashblocksize=0; unsigned int tmpsize=0; + unsigned int stride = 4; struct stat filestat; FILE *fbin; @@ -119,6 +120,7 @@ int main(int argc, char **argv) printf("Options:\n"); printf("--patternsha256= Hash every --patternsha256size bytes in the binary, for locating the target pattern. The input bindata(sha256 hash) size must be 0x20-bytes.\n"); printf("--patternsha256size=0x See --patternsha256.\n"); + printf("--stride=0x In the search loop, this is the value that the pos is increased by at the end of each interation. By default this is 0x4.\n"); return 0; } @@ -149,6 +151,11 @@ int main(int argc, char **argv) hashblocksize = tmpsize; } + if(strncmp(argv[argi], "--stride=", 9)==0) + { + sscanf(&argv[argi][9], "0x%x", &stride); + } + if(ret!=0)break; } @@ -201,7 +208,7 @@ int main(int argc, char **argv) found = 0; ret = 0; - for(pos=0; pos