diff options
Diffstat (limited to 'H64E-2/main.c')
-rw-r--r-- | H64E-2/main.c | 38 |
1 files changed, 26 insertions, 12 deletions
diff --git a/H64E-2/main.c b/H64E-2/main.c index 791cc18..673aa43 100644 --- a/H64E-2/main.c +++ b/H64E-2/main.c @@ -135,16 +135,16 @@ int output_name2int( char *name ) void helper( char *progname ) { printf("Usage: %s [OPTS] <filename>\n\n" - " -a - asciimode\n" + " -a - ascii output\n" " -b - show offset adress\n" " -o - file offset\n" " -i - output hex\n" " -l - length of output\n" " -c - column size in bytes\n" " -g - datatype output: byte,word,dword,qword\n" - " -e - interp data: u8,i8,u16,i16,u32,i32,u64,i64\n" + " -e - interp data output: u8,i8,u16,i16,u32,i32,u64,i64\n" " -s - disable space between columns\n" - " -t - extra output ascii output\n" + " -h - extra hex output\n" "Version: 2.0.2 \n" "\n" , progname); @@ -193,14 +193,15 @@ int main(int argc, const char * argv[]) { //set all params from arguments /*get cmd args and set options */ - while ( (c = getopt(argc, argv, "abo:il:vc:g:e:st")) != -1 ) + while ( (c = getopt(argc, argv, "abo:il:vc:g:e:sh")) != -1 ) { switch(c) { case 'a': - h64e.fmt.group = H64E_G_BYTE; - h64e.fmt.flag_output_types = 1; - h64e.fmt.output_type = H64E_O_STRING; + //h64e.fmt.group = H64E_G_BYTE; + //h64e.fmt.flag_output_types = 1; + //h64e.fmt.output_type = H64E_O_STRING; + h64e.fmt.flag_ascii = 1; break; case 'b': h64e.fmt.flag_offset = 1; @@ -231,8 +232,8 @@ int main(int argc, const char * argv[]) { case 's': h64e.fmt.flag_space = 1; break; - case 't': - h64e.fmt.flag_ascii = 1; + case 'h': + h64e.fmt.flag_hex = 0; break; case 'v': version(); @@ -269,18 +270,22 @@ int main(int argc, const char * argv[]) { //configure format of u8 to terminate on new line and have space between types //printf("Column size set to %d\n",h64e.fmt.column_size); int8_fmt.f_space = !h64e.fmt.flag_space; - printf("h64e.fmt.flag_space %d\n",h64e.fmt.flag_space); + //printf("h64e.fmt.flag_space %d\n",h64e.fmt.flag_space); int8_fmt.f_new_line = 1; int8_fmt.column_size = h64e.fmt.column_size; int8_fmt.group_fmt = h64e.fmt.group; int8_fmt.output_fmt = h64e.fmt.output_type; int8_fmt.f_offset = h64e.fmt.flag_offset; int8_fmt.start_offset = h64e.fmt.offset_addr; + int8_fmt.f_output_types = h64e.fmt.flag_output_types; + int8_fmt.output_fmt = h64e.fmt.output_type; + int8_fmt.f_ascii = h64e.fmt.flag_ascii; + int8_fmt.f_hex = h64e.fmt.flag_hex; //do conversation, reading input and outputing - while ((in_bytes = file_read(fd,(char *)&buf_in,1)) != -1) + while ((in_bytes = file_read(fd,(char *)&buf_in,int8_fmt.column_size)) != -1) { if (in_bytes == 0) { @@ -301,7 +306,6 @@ int main(int argc, const char * argv[]) { cnv_bytes = h64e_si_data_out(&sin, &buf_cnv_in[0], int8_fmt.column_size); //cnv_total += cnv_bytes; - //Convert output data to desired format //printf("Start converting to byte8\n"); switch (h64e.fmt.group) @@ -351,6 +355,16 @@ int main(int argc, const char * argv[]) { } //check and empty all buffers + while (h64e_si_len(&sin)>0) + { + if (h64e_si_len(&sin)>int8_fmt.column_size) { + + } else { + + } + break; + } + //deinit all structures h64e_destroy(&h64e); |