fudgepop01 / kaitai_ide_vscode Goto Github PK
View Code? Open in Web Editor NEWA VSCode extension built to assist the creation and debugging of kaitai struct files
License: GNU General Public License v3.0
A VSCode extension built to assist the creation and debugging of kaitai struct files
License: GNU General Public License v3.0
Workbench > Editor > Default binary editor
global & project settings.json should contain option with list of directories for searching .ksy files
for automatic binding using file extension (and best-matching header sections in ideal case)
I opened the hex editor, right clicked a file (152 KB), and clicked "open file as hex". The hex editor does not react though, and keeps showing nothing.
Looking at the dev console shows this:
I am running:
Please tell me if I can provide any further useful information :)
Edit: After the context menu option did not work, I tried the same command from the command palette. Only from that did I get a notification saying that the command failed. In both cases, nothing happened in the hex editor though.
Edit 2: This is how the hex editor looks when opening any file:
After that VSCode shows notification window (in the right-bottom notification corner) exception:
An undefined behavior was detected: undefined is not an instance of java.lang.String: undefined is not an instance of java.lang.String trace: null
top 3 lines not visible, but cursor moves to this hidden area
can be fixed with manual changing the number of lines in hex browser settings, but does not detects it automatically by hex editor subwindow size
Outline is specially designed to represent file's structure, so should use it
Using windows 10. The kaitai struct compiler and visualizer were already installed on my system when I installed the vscode extension if that matters. Tried running "compile to target language", "compile and examine ksy", and "open file as hex". None of them work. They all give "command not found" errors.
Have you considered write access to the file, i.e. being able to edit the hex? I realise this can be hard!
When compiling my ksy
file, I get this error in the dev tools:
This surprises me bit since the extension has been using kaitai-struct-compiler
0.9.0 since 68eda7a, and v0.9.0 should support this tag (https://github.com/kaitai-io/kaitai_struct_compiler/blob/master/RELEASE_NOTES.md#09-2020-10-16).
This is inconvenient -- sometimes you want to open a file not from the workspace, but neither the tab menu nor the "Open Editors" menu have any extension menu items.
In any case I suggest to rework how extension is work. Just add one command "Parse with KSY" that will apply to the active buffer. In that command ask what KSY to use. I suggest to show selector (similery to the select command "Ctrl+Shift+P") with variants:
Also add extension setting with KSY associations to the file glob patterns (usually something like "<ksy path>": "*.ext"
). Show this variant as "Configured"
I looked for a license for this repo in all the standard places, but I didn't see one. Can you add a license file? GitHubs docs may help. Thank you.
Makes more sense, and also makes them show up in VSCode's Changelog tab.
You can tag specific commits in your repository with the respective version numbers, create releases from those tags and then attach the vsix file there. You can also include the relevant part of the change log as a description.
(Documentation: https://help.github.com/en/articles/creating-releases)
This way, the repository stays light and only contains the actual source files used to build the .vsix files.
It doesn't seem to support instances
as per https://doc.kaitai.io/user_guide.html#_instances_data_beyond_the_sequence
You can reproduce the issue using microsoft_pe.ksy and trying to visualize any .exe or .dll file.
The instance defined at line 24 doesn't get rendered.
I'm getting the error Error with KS definition: TypeError: Cannot read properties of null (reading 's$1')
with any .ksy file when trying to 'compile and examine ksy' or just 'compile to target language' (I tried ts, js, python)
I tried with the example from the readme below as well as the gif example on [http://kaitai.io]
seq:
- id: no_subregions
type: u4
- id: has_subregions
type: example_type
types:
example_type:
seq:
- id: first_child
type: u4
- id: second_child
type: u2
kaitai struct vscode version v0.9.0
VScode information:
Version: 1.80.1 (user setup)
Commit: 74f6148eb9ea00507ec113ec51c489d6ffb4b771
Date: 2023-07-12T17:22:07.651Z
Electron: 22.3.14
ElectronBuildId: 21893604
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Windows_NT x64 10.0.22621
While working on reverse-engineering a file format, I noticed that the extension sometimes just stops working. After undoing change after change I found out that the issues was a missing case in a type switch, I simply had not implemented the case yet. But the extension never told me that there was an issue with an invalid type. It just stopped working and VSCode reported it hanging after a while.
Is there a way to get proper runtime errors as they would be generated by the Kaitai runtime when parsing a file? At least I assume that you'd get an error for a missing case when parsing a file in your target language? (I haven't gotten that far yet with my file format)
When using binary files that include other binary files, like media/standard_midi_file.ksy which include /common/vlq_base128_be, it fails with an error like:
TypeError: Cannot convert undefined or null to object
at Function.keys ()
at $c_sjs_js_WrappedDictionary$DictionaryIterator.init___sjs_js_Dictionary (c:\Users\per.nerseth\Development\kaitai_ide_vscode\node_modules\kaitai-struct-compiler\kaitai-struct-compiler.js:38435:27)
at
The reason is that the compiler expects imports to be absolute paths and not relative paths.
The only fix I found was to copy the file into the same base path and import it like this:
imports:
- vlq_base128_be
Otherwise the extension seem to work fine !
Hi,
I saw this plugin and wanted to try it out. I really like the concept. I'm having a few problems with this extension.
I created a file called uniquename.ksy
with the contents:
meta:
id: rifx
endian: le
seq:
- id: magic
contents: "RIFX"
- id: container_len
type: s4
First I got errors with uniquename
not defined. Those disappeared while trying to reproduce it for this issue.
Now it will only show magic 'Uint8Array' in the KSExplorer. The container_len won't show up.
What's going on?
Hello. Have you considered publishing this extension on open-vsx.org? This would enable easy use on vscodium, which uses that site instead of the MS extension marketplace by default.
Many thanks for this extension.
at least in background color
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.