added readme

This commit is contained in:
Solomon W. 2020-06-21 11:57:21 -04:00
parent 37265430dc
commit 1551612a6b
3 changed files with 19 additions and 3 deletions

16
README.md Normal file
View File

@ -0,0 +1,16 @@
# ViewBin
This really is just a slightly prettier version of hexdump. There isn't much to say about it.
![demo](./demo.gif)
## Building
### Linux
On Linux you can clone the repository and just run `make` inside the cloned directory. No dependencies, only a compiler and Gnu Make.
### Windows
The Makefile may, or may not work on windows, I'm not sure.
If it doesn't there are no dependencies. You can just run it through a compiler.

BIN
demo.gif Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

View File

@ -104,7 +104,7 @@ int main(int argc, char **argv) {
fread(text,sizeof(char),length,file); fread(text,sizeof(char),length,file);
int i=0,byte_index=0,bytes_shown=0; int i=0,byte_index=0,bytes_shown=0;
while(i < lines) { while(i < lines) {
printf("\033[33m[%08x]>\033[39m ",byte_index); printf("\033[32m[%08x]>\033[39m ",byte_index);
int a=0; int a=0;
bytes_shown=0; bytes_shown=0;
while(a<max_per_row) { while(a<max_per_row) {
@ -147,9 +147,9 @@ int main(int argc, char **argv) {
i++; i++;
} }
if((12+(bytes_shown*chunk_size)+11) < width) { if((12+(bytes_shown*chunk_size)+11) < width) {
printf("\033[33m<[%08x]\033[39m",byte_index); printf("\033[32m<[%08x]\033[39m",byte_index);
} else { } else {
printf("\n\033[33m<[%08x]\033[39m",byte_index); printf("\n\033[32m<[%08x]\033[39m",byte_index);
} }
free((void *)original); free((void *)original);
return 0; return 0;