Comments (4)
Hey, Raafat, I ran into the same issue and investigate a bit to see what's wrong.
It seems the conversion with HexDump
inserts random bytes into the dump file, which obviously breaks the binary file when writing the buffer back to disk with HexAssemble
.
This happens for both manual conversion and automatic one (i.e. ReadBuf
and WriteBuf
).
Using the same xxd
commands manually in a terminal works without problems.
Converting a binary file to a hexdump in nvim also works directly in ExecMode (%! xxd -g 1 -u <file>
).
NVim version used with LinuxMint 20.1.
NVIM v0.10.0-dev-289+gfa1baa9a4
Build type: Release
LuaJIT 2.1.0-beta3
I attached two screenshots below to show the output side by side (left: regular dump, right: HexDump).
The first image shows the differing sizes (hex offset at the bottom).
The second highlights the first line where random bytes got inserted.
I hope this helps.
from hex.nvim.
Writing the buffer triggers a binary "rebuild" from the hex dump using xxd.
- Are you sure your
xxd
is properly working? (try using it to dump and revert a binary file)? - Does this occur with other file types such as a png file?
from hex.nvim.
I did some tests to find if there was any discrepancies.
The issue persists on WSL and on bare metal pop_OS, both with minimal config.
However, so far I can only reproduce the issue when my CWD is ~/.config/nvim
.
If I do the same exact steps somewhere else like a /tmp
folder, the issue doesn't occur.
When writing the dump buffer the "Hello, World!" string get shifted ~20 lines downward, resulting in the exec format error.
from hex.nvim.
Are you sure your xxd is properly working? (try using it to dump and revert a binary file)?
I can't be sure, I'm not too familiar with the program.
Does this occur with other file types such as a png file?
I did test a image file located at ~/Downloads/image.jpg
without issue.
I'm not sure if you or someone else could reproduce but it seems like some obscure behaviour that the rebuilding would not work in neovim config directory.
cd ~/.config/nvim
nvim -u minimal_config.lua
# Write hello.c
$ gcc hello.c
$ ./a.out
Hello, World!
# Modify "Hello, World!" and write hex
$ ./a.out
exec format error: ./a.out
from hex.nvim.
Related Issues (16)
- media issue
- wierd string at first load HOT 2
- Hex breaks Oil HOT 1
- not seem to work HOT 5
- Not an editor command: LspStop HOT 5
- Add install inscructions for vim plugged HOT 2
- Trouble opening windows executables HOT 6
- vim.lsp.buf.server_ready is deprecated :help deprecated This feature will be removed in Nvim version 0.10.0 HOT 1
- Disable automatic detection for certain filetypes HOT 3
- DAP UI integration? HOT 5
- Error detected | using Blob as a String HOT 1
- Confusing editor behavior HOT 5
- Binary Executable breaks on Write Back HOT 3
- disabling or overriding is_buf_binary_pre_read() HOT 3
- Invalid plugin spec HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hex.nvim.