Repository navigation
Feature : Hibernation Layer and plugins. #1036
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
forensicxlab
wants to merge
34
commits into
volatilityfoundation:develop
Choose a base branch
from
forensicxlab:feature/hibernation-layer
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
b0cbd3c
Adding hibernation support
k1nd0ne c91e417
Fixing Huffman
forensicxlab 5c44467
Adapting comments to the codec instead of the volatility3 prefetch pl…
k1nd0ne a13e105
Update the Xpress LZ77+Huffman decoder
k1nd0ne 3568d3f
Code comments and cleaning.
k1nd0ne 7e87e2d
Plugins added : hibernation.Info and hibernation.Dump. Support for ad…
k1nd0ne 142baa6
Adding support for Windows 10 2016 1607
k1nd0ne cfab14f
Only parse the kernel section if the user is using the 'windows.hiber…
k1nd0ne f6b960a
Quick code review and comments to make it more readable. Enhanced plu…
k1nd0ne 8db03c3
using black on the codecs
k1nd0ne d152b48
fixing mistakes in the lz77+huffman decompression algorithm
k1nd0ne 6213d45
Adding codecs + black
k1nd0ne 2bebe91
Formatting using good black version
k1nd0ne 9fd1567
Deported the decompression algorithm in a dedicated python3 package
k1nd0ne 9b855f1
Deported the decompression algorithm in a dedicated python3 package
k1nd0ne 2ffa3a9
conflict
k1nd0ne 9379e16
Merging to resolve conflict
k1nd0ne b17eab6
requirements
k1nd0ne 3f428f7
Fixing requirements
k1nd0ne ad31052
Fixing unused import
k1nd0ne 9d478f3
Merge branch 'volatilityfoundation:develop' into feature/hibernation-…
forensicxlab d779c0e
Upgrading pipeline and python3 version minimum requirement
k1nd0ne c947999
Upgrading pipeline and python3 version minimum requirement
k1nd0ne 0d6c1ea
Using symbol Tables (1/2)
k1nd0ne f378a1a
Merge branch 'volatilityfoundation:develop' into feature/hibernation-…
forensicxlab 3b1f2ae
Sync
3778c97
Merge branch 'develop' into feature/hibernation-layer
k1nd0ne 8d9c917
Merge branch 'volatilityfoundation:develop' into feature/hibernation-…
forensicxlab 603b53f
Merge branch 'develop' into feature/hibernation-layer
k1nd0ne 04cc8a0
hibernation: Windows 11 24H2+ support (chain-validated counter) and H…
Ozer0x777 c3d0bde
contrib: hibernation_checks (standalone checks, layer tests, 2026-10 …
Ozer0x777 365e13a
Merge pull request #1 from Ozer0x777/hibernation-24h2-autodetect
forensicxlab 75e83db
codecs: drop the unused `import codecs` that fails the ruff job
Ozer0x777 2e12140
Merge pull request #2 from Ozer0x777/ci-lint-fix
forensicxlab File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,6 @@ | ||
| name: Install Volatility3 test | ||
| on: [push, pull_request] | ||
| jobs: | ||
|
|
||
| install_test: | ||
| runs-on: ${{ matrix.host }} | ||
| strategy: | ||
|
|
@@ -10,15 +9,15 @@ jobs: | |
| host: [ ubuntu-latest, windows-latest ] | ||
| python-version: [ "3.10", "3.11", "3.12", "3.13" ] | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/checkout@v4 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Another mis-merge |
||
|
|
||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
| - name: Set up Python ${{ matrix.python-version }} | ||
| uses: actions/setup-python@v4 | ||
| with: | ||
| python-version: ${{ matrix.python-version }} | ||
|
|
||
| - name: Setup python-pip | ||
| run: python -m pip install --upgrade pip | ||
| - name: Setup python-pip | ||
| run: python -m pip install --upgrade pip | ||
|
|
||
| - name: Install volatility3 | ||
| run: pip install . | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| # Checks for the hibernation layer (Windows 11 24H2+ support, Huffman set size) | ||
|
|
||
| Plain Python 3 scripts, no Volatility needed for the first three. They print counters only (no path, | ||
| no hash, no exact file size, no section offset by default). For the decompression checks and the | ||
| layer tests: `pip install xpress-lz77`. | ||
|
|
||
| | file | what it does | | ||
| |---|---| | ||
| | `hib_check.py` | Walks the chain of compression sets of the boot and of the kernel section of a `hiberfil.sys` with three layouts: `23h2` (size = bits 8-29, bits 30-31 = algorithm, `KernelPagesProcessed` at `0x230`), `24h2-early` (size = bits 8-28, bit 30 = LZ77+Huffman, counter at `0x238`) and `24h2` (same rules, counter at `0x250`). A layout matches a section when the chain reaches exactly the page count of the header with no invalid set header. It also walks the kernel chain until it ends by itself and prints which header qwords hold its page count and byte length (to find the counter of an unknown build), the set kinds and header bits 25-31 of each section, the Huffman sets that do not cover 16 pages, and with `--decompress` decompresses every compressed set and checks the output size. `--show-offsets` adds identifying values (local debugging only). | | ||
| | `compare_outputs.py` | Compares two `windows.hibernation.Dump` outputs of the same file page by page, for the pages of the boot section and of the kernel section (`--outside` also counts the pages outside both). | | ||
| | `count_nonzero_pages.py` | Counts the 4 KiB pages of a raw image that contain a non-zero byte (needs numpy). | | ||
| | `test_hib_layout.py` | 16 synthetic unit tests of the tools, on hibernation files generated in memory. No sample data. | | ||
| | `test_hib_layer.py` | 3 tests of the real `HibernationLayer` on the same synthetic files, for the three layouts: every page reads back; a LZ77+Huffman set of 4 pages converts (with the decoder asked for a fixed 65536 bytes it fails with `EOF Error`); a `--version 4` file whose counter matches no known offset is refused. Needs `xpress-lz77` and runs from this directory with the repository root on `sys.path` (done by the test itself). | | ||
| | `campaign_2026-10/` | Logs of the test campaign on Windows 11 21H2, 22H2, 23H2, 24H2, 25H2 and 26H1 lab VMs: `SUMMARY.md` (tables), `campaign.log` (one line per step), and per build and round the `hib_check.py --decompress` output and the `windows.hibernation.Dump` runs (this branch, second run, original code, wrong `--version`), the unit-test and ruff runs. Nothing from a real case is included. | | ||
|
|
||
| ``` | ||
| python3 hib_check.py hiberfil.sys --decompress | ||
| python3 compare_outputs.py hiberfil.sys out_a/memory_layer.raw out_b/memory_layer.raw | ||
| cd contrib/hibernation_checks && python3 -m unittest -v test_hib_layout test_hib_layer | ||
| ``` | ||
|
|
||
| The two tools mirror the parsing rules of the layer, they are not Volatility itself; `test_hib_layer.py` | ||
| exercises the layer. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,149 @@ | ||
| ##### lab VM file: win10 (Fast Startup: Windows 10 22H2 / Windows 11 24H2 build 26100.1742) | ||
| signature : b'HIBR' | ||
| file size : about 4 GiB | ||
| NumPagesForLoader : 18919 | ||
|
|
||
| === layout 23h2 (KernelPagesProcessed @ 0x230) === | ||
| KernelPagesProcessed : 222203 | ||
| boot section : 1183 sets, 18919/18919 pages, ok, MATCH | ||
| kernel section : 13888 sets, 222203/222203 pages, ok, MATCH | ||
|
|
||
| === layout 24h2 (KernelPagesProcessed @ 0x250) === | ||
| KernelPagesProcessed : 75013 | ||
| boot section : 1183 sets, 18919/18919 pages, ok, MATCH | ||
| kernel section : 4689 sets, 75024/75013 pages, ok, MISMATCH | ||
|
|
||
| === layout 24h2-early (KernelPagesProcessed @ 0x238) === | ||
| KernelPagesProcessed : 17612265 | ||
| boot section : 1183 sets, 18919/18919 pages, ok, MATCH | ||
| kernel section : 13888 sets, 222203/17612265 pages, INVALID SET HEADER, MISMATCH | ||
|
|
||
| === header bits, 24h2 rules === | ||
| boot: set kinds (kind, bit29, bit30): | ||
| plain-lz77 bit29=0 bit30=0 : 1183 | ||
| boot: largest set size 53665 bytes (16 bits), header bits set: | ||
| bit 25 : 0 sets | ||
| bit 26 : 0 sets | ||
| bit 27 : 0 sets | ||
| bit 28 : 0 sets | ||
| bit 29 : 0 sets | ||
| bit 30 : 0 sets | ||
| bit 31 : 0 sets | ||
| boot: sets larger than 64 KiB : 0 | ||
| boot: huffman sets with pages != 16 : 0 | ||
| boot: compressed sets classified differently by the 23h2 rules : 0 | ||
| boot: compressed sets sized differently by the 23h2 rules : 0 | ||
|
|
||
| === kernel chain walked to its natural end, 23h2 set rules === | ||
| 13888 sets, 222203 pages | header qwords equal to that page count: 0x230 | equal to its length in bytes: 0x240 | ||
|
|
||
| === kernel chain walked to its natural end, 24h2 set rules === | ||
| 13888 sets, 222203 pages | header qwords equal to that page count: 0x230 | equal to its length in bytes: 0x240 | ||
|
|
||
| === decompression (algorithm selected by each layout; output size checked) === | ||
| 23h2 layout, boot section: 1183 compressed sets | plain LZ77 ok=1183 failed=0 | Huffman ok=0 failed=0 (ok only with the exact size argument: 0) | ||
| 23h2 layout, kernel section: 13850 compressed sets | plain LZ77 ok=13572 failed=0 | Huffman ok=278 failed=0 (ok only with the exact size argument: 0) | ||
| 24h2 layout, boot section: 1183 compressed sets | plain LZ77 ok=1183 failed=0 | Huffman ok=0 failed=0 (ok only with the exact size argument: 0) | ||
| 24h2 layout, kernel section: not walked (section skipped or chain does not match) | ||
| 24h2-early layout, boot section: 1183 compressed sets | plain LZ77 ok=1183 failed=0 | Huffman ok=0 failed=0 (ok only with the exact size argument: 0) | ||
| 24h2-early layout, kernel section: not walked (section skipped or chain does not match) | ||
|
|
||
| ##### lab VM file: w11fs (Fast Startup: Windows 10 22H2 / Windows 11 24H2 build 26100.1742) | ||
| signature : b'HIBR' | ||
| file size : about 6 GiB | ||
| NumPagesForLoader : 30093 | ||
|
|
||
| === layout 23h2 (KernelPagesProcessed @ 0x230) === | ||
| KernelPagesProcessed : 30093 | ||
| boot section : 1881 sets, 30093/30093 pages, ok, MATCH | ||
| kernel section : 25 sets, 400/30093 pages, INVALID SET HEADER, MISMATCH | ||
|
|
||
| === layout 24h2 (KernelPagesProcessed @ 0x250) === | ||
| KernelPagesProcessed : 10338 | ||
| boot section : 1881 sets, 30093/30093 pages, ok, MATCH | ||
| kernel section : 647 sets, 10352/10338 pages, ok, MISMATCH | ||
|
|
||
| === layout 24h2-early (KernelPagesProcessed @ 0x238) === | ||
| KernelPagesProcessed : 322278 | ||
| boot section : 1881 sets, 30093/30093 pages, ok, MATCH | ||
| kernel section : 20143 sets, 322278/322278 pages, ok, MATCH | ||
|
|
||
| === header bits, 24h2 rules === | ||
| boot: set kinds (kind, bit29, bit30): | ||
| plain-lz77 bit29=0 bit30=0 : 1881 | ||
| boot: largest set size 55327 bytes (16 bits), header bits set: | ||
| bit 25 : 0 sets | ||
| bit 26 : 0 sets | ||
| bit 27 : 0 sets | ||
| bit 28 : 0 sets | ||
| bit 29 : 0 sets | ||
| bit 30 : 0 sets | ||
| bit 31 : 0 sets | ||
| boot: sets larger than 64 KiB : 0 | ||
| boot: huffman sets with pages != 16 : 0 | ||
| boot: compressed sets classified differently by the 23h2 rules : 0 | ||
| boot: compressed sets sized differently by the 23h2 rules : 0 | ||
|
|
||
| === kernel chain walked to its natural end, 23h2 set rules === | ||
| 25 sets, 400 pages | header qwords equal to that page count: none | equal to its length in bytes: none | ||
|
|
||
| === kernel chain walked to its natural end, 24h2 set rules === | ||
| 20143 sets, 322278 pages | header qwords equal to that page count: 0x238 | equal to its length in bytes: 0x248 | ||
|
|
||
| === decompression (algorithm selected by each layout; output size checked) === | ||
| 23h2 layout, boot section: 1881 compressed sets | plain LZ77 ok=1881 failed=0 | Huffman ok=0 failed=0 (ok only with the exact size argument: 0) | ||
| 23h2 layout, kernel section: not walked (section skipped or chain does not match) | ||
| 24h2 layout, boot section: 1881 compressed sets | plain LZ77 ok=1881 failed=0 | Huffman ok=0 failed=0 (ok only with the exact size argument: 0) | ||
| 24h2 layout, kernel section: not walked (section skipped or chain does not match) | ||
| 24h2-early layout, boot section: 1881 compressed sets | plain LZ77 ok=1881 failed=0 | Huffman ok=0 failed=0 (ok only with the exact size argument: 0) | ||
| 24h2-early layout, kernel section: 19579 compressed sets | plain LZ77 ok=19174 failed=0 | Huffman ok=405 failed=0 (ok only with the exact size argument: 0) | ||
|
|
||
| ##### lab VM file: Windows 10 22H2 full hibernation (shutdown /h) | ||
| signature : b'HIBR' | ||
| file size : about 4 GiB | ||
| NumPagesForLoader : 19211 | ||
|
|
||
| === layout 23h2 (KernelPagesProcessed @ 0x230) === | ||
| KernelPagesProcessed : 291139 | ||
| boot section : 1201 sets, 19211/19211 pages, ok, MATCH | ||
| kernel section : 18197 sets, 291139/291139 pages, ok, MATCH | ||
|
|
||
| === layout 24h2 (KernelPagesProcessed @ 0x250) === | ||
| KernelPagesProcessed : 89229 | ||
| boot section : 1201 sets, 19211/19211 pages, ok, MATCH | ||
| kernel section : 5577 sets, 89232/89229 pages, ok, MISMATCH | ||
|
|
||
| === layout 24h2-early (KernelPagesProcessed @ 0x238) === | ||
| KernelPagesProcessed : 17850400 | ||
| boot section : 1201 sets, 19211/19211 pages, ok, MATCH | ||
| kernel section : 18197 sets, 291139/17850400 pages, INVALID SET HEADER, MISMATCH | ||
|
|
||
| === header bits, 24h2 rules === | ||
| boot: set kinds (kind, bit29, bit30): | ||
| plain-lz77 bit29=0 bit30=0 : 1201 | ||
| boot: largest set size 54147 bytes (16 bits), header bits set: | ||
| bit 25 : 0 sets | ||
| bit 26 : 0 sets | ||
| bit 27 : 0 sets | ||
| bit 28 : 0 sets | ||
| bit 29 : 0 sets | ||
| bit 30 : 0 sets | ||
| bit 31 : 0 sets | ||
| boot: sets larger than 64 KiB : 0 | ||
| boot: huffman sets with pages != 16 : 0 | ||
| boot: compressed sets classified differently by the 23h2 rules : 0 | ||
| boot: compressed sets sized differently by the 23h2 rules : 0 | ||
|
|
||
| === kernel chain walked to its natural end, 23h2 set rules === | ||
| 18197 sets, 291139 pages | header qwords equal to that page count: 0x230 | equal to its length in bytes: 0x240 | ||
|
|
||
| === kernel chain walked to its natural end, 24h2 set rules === | ||
| 18197 sets, 291139 pages | header qwords equal to that page count: 0x230 | equal to its length in bytes: 0x240 | ||
|
|
||
| === decompression (algorithm selected by each layout; output size checked) === | ||
| 23h2 layout, boot section: 1201 compressed sets | plain LZ77 ok=1201 failed=0 | Huffman ok=0 failed=0 (ok only with the exact size argument: 0) | ||
| 23h2 layout, kernel section: 18175 compressed sets | plain LZ77 ok=24 failed=0 | Huffman ok=18150 failed=1 (ok only with the exact size argument: 1) | ||
| 24h2 layout, boot section: 1201 compressed sets | plain LZ77 ok=1201 failed=0 | Huffman ok=0 failed=0 (ok only with the exact size argument: 0) | ||
| 24h2 layout, kernel section: not walked (section skipped or chain does not match) | ||
| 24h2-early layout, boot section: 1201 compressed sets | plain LZ77 ok=1201 failed=0 | Huffman ok=0 failed=0 (ok only with the exact size argument: 0) | ||
| 24h2-early layout, kernel section: not walked (section skipped or chain does not match) |
15 changes: 15 additions & 0 deletions
15
contrib/hibernation_checks/campaign_2026-10/21h2/r0/dump-fixed-run2.log
Large diffs are not rendered by default.
Oops, something went wrong.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes just for formatting should be avoided if possible (some people will format it one way, and other a different way, and we'll end up playing pingpong...). I don't think any of the changes in this file are significant, so leave it out of the PR please...