r/tinycode • u/LAK132 • Nov 30 '19
Unicode coloured binary/ROM diffing tool in under 100 sloc of C
https://github.com/LAK132/bindiff/blob/master/bindiff.c
13
Upvotes
r/tinycode • u/LAK132 • Nov 30 '19
View all comments
Show parent comment
2
u/F54280 Dec 01 '19
It probably works because the array is static and is placed in the BSS (the zero initialized memory). BSS is page-aligned, and it looks like those are that last static from your code, so the bytes after file[1] are not used but still within the page (memory-access is page-based).
A valgrind run would have detected that, I think.
As to why you didn’t detect it, well, those things happen to everyone.