MOSCOW FORENSICS DAY '25MFD '25

Slides / 14 of 19

Talk slides

The role of reverse engineering in understanding artifacts: when documentation is the enemy and the decompiler is a friend

Maxim Sukhanov · CICADA8
Day 2 — Friday, 12 September 2025: information security day · Scheduled 13:45–14:15 · In the recording 06:35:14–06:58:14

An English deck and the text under the slides

These slides are an English version of the Russian deck shown in the recording: the text the authors set in the presentation has been translated and redrawn in place, while everything captured from a screen — program windows, logs, evidence — is left exactly as it was, in Russian. The fonts are the closest available ones, not the originals. The Russian deck is on the RU version of this page. Under each slide its text is set out for word search and machine reading.

  1. Slide 1 — The role of reverse engineering in understanding artifacts: when documentation is the enemy and the decompiler is a friend
    Page 106:35:59

    Slide text

    MOSCOW

    FORENSICS

    DAY '25

    IVIL

    MAXIM SUKHANOV

    “THE ROLE OF REVERSE ENGINEERING IN UNDERSTANDING ARTIFACTS: WHEN DOCUMENTATION IS THE ENEMY AND THE DECOMPILER IS A FRIEND”

    MFD MFD

  2. Slide 2 — The role of reverse engineering in understanding artifacts: when documentation is the enemy and the decompiler is a friend
    Page 206:36:15

    Slide text

    CIOADA&

    The role of reverse engineering in understanding artifacts: when documentation is the enemy and the decompiler is a friend

    Maxim Sukhanov

    Head of Cyber Threat Detection and Incident Response at CICADA8

  3. Slide 3 — The role of reverse engineering in understanding artifacts: when documentation is the enemy and the decompiler is a friend
    Page 306:36:34

    Slide text

    ABOUT ME

    Previously worked at BI.ZONE, Group-IB

    15 years in Digital Forensics, Incident Response, Malware Analysis, Threat Intelligence Reverse engineered the NTFS, FAT12/16/32, exFAT formats, the Windows registry, shadow copies

    I build utilities and libraries:

    yarp (Windows registry file parser),

    dfir_ntfs (parser for NTFS, FAT12/16/32 exFAT volumes and shadow copies), winmem_decompress (unpacker for compressed pages from memory dumps),

    and much more…

    I look for and find vulnerabilities in file system parsers, bootloaders and elsewhere

    MAXIM SUKHANOV

    Head of Cyber Threat Detection and Incident Response at CICADA8

    m.suhanov@cicada8.ru

    CIOADA®

  4. Slide 4 — The role of reverse engineering in understanding artifacts: when documentation is the enemy and the decompiler is a friend
    Page 406:37:40

    Slide text

    Problem

    There are observable artifacts, traces, anomalies…

    How, in principle, to justify their interpretation?

    Two approaches:

    Refer to someone: an article, a book, documentation, other people's results. Find the answer and justify it yourself: run an expert experiment, etc.

    CIOADA&

  5. Slide 5 — The role of reverse engineering in understanding artifacts: when documentation is the enemy and the decompiler is a friend
    Page 506:38:21

    Slide text

    The problem in one quote

    “I trust the documentation”

    CIDADA:

  6. Slide 6 — The role of reverse engineering in understanding artifacts: when documentation is the enemy and the decompiler is a friend
    Page 606:38:51

    Slide text

    02

    “Deception” by vendors

    CIOADA®

  7. Slide 7 — The role of reverse engineering in understanding artifacts: when documentation is the enemy and the decompiler is a friend
    Page 706:39:26

    Slide text

    No timestamps in NTFS!

    That's what the official documentation says [1][2]:

    STANDARD_INFORMATION structure

    01/06/2021

    [This structure is valid only for version 3 of NTFS volumes; it may be altered in future versions.]

    Contains the standard information attribute. This attribute is present in every base file record and must be resident.

    Syntax

    4a Copy

    typedef struct _STANDARD_INFORMATION (

    UCHAR Reserved[0x30]: ULONG OwnerId; ULONG SecurityId; } STANDARD_INFORMATION, *PSTANDARD_INFORMATION;

    Members

    Reserved

    Reserved.

    Ownerld

    The identifier of the file owner, from the security index.

    CIOADA8

    Securityld

    The security identifier for the file.

  8. Slide 8 — The role of reverse engineering in understanding artifacts: when documentation is the enemy and the decompiler is a friend
    Page 806:40:01

    Slide text

    FILE_NAME structure

    01/07/2021

    [This structure is valid only for version 3 of NTFS volumes; it may be altered in future versions.]

    Represents a file name attribute. A file has one file name attribute for every directory it is entered into.

    Syntax

    Copy

    typedef struct _FILE_NAME ( FILE_REFERENCE ParentDirectory; UCHAR

    Reserved[8x38];

    UCHAR

    FileNameLength;

    UCHAR

    Flags;

    WCHAR

    FileName 1];

    } FILE_NAME, *PFILE_NAME;

    Members

    ParentDirectory

    A file reference to the directory that indexes to this name. See MFT_SEGMENT_REFERENCE.

    Reserved

    Reserved.

    FileNameLength

    The length of the file name, in Unicode characters.

    Flags

    The file name flags.

    FILE NAME_NTFS (0x01)

    FILE_NAME_DOS (0x02)

    CIOADAB

    FileName

    The first character of the file name.

  9. Slide 9 — The role of reverse engineering in understanding artifacts: when documentation is the enemy and the decompiler is a friend
    Page 906:40:29

    Slide text

    Answer

    Apparently the vendor protects NTFS internals from “clumsy hands”.

    So the “unneeded” fields are “reserved”.

    CIOADA8

  10. Slide 10 — The role of reverse engineering in understanding artifacts: when documentation is the enemy and the decompiler is a friend
    Page 1006:41:09

    Slide text

    03

    Forgot that things have changed

    CIOADAS

  11. Slide 11 — The role of reverse engineering in understanding artifacts: when documentation is the enemy and the decompiler is a friend
    Page 1106:42:20

    Slide text

    User data has vanished from the shadow copy!

    But that can't happen [3]!

    Can I exclude files from a shadow copy to save space?

    VSS is designed to create shadow copies of entire volumes. Temporary files, such as paging files, are automatically

    History active

    omitted from shadow copies to save space.

    0000

    1F80: 00 00 00 00 00 00 00 00

    00

    09 00

    09 00

    00 00

    00

    0000 1F90: 00 00

    IFAO:

    0000

    To exclude specific files from shadow copies, use the following registry key: FilesNot ToSnapshot.

    ДрЕ Притка

    0000

    1FB0:

    0000

    1FCO:

    0000

    1FDO:

    • Note

    0000

    1FEO:

    0000 1FFO: 0000 2000:

    00

    00

    08

    00

    The FilesNotToSnapshot registry key is intended to be used only by applications. Users who attempt to use it

    History vss dfir ntfs

    encounter limitations such as:

    00

    00

    00

    00

    00

    00

    00

    00 06

    0000

    1F80:

    00

    08

    00

    00

    00

    00

    0000

    1F90:

    00 00

    0000

    IFAO:

    • It can't delete files from a shadow copy that was created on a Windows Server by using the Previous Versions

    0000

    1FB0:

    0000

    1FCO:

    feature.

    0000

    1FDO:

    • It can't delete files from shadow copies for shared folders.

    0000

    1FEO:

    0000

    1FFO-

    • It can delete files from a shadow copy that was created by using the Diskshadow utility, but it can't delete files

    0000

    2000:

    00

    00

    from a shadow copy that was created by using the VssAdmin utility.

    • Files are deleted from a shadow copy on a best-effort basis. This means that they aren't guaranteed to be

    deleted.

    CIOADA:

    For more information, see Excluding Files from Shadow Copies.

  12. Slide 12 — The role of reverse engineering in understanding artifacts: when documentation is the enemy and the decompiler is a friend
    Page 1206:43:58

    Slide text

    Answer

    From Windows 8 on, user files are excluded from the shadow copy by default.

    But in some cases they still get in!

    This behavior was never officially documented.

    At least two vendor replies to customers describing this behavior are known…

    One of them in the context of a ransomware attack! [4]

    We have also received a response from Microsoft indicating that it is highly likely this function is the cause of the file corruption.

    Although the reasons for this specification change have not been made public, we speculate that it is related to performance issues from saving all data into a snapshot, utilization efficiency issues in the snapshot area, excessive expansion of user data, and the fact that "file history" is now recommended for backing

    up user data.

    CIDADA

  13. Slide 13 — The role of reverse engineering in understanding artifacts: when documentation is the enemy and the decompiler is a friend
    Page 1306:45:50

    Slide text

    Details

    First the shadow copy is created, then clusters with user data are excluded from it.

    The exclusion process is handled by “SrTasks.exe”.

    User files are found by built-in rules (by extension, in particular) by iterating over the records in $MFT.

    CIDADAB

  14. Slide 14 — The role of reverse engineering in understanding artifacts: when documentation is the enemy and the decompiler is a friend
    Page 1406:47:42

    Slide text

    They documented a different file system implementation…

    Not from Windows NT,

    but from Windows 95 [5]!

    Yes, the (in) famous fatgen103.pdf document, retired from Microsoft's own site, but still available at https://web.archive.org/web/20210723100623/http://download.microsoft.com/

    It sternly says at page 14:

    "It is really quite simple how this works. The FAT type one of FAT12,

    FAT16, or FAT32-is determined by the count of clusters on the volume and nothing else."

    But see below...:

    > But as Alain pointed Microsoft FAT implementation (fastfat.sys) for > FAT32 detection does not use number of clusters, but rather explicit > marking of FAT32.

    Same behavior has Linux kernel implementation

    > (msdos.ko and vfat.ko) and same in dosfstools project. Hence this > non-standard FAT32 can be still created by mkfs. fat.

    Actually, what I meant in my previous mail was that *everything else* that is referred to in the FAT32 extended boot block (root directory location,

    etc.) would depend on this explicit marking

    (fatLen/bigFatLen), but not the number of FAT bits themselves.

    However, your remark got me thinking, and so I tried it out on a Windows

    10 VM.

    ...and lo and behold: the mere presence of a FAT32 extended boot block (as signaled by fat_len being 0) was enough to make it use 32 fat bits, even if the number of clusters was too low for FAT32.

    CIOADA&

    Sorry for having been to easily misled by an assertive, but nonfactual, Microsoft statement.

    ender presence of 132 extended boat blunt as weet for that ingle

    consider

    appropriate number of FAT bits.

    Regards,

    Alain

  15. Slide 15 — The role of reverse engineering in understanding artifacts: when documentation is the enemy and the decompiler is a friend
    Page 1506:48:43

    Slide text

    04

    Case: Prefetch

    CIOADA&

  16. Slide 16 — The role of reverse engineering in understanding artifacts: when documentation is the enemy and the decompiler is a friend
    Page 1606:49:04

    Slide text

    What is stored in these files?

    Op-EXPLORER.EXE-[...H-[...].pf

    CIDADA•

  17. Slide 17 — The role of reverse engineering in understanding artifacts: when documentation is the enemy and the decompiler is a friend
    Page 1706:49:46

    Slide text

    Hypotheses and versions

    1. A trojan, perhaps? 2. […] when the program itself requests tracking of itself 3. boot prefetch 4. […] a process […] living purely in RAM

    The right answer is in the ASP.NET blog [6], but the artifact (the file “Op-*.pf”) is mentioned in passing…

    CIOADA&

  18. Slide 18 — The role of reverse engineering in understanding artifacts: when documentation is the enemy and the decompiler is a friend
    Page 1806:50:49

    Slide text

    The right answer from the blog

    The features simple uses the operation recorder API. See OperationStart and OperationEnd APls on msdn. This APls require an integer used as an Id of the operation. We use a hash code of the app domain app id, which is a string.

    string domainId = HttpRuntime.AppDomainAppId;

    int operationId = domainId.GetHashCode();

    The OperationStart call is made the first time the app domain is created. The OperationEnd API is called at the end of the request in which we called OperationStart. A .pf file should be created on the prefetch directory:

    C:>dir SwindirsPrefetch

    Volume in drive C has no label.

    Volume Serial Number is CC5B-113C

    Directory of C:WindowsPrefetch

    02/16/2012 04:17 PM

    <DIR>

    02/16/2012 04:17 PM

    <DIR>

    02/16/2012 04:17 PM

    164,832 Op-W3WP.EXE-90E54C33-765F360E.pf

    1 File (s)

    164, 832 bytes

    2 Dir (s)

    30, 203, 154, 432 bytes free

    CIOADA8

  19. Slide 19 — The role of reverse engineering in understanding artifacts: when documentation is the enemy and the decompiler is a friend
    Page 1906:51:45

    Slide text

    Decompiling the kernel: PfSnOperationProcess

    61 2 3

    if (*13 == 92) break; ++v10; --v13;

    66 67

    while ( (unsigned

    int 64) v13 >= v11 ) ;

    if ( v10 && v11 + 2164 * (unsigned int) (v12 - v10) )

    2

    5

    7 8

    RtlStringCbPrintfW(pszDest, 60u164, L"Op-8.17s-808X"); v14 = * (_DWORD *) (a1 + 4) ; v15 = v14 & 1; v2 = (* (_BYTE *) (a1 + 1) & 1) == 0; v20 = * (_DWORD *) (a1 + 8);

    if ( v2 )

    if ( (v14 & 2) != 0 || v17 == 2)

    v15 |= 2u;

    80 81

    else if ( (v14 & 4) != 0 )

    v15 |= 4u;

    PESnBeginScenario (Process, pszDest, 1u, V15, 0164, 0164);

    86

    else

    8 19

    PfSnEndProcessTrace (Process, (unsigned int) (v15 + 8), pszDest) ;

    v9 = 0;

    else

    CIDADA:

    94 LABEL_27:

    15

    v9 = STATUS_INTERNAL_ERROR;

    10

    98

    LABEL 17;

    goto

  20. Slide 20 — The role of reverse engineering in understanding artifacts: when documentation is the enemy and the decompiler is a friend
    Page 2006:52:48

    Slide text

    Decompiling the kernel: PfSnSetPrefetcherInformation

    int64 |

    fastcall PfSnSetPrefetcherInformation (

    int64 al,

    _int128 *a2, int a3, PROCESSOR_MODE a4)

    // [COLLAPSED LOCAL DECLARATIONS. PRESS KEYPAD CTRL-"+" TO EXPAND]

    Ja und

    if (a3 == 32)

    v12 = * ( PREFETCHER INFORMATION *) a2; if (* (QWORD *)v12.Version |= 0x675684300000001164 ) return (unsigned int)-1073741811; if (v12. PrefetcherInformationClass <= 8u && (v7 = 0x128,

    _bittest (6v7, v12.PrefetcherInformationClass))

    11 SesinglePrivilegeCheck (SeProfileSingleProcessPrivilege,a4))

    1E I v12.PrefetcherInformationClass 1= 3 )

    switch (v12. PrefetcherInformationClass)

    CIOADAB

    19

    if (v12.PrefetcherInformationLength |= 12) return (unsigned int)-1073741811; if (a4 && ((int64)v12.PrefetcherInformation & 3) != 0 ExRaiseDatatypeMisalignment (); * (_QWORD *)&v12. Version = * (QWORD *)v12.PrefetcherInformation; v12.PrefetcherInformationClass = * ((_DWORD *) v12. PrefetcherInformation + 2) ; v8 = PfSnOperationProcess ((_int64) 6v12) ;

    case 6: if ( v12.PrefetcherInformationlength PrefetcherInformationlength == 72)

    if (a4 a4 ((_int64)v12. PrefetcherInformation & 3) != 0 ) ExRaiseDatatypeMisalignment ();

    = * (OWORD *) v12.PrefetcherInformation;

    v16[1] = * ( (OWORD *) v12.PrefetcherInformation + 1); v16[2] = * ((OWORD *)v12. PrefetcherInformation + 2); v16[3] = * ( (OWORD *)v12.PrefetcherInformation + 3);

    *)v12. PrefetcherInformation + 8);

    if (LODWORD (v16[0]) ==2)

    PfSnPrefetchCacheEntryUpdate(v16) ; return 0;

    return (unsigned int)-1073741811;

    return (unsigned int)-1073741306; case 8:

  21. Slide 21 — The role of reverse engineering in understanding artifacts: when documentation is the enemy and the decompiler is a friend
    Page 2106:54:05

    Slide text

    PrefetcherInformationClass = 5?

    There is a header file from Process Hacker [7].

    The origin of the names is unknown (most likely old Microsoft header files). PrefetcherBootControl – an out-of-date name (the commit is dated 2011)…

    55

    typedef enum _PREFETCHER_INFORMATION_CLASS

    56 57

    PrefetcherRetrieveTrace = 1, // q: CHAR[]

    58

    PrefetcherSystemParameters, _// q: PF_SYSTEM_PREFETCH_PARAMETERS

    PrefetcherRetese,ot oaderTrace, P/A9: CHAR[]

    59 60 61

    PrefetcherBootControl // s: PF_BOOT_CONTROL

    PREFETCHER_INFORMATION_CLASS;

    62

    CISADA•

  22. Slide 22 — The role of reverse engineering in understanding artifacts: when documentation is the enemy and the decompiler is a friend
    Page 2206:56:04

    Slide text

    PrefetcherInformationClass = 5

    Trace recording is started by calling OperationStart() (from advapi32.dll).

    Nothing to do with booting!

    Trace recording is ended by calling OperationEnd().

    No more than one trace per process at a time. If there is almost no I/O in the trace, it isn't saved!

    Apparently: at least 32 I/O requests needed.

    CIOADA8

  23. Slide 23 — The role of reverse engineering in understanding artifacts: when documentation is the enemy and the decompiler is a friend
    Page 2306:57:27

    Slide text

    References

    https://learn.microsoft.com/en-us/windows/win32/devnotes/standard-information

    1.

    2.

    https://learn.microsoft.com/en-us/windows/win32/devnotes/file-name https://learn.microsoft.com/en-us/windows-server/storage/file-server/volume-

    3.

    shadow-copy-service#can-i-exclude-files-from-a-shadow-copy-to-save-space

    https://www.iij.ad.jp/en/dev/iir/pdf/iir vol37 focused1 EN.pdf

    4

    https://lists.gnu.org/archive/html/info-mtools/2022-09/msg00003.html https://devblogs.microsoft.com/dotnet/asp-net-performance-prefetch-and-multi- core-jitting/ https://processhacker.sourceforge.io/doc/ntpfapi_8h source.html#I00061

    CIOADA&

  24. Slide 24 — The role of reverse engineering in understanding artifacts: when documentation is the enemy and the decompiler is a friend
    Page 2406:57:50

    Slide text

    CIOADA&

    Thank you! Questions?

    MAXIM SUKHANOV

    Head of Cyber Threat Detection and Incident Response at CICADA8

    m.suhanov@cicada8.ru