Skip to content

Commit

Permalink
pre-release tidying and commenting
Browse files Browse the repository at this point in the history
  • Loading branch information
candicenonsense committed Aug 16, 2015
1 parent b6b476f commit 2c3403a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 23 deletions.
19 changes: 1 addition & 18 deletions error.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/**
* error.c: Generic error/debug routines
* author: Vassil Roussev
* from sdhash -- sdhash.org
*/

#include <errno.h>
Expand Down Expand Up @@ -46,21 +47,3 @@ void *realloc_check( void *buffer, uint64_t new_size) {
return mem_chunk;
}

/**
* Print a 256-byte buffer
*/
void print256( const uint8_t *buffer) {
uint16_t i;
fprintf( stderr, " ");
for( i=0; i<32; i++)
fprintf( stderr, "%02x ", i);
fprintf( stderr, "\n");

for( i=0; i<256; i++) {
if( i % 32 == 0)
fprintf( stderr, "%04x: ", i);
fprintf( stderr, "%02x ", buffer[i]);
if( i % 32 == 31)
fprintf( stderr, "\n");
}
}
4 changes: 4 additions & 0 deletions map_file.cc
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/**
sdhash file processing code via sdhash.org under apache license
lightly modified by @candicenonsense
*/
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
Expand Down
8 changes: 4 additions & 4 deletions nullfinder.cc
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

/** File: nullfinder.cc
Author: Candice Quates
Program: gpunullfinder
Program: nullfinder
Takes argument of a file of dumped gpu memory, attempts to divine structure
by searching for blocks of nulls which have been added for padding.
Default block of nulls to search for is 8. extracting is only working
for 8-null blocks. Not reporting really really short (1-2 byte blocks)
Default block of nulls to search for is 8. Much larger blocks are
sometimes helpful
File parsing code lifted from sdhash, apache license (Roussev/Quates 2013)
General structure and command line arguments lifted from zsniff. (apache license)
Expand All @@ -26,7 +26,7 @@ g++ -std=c++0x -o nullf nullfinder.cc map_file.cc error.cc



#define VERSION "nullfind 0.2 by Candice Quates July 2015"
#define VERSION "nullfinder 0.2 by Candice Quates July 2015"


#include "util.h"
Expand Down
6 changes: 5 additions & 1 deletion util.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
/**
utilities file from sdhash, used for file reading,
under apache license sdhash.org
*/

/*
* General definitions (Vassil Roussev)
*/
Expand Down Expand Up @@ -29,7 +34,6 @@ typedef struct {

processed_file_t *process_file(const char *fname);

void print256( const uint8_t *buffer);
void *alloc_check( uint32_t alloc_type, uint64_t mem_bytes, const char *fun_name, const char *var_name, uint32_t error_action);
void *realloc_check( void *buffer, uint64_t new_size);

Expand Down

0 comments on commit 2c3403a

Please sign in to comment.