summaryrefslogtreecommitdiff
path: root/H64E-2/main.c
diff options
context:
space:
mode:
authorsystemcoder <systemcoder@protonmail.com>2020-03-19 20:13:02 +0000
committersystemcoder <systemcoder@protonmail.com>2020-03-19 20:13:02 +0000
commit69969bb875a95ae7e0913d83c821539e62accba2 (patch)
treeb82947efa6ffe3124f18a3d057fa1f91e8d82eb2 /H64E-2/main.c
parente1e7859ef4b3353a8ac182fd456b053c653239d1 (diff)
downloadH64D-2-69969bb875a95ae7e0913d83c821539e62accba2.tar.gz
H64D-2-69969bb875a95ae7e0913d83c821539e62accba2.zip
Added single function that will be able to manage all output
Diffstat (limited to 'H64E-2/main.c')
-rw-r--r--H64E-2/main.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/H64E-2/main.c b/H64E-2/main.c
index 818f165..29184b7 100644
--- a/H64E-2/main.c
+++ b/H64E-2/main.c
@@ -140,10 +140,12 @@ void helper( char *progname )
" -o - file offset\n"
" -i - output hex\n"
" -l - length of output\n"
- " -c - column size in byts\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"
- "\nVersion: 2.0.0 \n"
+ " -e - interp data: u8,i8,u16,i16,u32,i32,u64,i64\n"
+ " -s - disable space between columns\n"
+ " -t - extra output ascii output\n"
+ "Version: 2.0.2 \n"
"\n"
, progname);
}
@@ -194,18 +196,20 @@ int main(int argc, const char * argv[]) {
{
case 'a':
h64e.fmt.group = H64E_G_BYTE;
- h64e.fmt.flag_output = 1;
+ h64e.fmt.flag_output_types = 1;
h64e.fmt.output_type = H64E_O_STRING;
break;
case 'b':
h64e.fmt.flag_offset = 1;
break;
case 'o':
- param_offset = atoi( optarg );
+ //param_offset = atoi( optarg );
+ h64e.fmt.flag_offset = 1;
+ h64e.fmt.offset_addr = atoi(optarg);
break;
case 'i':
h64e.fmt.group = H64E_G_BYTE;
- h64e.fmt.flag_output = 0;
+ h64e.fmt.flag_output_types = 0;
h64e.fmt.flag_offset = 1;
break;
case 'l':
@@ -218,12 +222,15 @@ int main(int argc, const char * argv[]) {
h64e.fmt.group = group_name2int(optarg);
break;
case 'e':
- h64e.fmt.flag_output = 1;
+ h64e.fmt.flag_output_types = 1;
h64e.fmt.output_type = output_name2int(optarg);
break;
case 's':
h64e.fmt.flag_space = 1;
break;
+ case 't':
+ h64e.fmt.flag_ascii = 1;
+ break;
case 'v':
version();
exit(1);
@@ -263,6 +270,8 @@ int main(int argc, const char * argv[]) {
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;
@@ -342,7 +351,8 @@ int main(int argc, const char * argv[]) {
//deinit all structures
h64e_destroy(&h64e);
file_close(fd);
-
- printf("Ending Execution\n");
+
+ printf("\nEnding Execution\n");
+
return 0;
}