madsen / vbindiff Goto Github PK
View Code? Open in Web Editor NEWVisual Binary Diff (VBinDiff) displays files in hex & ASCII and can highlight the differences between 2 files
Visual Binary Diff (VBinDiff) displays files in hex & ASCII and can highlight the differences between 2 files
vbindiff segfaults when comparing a file of non-zero size to a file of zero size. While obviously a ridiculous thing to do, I just happened to attempt it by accident after a file transfer failed, leaving me with an empty file.
I've reproduced this @ 57868ac. Unless someone beats me to it, I'll try to be a good neighbor and track this down, updating this issue with more information or a patch. (I might get a chance to look at it Thur/Fri this week....)
Works:
$ dd if=/dev/urandom of=test1.bin count=2
$ dd if=/dev/urandom of=test2.bin count=2
$ vbindiff test1.bin test2.bin
Failure, Segfault
$ rm test2.bin
$ touch test2.bin
$ vbindiff test1.bin test2.bin
FWIW, it appears that things eventually grind to a halt in ConWindow::putAttribs, originating the file2.display() in vbindiff.c.
Program received signal SIGSEGV, Segmentation fault.
ConWindow::putAttribs (this=0x200000000060a728, x=11, y=1, color=cFileDiff, count=2) at curses/ConWin.cpp:200
200 mvwchgat(win, y, x, count, attribStyle[color], colorStyle[color], NULL);
(gdb) bt
#0 ConWindow::putAttribs (this=0x200000000060a728, x=11, y=1, color=cFileDiff, count=2) at curses/ConWin.cpp:200
#1 0x0000000000402f51 in FileDisplay::display (this=this@entry=0x60a600 <file2>) at vbindiff.cpp:497
#2 0x0000000000402568 in main (argc=3, argv=0x7fffffffe498) at vbindiff.cpp:1863
Note that ''this'' looks a little clobbered here, in an interesting way. (Saw a few sprintf's on the way down the call stack...is that a space character that got written over that pointer?)
I'm hoping to take a closer look soon...while I was tempted to suggest a band-aid patch with a quick size check and error message, I think I'll mull it over to see if there's something a little...cleaner?
The last commits were 2017, is fork project still supported or abandoned?
$ ./VBinDiff.exe ./x0 ./x
VBinDiff 3.0_beta5, Copyright 1995-2017 Christopher J. Madsen
VBinDiff comes with ABSOLUTELY NO WARRANTY; for details type `vbindiff -L'.
VBinDiff.exe: Unable to initialize windows
Vbindiff segfaults when displaying the last line of a file.
Vbindiff 3.0 beta 4, built from source with cygwin tools
running on cygwin 2.873 over win8.1
_jean-louis
ps. big thanks for vbindiff Mr Madsen
Some change in recent beta versions (or maybe a library in the middle?) broke my workflow.
This might sound like a "spacebar heating" issue, but I use this program a lot while debugging why two binaries don't match, and up until now, I've been able to press the arrow keys to have the view be "refreshed" with new contents of the loaded file(s). Having to close and re-open the program to see the updated diff is a major pain.
For some reason this isn't working now, so I'd like to request an explicit feature: Have a shortcut to refresh the files.
Yes, this is a consequence of using the Windows ANSI API instead of the wide-character version. I don't really do much Windows programming, and I've never done any I18N work on Windows. I'm not sure how much work it would be to convert VBinDiff to the W API. I'd be interested in a patch if somebody wants to try.
The workaround is to rename the file so it can be represented in the selected codepage.
Originally posted by @madsen in #20 (comment)
Hi.
I was trying to compile vbindiff in OpenSUSE but It was failing all the time since #include <panel.h> was not founded.
I solve it by just modifing the AM_CPPFLAGS by adding: -I/usr/include/ncurses:
AM_CPPFLAGS = -I$(srcdir)/curses -I/usr/include/ncurses
on Makefile.
Cheers :)
To reproduce:
$ dd if=/dev/urandom of=rand1024 bs=1 count=1024
$ dd if=/dev/urandom of=rand1025 bs=1 count=1025
$ dd if=/dev/urandom of=rand1026 bs=1 count=1026
$ vbindiff rand1025 rand1026
Scroll to end of file -> OK
$ vbindiff rand1024 rand1026
Scroll to end of file -> Crash
File sizes of 2048 and 4096 bytes crash, too.
Tested with
VBinDiff 3.0_beta4
Copyright 1995-2008 Christopher J. Madsen
and
VBinDiff 3.0_beta5
Copyright 1995-2008 Christopher J. Madsen
Appears messagebox: VBinDiff.exe is not win32 app.
I download it today from your site.
It returns an error message with them replaced by question marks:
λ "VBinDiff.exe" "CU-25 IC test.xls" "CU-25 IC 测试.xls"
VBinDiff 3.0_beta5, Copyright 1995-2017 Christopher J. Madsen
VBinDiff comes with ABSOLUTELY NO WARRANTY; for details type `vbindiff -L'.
Unable to open CU-25 IC ??.xls: The filename, directory name, or volume label syntax is
incorrect.
Thank you for a great app! Would be awesome to have a -w tag that would allow specifying the width/number of columns. Thank you.
Introducing: vbl - VBindiff for Linux
Alive and kicking!
... I originally just wanted to add the backwards search.
Vbindiff crashes when comparing some files.
lsb_release -a
shows:
[...]
Ubuntu 14.04.2 LTS
[...]
vbindiff --version
shows:
VBinDiff 3.0_beta4
Copyright 1995-2008 Christopher J. Madsen
Execute:
wget https://cloud.githubusercontent.com/assets/2103153/8145148/24394c2a-11fc-11e5-95f9-115ba65c96df.png
wget https://cloud.githubusercontent.com/assets/2103153/8145146/13179848-11fc-11e5-8d0e-d183d183a417.png
vbindiff *.png
Press the End key, press Enter. See the crash of Vbindiff.
It also happens if the user presses the B key instead of the End key. Sometimes pressing the Enter key is not necessary to experiment the crash.
:-) Thank you for Vbindiff!
vbindiff
you have some leisure time?
One more thing:
vbl 3 is coming soon.
@madsen Can you please merge those past PR's? I love this tool and use it very often...
Also, would you have any experience on how well it works on a Linux based system? It's not very clear from your README how to do that. Finally, do you think it's possible to port this to Android?
It would be nice if there was an option for horizontal layout, with one file on the left, the other on the right side. This makes sense because most displays are wide instead of high.
Currently the right side of the screen is black and unused.
(basically like binwalk -W file1 file2 | less -R
, but more efficient)
just for the case it is not known:
vbindiff.cpp: In member function ‘void FileDisplay::setByte(short int, short int, Byte)’:
vbindiff.cpp:635:6: warning: ‘%02X’ directive writing between 2 and 8 bytes into a region of size 3 [-Wformat-overflow=]
void FileDisplay::setByte(short x, short y, Byte b)
^~~~~~~~~~~
vbindiff.cpp:635:6: note: directive argument in the range [0, 2147483647]
vbindiff.cpp:659:12: note: ‘sprintf’ output between 3 and 9 bytes into a destination of size 3
sprintf(str, "%02X", b);
I get this error message when trying to run VBinDiff.exe, either through the command line or from Windows. The program version is VBinDiff 3.0 beta 5.
I'm aware of enter and space navigating to the next difference.
I'm interested in navigation to the previous difference.
I maintain vbindiff for Mageia and have just been alerted to this bug report:
https://bugs.mageia.org/show_bug.cgi?id=26780
I am suspecting that it is maybe 6 months old as it is affecting our current stable release and the development branch.
ncurses in Mga7 is ncurses-6.1-20181117.3.1.mga7 which was a snapshot on 17 Nov 2018.
Building locally in Mga7 using current upstream git master clone (manual build and run from build tree without packaging) produces a similar segfault:
Program received signal SIGSEGV, Segmentation fault. 0x00007ffff7f867a4 in wresize (win=<optimized out>, ToLines=2, ToCols=31, ToCols@entry=32) at ../../ncurses/base/wresize.c:161 161 if (s == 0) (gdb) bt #0 0x00007ffff7f867a4 in wresize (win=<optimized out>, ToLines=2, ToCols=31, ToCols@entry=32) at ../../ncurses/base/wresize.c:161 #1 0x0000000000407ed5 in ConWindow::resize (this=this@entry=0x40d860 <inWin>, width=width@entry=32, height=height@entry=3) at curses/ConWin.cpp:239 #2 0x000000000040500a in positionInWin (cmd=cmd@entry=19 '\023', width=width@entry=32, title=title@entry=0x409619 " Find ") at vbindiff.cpp:1280 #3 0x0000000000406dd1 in searchFiles (cmd=19 '\023') at vbindiff.cpp:1635 #4 0x0000000000407237 in handleCmd (cmd=<optimized out>) at vbindiff.cpp:1676 #5 0x0000000000403878 in main (argc=<optimized out>, argv=<optimized out>) at vbindiff.cpp:1868
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.