Hacker News new | past | comments | ask | show | jobs | submit login

What are line numbers in context of a binary?



Right, I was being a bit loose there. I meant something like how `xxd` displays the number of bytes up to the current output row. Just something to give context of where you are in the file.

    00006980: 0000 0000 0000 0000 0000 0000 0000 0000


You can quickly find position of byte number X using:

line number = floor(X/(bytes/line)) + 1

column offset = X % (bytes/line) + 1

Or it could just print byte numbers instead of line numbers.


Addresses.


File offsets; not addresses :) I assume the tool isn't reading ELF format files and working out the memory address.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: