Skip to content

docs: add man pages#267

Merged
athre0z merged 1 commit intozyantific:masterfrom
Tachi107:man
Nov 13, 2021
Merged

docs: add man pages#267
athre0z merged 1 commit intozyantific:masterfrom
Tachi107:man

Conversation

@Tachi107
Copy link
Copy Markdown
Contributor

Zydis ships two command line tools, but doesn't provide any man page. Since Debian enforces that every binary must also provide a man page here I am providing a patch.

Standard UNIX manpages are painful to write, but luckly there are tools like Ronn(-NG) or Pandoc that allow to write the page in simple Markdown and convert it in roff, the format that man uses.

These man pages are extremely basic, since I'm not very familiar with the tools and how they work :/
Please don't hesitate making suggestions :)

Since Ronn-NG is an extra dependency the manpages are not built by default, but only if requested with ZYDIS_BUILD_MAN.

Ronn-NG is required instead of the old Ronn because the latter always generates output files in the same dir as the input files, and that doesn't play nice with CMake and out of tree builds, while the -NG version has a --output-dir option.

@athre0z athre0z added A-doc Area: Documentation C-enhancement Category: Enhancement of existing features P-medium Priority: Medium labels Nov 12, 2021
Copy link
Copy Markdown
Member

@athre0z athre0z left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR! LGTM in general, I left a few minor comments.

Should the files have .ronn extension? Since they seem to be vanilla Markdown, if that works, I think it would make sense to have them end in .md to make GitHub web render them if you view them.

Standard UNIX manpages are painful to write, but luckly there are tools like Ronn(-NG) or Pandoc that allow to write the page in simple Markdown and convert it in roff, the format that man uses.

I just looked up an example and am inclined to agree -- it looks pretty terrible indeed. Good choice to go with a transpiler approach!

These man pages are extremely basic, since I'm not very familiar with the tools and how they work :/

Neither are we, so I guess we'll just merge things and wait for someone with more experience to flame us for all that we did wrong! :)


## SYNOPSIS

`ZydisDisasm -[real|16|32|64] <input file>`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
`ZydisDisasm -[real|16|32|64] <input file>`
`ZydisDisasm -[real|16|32|64] [input file]`

The input file is optional, in which case ZydisDisasm reads from stdin.

Comment on lines +1 to +2
ZydisInfo(1) -- disassemble in your terminal
============================================
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ZydisInfo(1) -- disassemble in your terminal
============================================
ZydisInfo(1) -- detailed instruction information
================================================

I feel like this might be a slightly more accurate description, but I'm also fine with the original one if you don't like it.


## SYNOPSIS

`ZydisInfo -[real|16|32|64] <hexbytes>`
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current syntax is:

ZydisInfo <machine_mode> [stack_width] <hexbytes>
Machine mode:      -real|-16|-32|-64
Stack width:       -16|-32|-64

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these options also apply to ZydisDisasm?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For ZydisDisasm I never implemented the stack-width option if I remember correctly.

Might be a nice addition tho. Will keep that in mind for future improvement.

@Tachi107
Copy link
Copy Markdown
Contributor Author

Should the files have .ronn extension? Since they seem to be vanilla Markdown, if that works, I think it would make sense to have them end in .md to make GitHub web render them if you view them.

Yes, because they aren't actually pure Markdown, it has a few manpage-specific features (like special rendering of <text>). Luckily GitHub renders them anyway

These man pages are extremely basic, since I'm not very familiar with the tools and how they work :/

Neither are we, so I guess we'll just merge things and wait for someone with more experience to flame us for all that we did wrong! :)

Haha, good idea

I'll address your feedback as soon as possible

Zydis ships two command line tools, but doesn't provide any man page.
Since Debian enforces that every binary must also provide a man page
here I am providing a patch.

Standard UNIX manpages are painful to write, but luckly there are tools
like Ronn(-NG) or Pandoc that allow to write the page in simple Markdown
and convert it in roff, the format that `man` uses.

These man pages are extremely basic, since I'm not very familiar with
the tools and how they work :/
Please don't hesitate making suggestions :)

Since Ronn-NG is an extra dependency the manpages are not built by
default, but only if requested with `ZYDIS_BUILD_MAN`.

Ronn-NG is required instead of the old Ronn because the latter always
generates output files in the same dir as the input files, and that
doesn't play nice with CMake and out of tree builds, while the -NG
version has a `--output-dir` option.
@Tachi107
Copy link
Copy Markdown
Contributor Author

Tried to apply your suggestions :)

Please note that this is the first time I "write" manpages, and I'm also not familiar with the terminology used by Zydis (I've never done anything serious with assembly language, unfortunately), so any corrections will always be appreciated (even grammatical ones, I'm not a native English speaker)

Copy link
Copy Markdown
Member

@athre0z athre0z left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM!

@athre0z athre0z merged commit d835ac3 into zyantific:master Nov 13, 2021
@Tachi107 Tachi107 deleted the man branch November 13, 2021 17:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-doc Area: Documentation C-enhancement Category: Enhancement of existing features P-medium Priority: Medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants