Skip to content

Commit

Permalink
getting all the signs to match
Browse files Browse the repository at this point in the history
  • Loading branch information
candicenonsense committed Jul 31, 2015
1 parent 1dec382 commit 2a37ff3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion map_file.cc
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ processed_file_t *process_file(const char *fname) {

mfile->buffer = (uint8_t*)alloc_check(ALLOC_ZERO,sizeof(uint8_t)*file_stat.st_size, "read_file", "mfile", ERROR_EXIT);
is->read((char*)mfile->buffer,file_stat.st_size);
uint64_t res=is->gcount();
int64_t res=is->gcount();
if( res != file_stat.st_size) {
fprintf( stderr, "read failed: %s.\n", strerror( errno));
free( mfile);
Expand Down
8 changes: 3 additions & 5 deletions nullfinder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ main(int argc, char *argv[])
return 1;
}
bool nullsm=false;
int nullssize=8;
uint32_t nullssize=8;
// look for extract and nulls size
for (int i=0; i<argc; i++) {
if (std::string("--extract").compare(std::string(argv[i]))==0) {
Expand All @@ -81,9 +81,8 @@ main(int argc, char *argv[])
nullsm=true;
}
}
std::cout <<"null size "<< nullssize << std::endl;
nullsm=false;
//loop for multiple files here
//loop for multiple files here -- from prior code but does work.
for (int i=1; i<argc; i++) {
if (std::string("--extract").compare(std::string(argv[i]))==0) {
continue;
Expand All @@ -105,7 +104,6 @@ std::cout <<"null size "<< nullssize << std::endl;
std::cerr << "nullf: file " << filename << " empty or not found" << std::endl;
return 1;
}
int error=0;
std::cout << "nullf processing: "<< filename << std::endl;
uint8_t current=0;
uint64_t range=0;
Expand Down Expand Up @@ -157,7 +155,7 @@ std::cout <<"null size "<< nullssize << std::endl;
if (extract) {
std::vector<unsigned char> image;
image.resize((mfile->size)-(nullssize-1)-startaddr);
for (int x=0,y=startaddr; y<(mfile->size)-(nullssize-1); x++,y++) {
for (uint64_t x=0,y=startaddr; y<(mfile->size)-(nullssize-1); x++,y++) {
image[x]=(unsigned char)*(mfile->buffer+y);
}
std::stringstream builder;
Expand Down

0 comments on commit 2a37ff3

Please sign in to comment.