ByteToFlag
Menu
Page contents

Reverse / Lab setup / Before task 3

Set up your lab.

Five free tools, installed one at a time. For each one: what it is, why you need it, where to get it, how to install it, and one check that proves it works.

What you install · prerequisites · who it is for · what you finish with
Time
~45 min. You can stop after step 4 and come back before task 4
You install
HxD · Detect It Easy · PE-bear · Ghidra with a JDK · x64dbg
Prerequisites
Task 1 (you can tell static from dynamic, and you know the house rule) · a Windows 10 or 11 x64 computer where you may install programs
On a Mac or Linux
tasks 1–2 work in any browser. For tasks 3–5, set up a Windows 11 virtual machine and do this page inside it: the tasks run Windows programs. On an Apple silicon Mac, Windows 11 for Arm runs these x64 programs through its built-in emulation; a debugger such as x64dbg (planned Module 9) may not work fully there. A virtual machine is also the safer place to run any sample
Who it is for
anyone going on to task 3. If a tool is already installed, do only its check
You finish with
the “Lab works when” list ticked, and one line under Verified in your notes

Write every Before you check answer in your notes before you open the Check.

Three rules for this page

  • Download only from the official pages linked here — never from a mirror or a “free download” site.
  • Do not turn off your antivirus for any step.
  • The versions named below were current on 16 November 2026. If the official page offers a newer one, take it.

This page is not a module: it earns no technique and has no challenge. Tasks 1 and 2 need none of these tools.

Step 1. Your workspace (~5 min)

Recall

From task 1: static or dynamic — which one never runs the file?

Explain

One folder for everything, so that later modules can say “open samples” and mean the same place for everyone. Windows hides file name extensions by default. In reverse engineering the extension is a claim, not evidence, so turn them on.

Do

  1. Create C:\b2f with three folders inside it: tools, samples and notes.
  2. In File Explorer, select View → Show → File name extensions.
  3. Open Notepad, type exactly B2F and nothing else — no Enter — and save it as C:\b2f\samples\hello.txt.
  4. In notes, create notes.md with four headings: Observed, Hypothesis, Verified, Unknown.

Before you check

How many bytes is hello.txt?

Check

Right-click the file, choose Properties and read Size. If the number is not the one you wrote down, your editor added something. Keep the file: step 2 shows what.

Step 2. HxD — see the raw bytes (~7 min)

What
a hex editor: it shows a file as the bytes it really contains
Why
from task 3 on, for every “what is this file?” question
Where
the author’s own site: mh-nexus.de/en/hxd. If that site does not load, the same program is in Windows’ package manager: MHNexus.HxD — run winget install MHNexus.HxD in a terminal
Install
download the installer, run it with the default options, then start HxD

Recall

What size did Properties show for hello.txt?

Explain

Left column: the offset — where the row starts. Middle: the bytes, in hexadecimal. Right: the same bytes as text. You read rows like this by hand in task 2.

Do

In HxD choose File → Open and open hello.txt. Close it. In File Explorer rename the file to hello.exe, then open it in HxD again.

Before you check

(1) What is the first byte of hello.txt, in hex? (2) Does renaming the file to .exe change any byte?

Check

Two letters and a digit give three different bytes; use the ASCII table from task 1, step 2; digits 0–9 are 0x30–0x39. If EF BB BF comes before them, your editor wrote a marker in front of the text — that is the extra size from step 1. For the second question, compare the two views byte by byte.

Step 3. Detect It Easy — identify a file (~6 min)

What
a file identifier: it reads the content of a file and says what kind of file it is
Why
Task 3 · Hear the Words — the first question about any file
Where
the project’s releases on GitHub: github.com/horsicq/DIE-engine/releases. Version 4.0.0 was current on 16 November 2026; take the portable Windows x64 file, die_win64_4.0.0.zip. The project warns that detectiteasy.com is not its site — use only the GitHub release
Install
extract the zip to C:\b2f\tools\die. There is no installer: start the program from that folder

Recall

After renaming, what changed in the bytes of hello.exe?

Explain

Tools that identify files read the content, not the name. Every Windows program begins with the same two bytes — the ones you read in task 1, Read the Mark.

In this step and the next you look at the program file of Detect It Easy itself. It is open source under the MIT licence, so inspecting it is allowed under the house rule.

Do

Drag hello.exe into Detect It Easy. Then drag in the program’s own file, die.exe, from C:\b2f\tools\die.

Before you check

Which of the two will it treat as a Windows program?

Check

Open both files in HxD. Only one begins with the two bytes from task 1’s first task. Both names end in .exe; the content agrees with the name in only one of them.

Step 4. PE-bear — look inside the structure (~6 min)

