seccomp-tools icon indicating copy to clipboard operation
seccomp-tools copied to clipboard

Support dumping/disassembling to an input format accepted by `seccomp-tools asm`

Open gsingh93 opened this issue 3 years ago • 1 comments

Right now this is possible:

seccomp-tools asm filter.asm -f raw | seccomp-tools disasm -

But as far as I can tell, this is not:

seccomp-tools disasm filter.bin -f <format-name> | seccomp-tools asm -

Can we support disasm and dump outputting in a format accepted by asm? Or have asm accept the format output by dump and disasm.

gsingh93 avatar Sep 10 '22 20:09 gsingh93

Sounds a good suggestion. The original intention of dump/disasm is making them human readable, but as we also support different format of output, it makes sense to have a certain format is acceptable by asm.

david942j avatar Sep 16 '22 03:09 david942j

I somehow decided to re-write the whole assembly parser so it will take a longer time. A WIP is at the racc branch: https://github.com/david942j/seccomp-tools/compare/racc?expand=1

david942j avatar Oct 03 '22 17:10 david942j

Hi @gsingh93 , I have a PR https://github.com/david942j/seccomp-tools/pull/210 which adds the support of passing --no-bpf to disasm, and the output format in this case is a valid format for seccomp-tools asm.

You can see READMD.md in the PR for more details. Let me know whether the usage matches your expectations.

david942j avatar Oct 08 '22 17:10 david942j

Thanks! I haven't tested it yet, but based on the README it looks good.

gsingh93 avatar Oct 08 '22 17:10 gsingh93

Thanks! I will continue to merge it then.

david942j avatar Oct 09 '22 09:10 david942j