#page-table #paging #x86-64 #virtual #command-line-tool #indices #architecture

app paging-calculator

CLI utility that helps you to calculate indices into the page table from a virtual address. The tool knows multiple paging implementations, such as x86, x86 with PAE, x86_64 and x86_64 with a 5-level page table.

6 releases (3 breaking)

0.4.0 Aug 9, 2024
0.3.0 Sep 22, 2023
0.2.0 Mar 5, 2023
0.1.2 Dec 1, 2022
0.1.0 Nov 30, 2022

#172 in Command line utilities

Download history 118/week @ 2024-08-07 6/week @ 2024-08-14 12/week @ 2024-09-11 8/week @ 2024-09-18 5/week @ 2024-09-25 2/week @ 2024-10-02

280 downloads per month

MIT license

185KB
681 lines

Paging Address Calculator

paging-calculator is a CLI utility written in Rust that helps you find the indices that a virtual address will have on different architectures or paging implementations.

It takes a (virtual) address in hexadecimal format and shows you which index will be used for what page-table level. It can be installed with $ cargo install paging-calculator.

Valid inputs are:

  • $ paging-calculator 0x1337
  • $ paging-calculator 0xdead_beef (underscores are accepted)
  • $ paging-calculator 0xdead_beef x86 --pae (underscores are accepted)
  • $ paging-calculator 0xdead_beef x86_64

Type $ paging-calculator help to get a list of all supported options.

The following screenshot summarizes its functionality:

Screenshot showing the usage of paging-calculator.

Supported Platforms

paging-calculator builds and runs on Linux, macOS, and Windows.

MSRV

The MSRV is 1.75.0 stable.

Trivia

I worked on a project where I need to set up page-tables on my own. I had a few problems to find out what I actually have to do and what indices are used at which level. With the help of this utility, this task becomes quite easy.

Dependencies

~4–13MB
~172K SLoC