What
a viewer for the format of Windows programs (PE): headers, sections and imported functions
Why
optional: a second view of a program’s structure, useful from task 3 on
Where
the author’s releases on GitHub: github.com/hasherezade/pe-bear/releases. Version 0.7.2 was current on 16 November 2026; for Windows 10 and 11 take PE-bear_0.7.2_qt6_x64_win_vs22.zip
Install
extract the zip to C:\b2f\tools\pe-bear and start PE-bear. If PE-bear does not start and names a missing file such as VCRUNTIME140.dll, install Microsoft’s latest Visual C++ Redistributable (x64); it covers programs built with Visual Studio 2015 to 2022

Recall

Which file did Detect It Easy treat as a Windows program, and which bytes told you why?

Explain

A program file starts with a map: which processor it is for, where its parts (sections) lie, and which system functions it borrows (imports). PE-bear shows that map as a tree.

Do

Load die.exe into PE-bear from its File menu. Open the DOS header and read its first field. Then open the list of sections.

Before you check

Which two bytes do you expect in that first field, and in which order will they be shown?

Check

They are the same two bytes HxD shows at offset 0 of that file. If PE-bear shows them the other way round, it is printing them as one two-byte number, low byte last on screen but first in the file (little-endian). Two tools agreeing is verified evidence: write it under Verified in your notes.

You now have everything task 3 needs. You may stop here and come back before task 4.

Step 5. Ghidra with a JDK — read code without running it (~12 min)

What
a free disassembler and decompiler, published by the US National Security Agency
Why
Tasks 4 and 5 — the main static tool of Stage 1
Where
the official releases on GitHub: github.com/NationalSecurityAgency/ghidra/releases. Ghidra 12.2 was current on 16 November 2026 (ghidra_12.2_PUBLIC_20261016.zip, 543 MB). It needs a 64-bit JDK 25; Ghidra’s own guide names Adoptium Temurin as a free source
Install
install JDK 25 with the default options. Extract the Ghidra zip to C:\b2f\tools\ghidra — Ghidra has no installer. Run ghidraRun.bat in that folder
Verify the download
the release page shows a SHA-256 for the zip. In PowerShell, run Get-FileHash on your download and compare the two values before you extract it

Recall

Static or dynamic — which one is Ghidra?

Explain

Ghidra turns machine code back into listings you can read: disassembly (instructions) and a decompiler view (C-like). The CodeBrowser you use in this course reads the file and shows what the program could do, without running it. (Ghidra also has a debugger; Stage 1 does not use it.)

Do

Start Ghidra. Choose File → New Project → Non-Shared Project, pick C:\b2f\notes as the folder and name the project b2f.

Before you check

Before you start it: which do you expect to see first — Ghidra’s project window, or a question about where Java is?

Check

If Ghidra asks for the Java home directory, give it the folder of the JDK you installed — the one that contains bin. When the project window shows your project b2f, this step is done.

Step 6. x64dbg — run a program under your control (~6 min)

What
a debugger for Windows programs: it starts a program paused and lets you run it, stop it and look inside
Why
Module 9 · Watch It Run (planned)
Where
the official releases on GitHub: github.com/x64dbg/x64dbg/releases. Snapshot 2026.05.27 was current on 16 November 2026 (snapshot_2026-05-27_12-11.zip, 30 MB)
Install
extract the zip to C:\b2f\tools\x64dbg — a place your user can write to. Optionally run x96dbg.exe to add shortcuts. Start x64\x64dbg.exe for 64-bit programs and x32\x32dbg.exe for 32-bit ones; x96dbg.exe lets you choose. If you do not see these folders at the top, look inside the release folder of the zip

Recall

What did you write under Verified in step 4?

Explain

A debugger is the dynamic tool: it shows what actually happens when a program runs. The folder holds two debuggers, one per architecture. You choose by the file in front of you, not by habit.

Do

Start x64\x64dbg.exe. Do not open a program yet.

Before you check

Signal Check in task 5 is a 64-bit program. Which of the two debuggers would you need for it, and how would you find out for a file you do not know?

Check

The window title names the debugger you started. For a file you do not know, Detect It Easy (step 3) tells you whether it is 32- or 64-bit before you choose.

Lab works when

ToolIt works if
HxDhello.txt shows the three bytes you typed, with or without a three-byte marker in front
Detect It Easyit tells die.exe and hello.exe apart
PE-bearthe first field of the DOS header of die.exe matches what HxD shows at offset 0
Ghidrayour project b2f opens
x64dbgx64dbg.exe starts

One more check is being prepared: a small program written for this section that you read in Ghidra and then run in x64dbg, so that a claim moves from Hypothesis to Verified. Until it exists, steps 5 and 6 only prove that the two tools start.

Continue learning

Task 3 · Hear the Words uses HxD and Detect It Easy (steps 2 and 3). Task 4 · Find the Gate and Task 5 · Signal Check need Ghidra from step 5.

Task 3 · Hear the Words Back to Stage 1