Solution:
Adding some configuration in the ~/.vimrc will make everything peace and clean:)
" vim -b : edit binary using xxd-format!
augroup Binary
au!
au BufReadPre *.bin let &bin=1
au BufReadPost *.bin if &bin | %!xxd
au BufReadPost *.bin set ft=xxd | endif
au BufWritePre *.bin if &bin | %!xxd -r
au BufWritePre *.bin endif
au BufWritePost *.bin if &bin | %!xxd
au BufWritePost *.bin set nomod | endif
augroup END
Note that this configuration only works with the file with .bin extension, which is already enough for me to hack into the targeting files:) Check the reference #1 for further reading of more general hex file editing.
cheers:)
References:
1) Improve hex editing
2) Vim commands cheat sheet

No comments:
Post a Comment