Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion configfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ int getcolors(tOutput* output,char* line)
int readconfigfile(tOutput* output,char* filename)
{
tFptr f=fopen(filename,"rb");
unsigned char line[512];
char line[512];
unsigned char c;
int lineidx=0;
int keyboardcnt;
Expand Down
6 changes: 2 additions & 4 deletions correlation.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ void find_longestmatch(tOutput* output,tCorrelation* correlation,tBuffer* buf1,t
mvwprintw(output->win,offsy+1,offsx+1,"pos1:");
mvwprintw(output->win,offsy+4,offsx+1,"longest match:");
mvwprintw(output->win,offsy+5,offsx+1,"at");
if (smallwin) mvwprintw(smallwin,4,1,"%18lli",0);
if (smallwin) mvwprintw(smallwin,4,1,"%18i",0);
wrefresh(output->win);
}

Expand Down Expand Up @@ -115,7 +115,7 @@ void find_bestmatch(tOutput* output,tCorrelation* correlation,tBuffer* buf1,tBuf
mvwprintw(output->win,offsy+1,offsx+1,"pos1:");
mvwprintw(output->win,offsy+4,offsx+1,"best match:");
mvwprintw(output->win,offsy+5,offsx+1,"at");
if (smallwin) mvwprintw(smallwin,4,1,"%18lli",0);
if (smallwin) mvwprintw(smallwin,4,1,"%18i",0);
wrefresh(output->win);
}

Expand Down Expand Up @@ -178,7 +178,6 @@ void find_mindiff(tOutput* output,tCorrelation* correlation,tBuffer* buf1,tBuffe
WINDOW* smallwin=NULL;
tBuffer* smallbuf;
tBuffer* bigbuf;
tInt64 match;
tBool found=0;


Expand Down Expand Up @@ -207,7 +206,6 @@ void find_mindiff(tOutput* output,tCorrelation* correlation,tBuffer* buf1,tBuffe
for (pos1=-(tInt64)smallbuf->bufsize;pos1<(tInt64)bigbuf->bufsize && correlation->mindiff;pos1++)
{
diff=0;
match=0;
if (smallwin) mvwprintw(smallwin,1,3,"%16lli",((tInt64)bigbuf->bufsize-pos1));
else fprintf(stderr,"%16lli\r",((tInt64)buf1->bufsize-pos1));

Expand Down
2 changes: 1 addition & 1 deletion datatypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ typedef struct _tCorrelation
{
tBool correlated;
corr_algorithms algorithm;
tInt64 start_mindiff;
tUInt64 start_mindiff;
tInt64 mindiff;
tInt64 mindiffpos;
tInt64 bestmatch;
Expand Down
4 changes: 2 additions & 2 deletions hexcalc.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ void hexcalc(tOutput* output,thHexCalc* hHexCalc)
setcolor(output,(field==FIELDBIN && cursorline==i)?COLOR_INPUT:COLOR_TEXT);
for (j=0;j<32;j++)
{
if (x || !j) mvwprintw(output->win,offsy+18-i,offsx+76-j,"%i",(x&1));
if (x || !j) mvwprintw(output->win,offsy+18-i,offsx+76-j,"%lli",(x&1));
else mvwprintw(output->win,offsy+18-i,offsx+76-j," ");
x>>=1;
}
Expand All @@ -96,7 +96,7 @@ void hexcalc(tOutput* output,thHexCalc* hHexCalc)
setcolor(output,(field==FIELDBIN && cursorline==-1)?COLOR_INPUT:COLOR_TEXT);
for (j=0;j<32;j++)
{
if (x || !j) mvwprintw(output->win,offsy+19,offsx+76-j,"%i",(x&1));
if (x || !j) mvwprintw(output->win,offsy+19,offsx+76-j,"%lli",(x&1));
else mvwprintw(output->win,offsy+19,offsx+76-j," ");
x>>=1;
}
Expand Down
2 changes: 0 additions & 2 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ int parsecommandlineoptions(int argc,char** argv,tInt64* baseaddr1,tInt64* basea
case 's':
{
tInt8 stringtype=0; // 0=unknown, 1=ascii, 2=hex
tBool forward=1;
tSearch* search;
tBool* gosearch;
int j;
Expand All @@ -225,7 +224,6 @@ int parsecommandlineoptions(int argc,char** argv,tInt64* baseaddr1,tInt64* basea
{
if (lastopt[j]=='a' || lastopt[j]=='A') stringtype=1;
if (lastopt[j]=='h' || lastopt[j]=='H') stringtype=2;
if (lastopt[j]=='b' || lastopt[j]=='B') forward=0;
if (lastopt[j]=='1')
{
search=search1;
Expand Down
4 changes: 2 additions & 2 deletions markers.c
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ int writemarkerfile(tMarkers* markers,char* filename)
fclose(f);
return RETOK;
}
tInt8 gotomask(tOutput* output,tMarkers* markers,tUInt64* cursorpos,tInt64 baseaddr)
tInt8 gotomask(tOutput* output,tMarkers* markers,tInt64* cursorpos,tInt64 baseaddr)
{
tUInt64 actcursorpos=*cursorpos+baseaddr;
tUInt64 newcursorpos=*cursorpos+baseaddr;
Expand Down Expand Up @@ -168,7 +168,7 @@ tInt8 gotomask(tOutput* output,tMarkers* markers,tUInt64* cursorpos,tInt64 basea

snprintf(buf,17,"%c%llx",markers->relative[i],markers->cursorpos[i]);
mvwprintw(output->win,offsy+5+i,offsx+32-strlen(buf),"%s",buf);
mvwprintw(output->win,offsy+5+i,offsx+42,"%16llx",abs(markers->cursorpos[i]-actcursorpos));
mvwprintw(output->win,offsy+5+i,offsx+42,"%16x",abs(markers->cursorpos[i]-actcursorpos));
}
setcolor(output,COLOR_TEXT);
mvwprintw(output->win,offsy+3,offsx+9,"%17llx",newcursorpos);
Expand Down
2 changes: 1 addition & 1 deletion markers.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

void* initmarkers();
int parsemarkerfile(tMarkers* markers,char* filename);
tInt8 gotomask(tOutput* output,tMarkers* markers,tUInt64* cursorpos,tInt64 baseaddr);
tInt8 gotomask(tOutput* output,tMarkers* markers,tInt64* cursorpos,tInt64 baseaddr);


#endif
Expand Down
4 changes: 1 addition & 3 deletions menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,6 @@ tInt8 MenuInteract(tOutput* output,tMenu* Menu,tInt16 offsy,tInt16 offsx)
{
tInt16 ch;
int i;
tInt8 retval;

ch=0;
printMenu(output,Menu,offsy,offsx);
while (ch!=KEYENTER)
Expand All @@ -233,7 +231,7 @@ tInt8 MenuInteract(tOutput* output,tMenu* Menu,tInt16 offsy,tInt16 offsx)
case KEYUP: MenuMoveUp(Menu); break;
case KEYDOWN: MenuMoveDown(Menu); break;
case KEYTAB: Menu->menuitemactive=(Menu->menuitemactive+1)%Menu->menuitemnum;break;
case KEYENTER: retval=Menu->menuitemactive; break;
case KEYENTER: break;
default:
if (ch>=' ' && ch<127)
{
Expand Down
28 changes: 12 additions & 16 deletions output.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ void printbuffersingle(tOutput* output,tBuffer* hBuf1,tInt64 cursorpos1,tUInt64
int addrwidth;
int bytesperline;
tInt32 intpos1;
tInt32 charcnt;



Expand Down Expand Up @@ -120,13 +119,12 @@ void printbuffersingle(tOutput* output,tBuffer* hBuf1,tInt64 cursorpos1,tUInt64
intpos1=getbufferidx(hBuf1,firstpos1);
if (intpos1>=0)
{
charcnt=0;
for (i=0;i<LINES-2;i++)
{
tBool colhex;
setcolor(output,COLOR_HEXFIELD);
if (addrwidth==8) mvwprintw(output->win,i+1,0, "% 8X ",(tUInt32)(firstpos1+hBuf1->baseaddr));
else mvwprintw(output->win,i+1,0,"% 16llX ",firstpos1+hBuf1->baseaddr);
if (addrwidth==8) mvwprintw(output->win,i+1,0, "%8X ",(tUInt32)(firstpos1+hBuf1->baseaddr));
else mvwprintw(output->win,i+1,0,"%16llX ",firstpos1+hBuf1->baseaddr);

mvwprintw(output->win,i+1,COLS-bytesperline-5," ");
wmove(output->win,i+1,addrwidth+3);
Expand Down Expand Up @@ -206,7 +204,6 @@ void printbufferdiff(tOutput* output,tBuffer* hBuf1,tBuffer* hBuf2,tInt64 cursor
tInt32 intpos1b;
tInt32 intpos2;
tInt32 intpos2b;
tInt32 charcnt;
uicolors oldcolor;


Expand Down Expand Up @@ -243,10 +240,10 @@ void printbufferdiff(tOutput* output,tBuffer* hBuf1,tBuffer* hBuf2,tInt64 cursor
mvwprintw(output->win,0,1,"[ / ]");
mvwprintw(output->win,LINES/2,1,"[ / ]");
setcolor(output,COLOR_TEXT);
mvwprintw(output->win,0,2,"%8X",(tUInt32)cursorpos1+hBuf1->baseaddr);
mvwprintw(output->win,0,11,"%8X",(tUInt32)hBuf1->bufsize+hBuf1->baseaddr);
mvwprintw(output->win,LINES/2,2,"%8X",(tUInt32)cursorpos2+hBuf2->baseaddr);
mvwprintw(output->win,LINES/2,11,"%8X",(tUInt32)hBuf2->bufsize+hBuf2->baseaddr);
mvwprintw(output->win,0,2,"%8llX",(tUInt32)cursorpos1+hBuf1->baseaddr);
mvwprintw(output->win,0,11,"%8llX",(tUInt32)hBuf1->bufsize+hBuf1->baseaddr);
mvwprintw(output->win,LINES/2,2,"%8llX",(tUInt32)cursorpos2+hBuf2->baseaddr);
mvwprintw(output->win,LINES/2,11,"%8llX",(tUInt32)hBuf2->bufsize+hBuf2->baseaddr);
}
setcolor(output,COLOR_HEADER);
mvwprintw(output->win,0,COLS-2-strlen(hBuf1->filename),"%s",hBuf1->filename);
Expand All @@ -267,15 +264,14 @@ void printbufferdiff(tOutput* output,tBuffer* hBuf1,tBuffer* hBuf2,tInt64 cursor
}
if (intpos1>=0 || intpos2>=0)
{
charcnt=0;
intpos1b=intpos1;
intpos2b=intpos2;

for (i=0;i<(LINES+1)/2-2;i++)
{
setcolor(output,COLOR_HEXFIELD);
if (addrwidth==8) mvwprintw(output->win,i+1,0, "% 8X ",(tUInt32)(cursorpos1+hBuf1->baseaddr));
else mvwprintw(output->win,i+1,0,"% 16llX ",cursorpos1+hBuf1->baseaddr);
if (addrwidth==8) mvwprintw(output->win,i+1,0, "%8X ",(tUInt32)(cursorpos1+hBuf1->baseaddr));
else mvwprintw(output->win,i+1,0,"%16llX ",cursorpos1+hBuf1->baseaddr);

mvwprintw(output->win,i+1,COLS-bytesperline-5," ");
oldcolor=COLOR_HEXFIELD;
Expand Down Expand Up @@ -346,8 +342,8 @@ void printbufferdiff(tOutput* output,tBuffer* hBuf1,tBuffer* hBuf2,tInt64 cursor
for (i=0;i<(LINES+1)/2-2;i++)
{
setcolor(output,COLOR_HEXFIELD);
if (addrwidth==8) mvwprintw(output->win,i+1+LINES/2,0, "% 8X ",(tUInt32)(cursorpos2+hBuf2->baseaddr));
else mvwprintw(output->win,i+1+LINES/2,0,"% 16llX ",cursorpos2+hBuf2->baseaddr);
if (addrwidth==8) mvwprintw(output->win,i+1+LINES/2,0, "%8X ",(tUInt32)(cursorpos2+hBuf2->baseaddr));
else mvwprintw(output->win,i+1+LINES/2,0,"%16llX ",cursorpos2+hBuf2->baseaddr);

mvwprintw(output->win,i+1+LINES/2,COLS-bytesperline-5," ");
oldcolor=COLOR_HEXFIELD;
Expand Down Expand Up @@ -411,7 +407,7 @@ void printmainmenu(tOutput* output,tBool diffmode)
{
int i;
int x;
unsigned char* menutextsnodiff[]={
char* menutextsnodiff[]={
"Goto ", // F1
"Search", // F2
"Next ", // F3
Expand All @@ -423,7 +419,7 @@ void printmainmenu(tOutput* output,tBool diffmode)
"Undo ", // F9
"Quit "}; // F10

unsigned char* menutextsdiff[]={
char* menutextsdiff[]={
" ", // F1
" ", // F2
"Next ", // F3
Expand Down
5 changes: 1 addition & 4 deletions search.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ void clearsearch(tSearch* search)
memset(search,0,sizeof(tSearch));
search->forwardnotbackward=1;
}
tInt8 searchfor(tSearch* search,tBuffer* buf,tUInt64* cursorpos,tBool nextnotprev)
tInt8 searchfor(tSearch* search,tBuffer* buf,tInt64* cursorpos,tBool nextnotprev)
{
tInt64 actcursorpos=*cursorpos;
tInt64 oldcursorpos=*cursorpos;
Expand Down Expand Up @@ -77,10 +77,7 @@ tInt8 searchfor(tSearch* search,tBuffer* buf,tUInt64* cursorpos,tBool nextnotpre
// state 2: read until the end of the line
tUInt64 x=0;
tBool havenum;
tInt64 firstsearchlogpos;

firstsearchlogpos=search->lastsearchlogpos;

setfilepos(frlog,search->lastsearchlogpos);
havenum=0;
while (!done && !havenum)
Expand Down
2 changes: 1 addition & 1 deletion search.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
#include "datatypes.h"

void clearsearch(tSearch* search);
tInt8 searchfor(tSearch* search,tBuffer* buf,tUInt64* cursorpos,tBool nextnotprev);
tInt8 searchfor(tSearch* search,tBuffer* buf,tInt64* cursorpos,tBool nextnotprev);

#endif
2 changes: 1 addition & 1 deletion ui.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "search.h"
#include "correlation.h"

void searchmask(tOutput* output,tSearch* search,tBuffer* buf,tUInt64* cursorpos)
void searchmask(tOutput* output,tSearch* search,tBuffer* buf,tInt64* cursorpos)
{
tInt8 itemnums[10];
tMenu Menu1;
Expand Down
2 changes: 1 addition & 1 deletion ui.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
#include "search.h"
#include "output.h"
#include "correlation.h"
void searchmask(tOutput* output,tSearch* search,tBuffer* buf,tUInt64* cursorpos);
void searchmask(tOutput* output,tSearch* search,tBuffer* buf,tInt64* cursorpos);
tInt8 savedialog(tOutput* output,tBuffer* buf);
tInt8 correlationmask(tOutput* output,tCorrelation* correlation);
#endif