From 6c8f854a40175d3fd4a5785463ca253348bcb616 Mon Sep 17 00:00:00 2001 From: Candice Quates Date: Sun, 5 Jul 2015 14:33:27 -0500 Subject: [PATCH] fixing null size blocking --- nullfinder.cc | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/nullfinder.cc b/nullfinder.cc index 98404e4..e11191a 100644 --- a/nullfinder.cc +++ b/nullfinder.cc @@ -28,6 +28,7 @@ g++ -std=c++0x -o nullf nullfinder.cc map_file.cc error.cc #define VERSION "nullfind 0.1 by Candice Quates May 2015" + #include "util.h" @@ -120,15 +121,15 @@ std::cout <<"null size "<< nullssize << std::endl; std::cout<< std::hex < image; - image.resize(n-7-startaddr); - for (int x=0,y=startaddr; ybuffer+y); } std::stringstream builder; @@ -156,8 +157,8 @@ std::cout <<"null size "<< nullssize << std::endl; std::cout << std::dec << (mfile->size)-startaddr << std::endl; if (extract) { std::vector image; - image.resize((mfile->size)-7-startaddr); - for (int x=0,y=startaddr; y<(mfile->size)-7; x++,y++) { + image.resize((mfile->size)-(nullssize-1)-startaddr); + for (int x=0,y=startaddr; y<(mfile->size)-(nullssize-1); x++,y++) { image[x]=(unsigned char)*(mfile->buffer+y); } std::stringstream builder;