GO KALI FREE
IntermediateEthical Hacking

Reverse Engineering for Beginners: Learn to Analyze Binaries with Ghidra & GDB

Learn reverse engineering from scratch: analyze binaries with Ghidra and GDB, read assembly, crack a practice binary, and build a starter toolkit.

#reverse engineering#how to learn reverse engineering#reverse engineering for beginners#reverse engineering tutorial#ghidra tutorial#what is reverse engineering#reverse engineering tools#binary analysis

What Is Reverse Engineering?

Reverse engineering is the process of examining a finished program to understand how it works without relying on its original design documents or source code. Beginners usually inspect binary structure, strings, assembly, and runtime behavior with tools such as Ghidra and GDB, using only software they own or are authorized to analyze.

A compiler converts source code into machine instructions, metadata, and data that a processor can execute. Reverse engineering works in the opposite direction: you study those artifacts and infer the program's logic, inputs, outputs, and internal decisions. A decompiler can make this easier, but it cannot restore the exact original source code, comments, or variable names.

Common authorized uses include:

  • Analyzing malware inside an isolated research environment
  • Finding vulnerabilities in software you own or have permission to test
  • Solving CTF challenges and purpose-built crackmes
  • Debugging programs when source code is incomplete
  • Documenting legacy formats and protocols
  • Building compatible software through a properly managed clean-room process
  • Reverse engineering is not automatic source-code recovery, permission to bypass access controls, or authorization to inspect any program you can download. It also does not guarantee that a decompiler's output is correct.

    Is Reverse Engineering Legal?

    Reverse engineering laws vary by country and purpose. The safest beginner projects are binaries you compiled yourself, CTF challenges, and crackmes whose authors explicitly permit analysis.

    Before analyzing someone else's software, check:

  • Whether you have written authorization
  • The software license and EULA
  • Local copyright and anti-circumvention law
  • Whether sensitive or personal data could be exposed
  • Any scope restrictions imposed by a client, employer, or platform
  • A clean-room project normally separates the team documenting observable behavior from the team implementing a compatible replacement. This can reduce the risk of copying protected expression, but it does not automatically override contracts, patents, or local law.

    This guide is educational, not legal advice. Do not use it against commercial software, production systems, or binaries you do not own unless you have explicit permission.

    How Reverse Engineering Works: Static vs Dynamic Analysis

    Static analysis examines a file without running it. Dynamic analysis observes the program while it executes. Effective reverse engineering usually alternates between both.

    QuestionStatic analysisDynamic analysis
    Is the program executed?NoYes
    Typical evidenceHeaders, strings, imports, functions, assembly, decompiled codeRegisters, memory, function arguments, files, system calls, network activity
    Main toolsGhidra, objdump, strings, readelf, nm, radare2GDB, strace, ltrace
    StrengthBroad overview of possible behaviorConfirms what happens on a specific execution path
    LimitationA code path may never runOne run may miss other paths
    Main riskParsing a malicious file can still expose tool flawsRunning untrusted code can affect the system

    Start with static analysis to identify the architecture, file type, strings, imports, and likely functions. Use dynamic analysis to test specific hypotheses, such as whether a comparison controls an "Access granted" branch.

    Only execute self-compiled or explicitly authorized binaries. Unknown binaries should be treated as untrusted and handled in an isolated lab by someone prepared to contain them.

    The Skills You Need First

    You do not need to master every prerequisite before beginning, but four foundations make reverse engineering for beginners much easier.

    C basics

    Learn how C represents:

  • Functions, parameters, and return values
  • if, else, and loop control flow
  • Arrays, pointers, and null-terminated strings
  • Local, global, and static variables
  • Structures and memory allocation
  • Library calls such as strcmp, puts, and malloc
  • Compiling your own short C programs is one of the fastest ways to connect source constructs to assembly.

    x86-64 assembly essentials

    For this tutorial, focus on Linux's x86-64 System V calling convention:

  • The first six integer or pointer arguments normally use rdi, rsi, rdx, rcx, r8, and r9.
  • A function's integer return value normally uses rax.
  • rsp tracks the top of the stack.
  • rip identifies the next instruction.
  • call transfers control to a function and records a return address.
  • ret returns to the caller.
  • Comparisons set flags that conditional jumps inspect.
  • You do not need to memorize every instruction. Learn to recognize data movement, comparisons, branches, function calls, and returns.

    Linux command-line skills

    Be comfortable with paths, permissions, pipes, redirection, grep, less, and basic process control. You should understand commands such as:

    file ./practice
    strings ./practice | less
    objdump -d ./practice | less
    printf 'wrong\n' | ./practice
    

    ELF binary structure

    Most native Linux programs use the Executable and Linkable Format, or ELF. Important components include:

  • .text: executable machine instructions
  • .rodata: read-only constants such as string literals
  • .data: initialized writable global data
  • .bss: zero-initialized global data
  • .symtab: a full symbol table when it has not been stripped
  • .dynsym: symbols needed for dynamic linking
  • ELF headers: architecture, entry point, offsets, and segment information
  • Symbols help tools display names such as main, but the processor does not need those names. Stripping symbols removes useful labels, not the underlying instructions.

    Your Reverse Engineering Toolkit

    ToolPrimary purpose
    GhidraDisassembly, decompilation, function analysis, cross-references, data types, and annotations
    GDBBreakpoints, instruction stepping, registers, memory inspection, and temporary runtime modification
    objdumpTerminal-based disassembly and section inspection
    stringsExtracts printable character sequences from a file
    readelfDisplays ELF headers, sections, symbols, relocations, and program headers
    nmLists symbols, including undefined imported functions
    straceTraces Linux system calls such as openat, read, execve, and connect
    ltraceTraces many dynamically linked library calls
    radare2Terminal-based analysis, disassembly, graphing, and debugging
    checksecReports common hardening properties such as PIE, NX, canaries, and RELRO
    xxdDisplays raw file bytes in hexadecimal

    GEF and Pwndbg are optional GDB enhancements that add context views and convenience commands. Plain GDB is enough for this guide. Install extensions only from their official projects and only in your isolated lab.

    Tools do not create legal authorization. Use them only on your own binaries, authorized exercises, and explicitly permitted targets.

    Setting Up Your Lab in Kali Linux

    Use a Kali Linux virtual machine with no sensitive credentials or personal files. Take a snapshot before working with downloaded crackmes, and keep networking disabled unless a specific authorized exercise requires it.

    This tutorial assumes an x86-64 system. Confirm the architecture:

    uname -m
    

    Install the required packages:

    sudo apt update
    sudo apt install -y ghidra gdb binutils gcc libc6-dev file strace ltrace checksec xxd
    

    Verify the installed packages and versions:

    apt-cache policy ghidra | grep -E 'Installed|Candidate'
    gdb --version | head -n 1
    gcc --version | head -n 1
    objdump --version | head -n 1
    

    Create a dedicated directory:

    mkdir -p ~/re-lab
    cd ~/re-lab
    

    Create the practice program:

    cat > practice.c <<'EOF'
    #include <stdio.h>
    #include <string.h>
    
    int check_password(const char *input)
    {
        const char *secret = "orbit-lemur-42";
        return strcmp(input, secret) == 0;
    }
    
    int main(void)
    {
        char input[64];
    
        printf("Enter password: ");
        if (scanf("%63s", input) != 1) {
            puts("Input error.");
            return 1;
        }
    
        if (check_password(input)) {
            puts("Access granted.");
        } else {
            puts("Access denied.");
        }
    
        return 0;
    }
    EOF
    

    Compile it:

    gcc -g -O0 -fno-stack-protector -no-pie -Wall -Wextra -o practice practice.c
    

    The flags deliberately make this educational binary easier to inspect:

  • -g includes debugging information.
  • -O0 minimizes compiler optimization.
  • -fno-stack-protector disables the stack canary.
  • -no-pie gives the executable a non-PIE layout.
  • Do not copy these weakened settings into production software. The bounded scanf prevents this example from becoming a buffer-overflow exercise.

    Confirm the result:

    file ./practice
    checksec --file=./practice
    ./practice
    

    Launch Ghidra when needed:

    ghidra
    

    Reading Assembly: A 10-Minute Crash Course

    Assembly represents the instructions executed by the processor. GDB and objdump can display Intel syntax, where the destination usually appears before the source.

    Core registers

    RegisterCommon role
    raxReturn value and general calculations
    rbxGeneral-purpose, callee-saved register
    rcxFourth function argument and general-purpose register
    rdxThird function argument and arithmetic data
    rsiSecond function argument
    rdiFirst function argument
    rspStack pointer
    rbpOptional stack-frame base pointer
    ripInstruction pointer

    The 32-bit lower part of rax is eax. Writing to eax also clears the upper half of rax.

    Instructions to recognize

  • mov destination, source: copies data
  • lea destination, source: calculates an address
  • cmp left, right: compares values by setting flags
  • test left, right: performs a bitwise test and sets flags
  • jmp address: unconditional branch
  • je or jz: jump when equal or zero
  • jne or jnz: jump when not equal or not zero
  • call function: calls another function
  • ret: returns to the saved address
  • push and pop: add or remove values from the stack
  • A simplified control-flow fragment might look like this:

    ; Illustrative Intel syntax
    push rbp
    mov  rbp, rsp
    call check_password
    cmp  eax, 0
    je   denied
    lea  rdi, [rip + granted_message]
    call puts
    jmp  done
    
    denied:
    lea  rdi, [rip + denied_message]
    call puts
    
    done:
    pop  rbp
    ret
    

    check_password returns its result in eax. The comparison sets processor flags. je denied follows the failure branch when the return value is zero.

    A traditional stack frame begins with:

    push rbp
    mov rbp, rsp
    sub rsp, 0x40
    

    That reserves local stack space. Modern optimized programs may omit rbp, keep variables in registers, combine operations, or inline entire functions. That is why beginner labs should start with -O0.

    Worked Example: Cracking a Practice Binary

    This walkthrough applies only to the self-compiled practice binary. "Cracking" here means solving an intentionally weak lab challenge, not bypassing a real product's licensing or authentication.

    Addresses and displayed disassembly vary by GCC, library, and Kali version. Outputs below are labeled illustrative; use the addresses and instructions shown on your own system.

    1. Observe normal behavior

    Run the program and enter an incorrect value:

    $ ./practice
    Enter password: wrong
    Access denied.
    

    This establishes the behavior you want to explain.

    2. Perform quick static triage

    Inspect the file and ELF header:

    file ./practice
    readelf -h ./practice
    checksec --file=./practice
    

    Search its printable strings:

    strings -a -n 5 ./practice | grep -E 'password|Access|orbit'
    

    Illustrative output:

    orbit-lemur-42
    Enter password:
    Access granted.
    Access denied.
    

    The password is visible because the program stores it as an ordinary string literal. Finding a string is a clue, not proof of how it is used. You still need to locate its references and the controlling comparison.

    3. Inspect the disassembly

    List the function symbol:

    nm ./practice | grep check_password
    

    Disassemble that function using Intel syntax:

    objdump -d -M intel --disassemble=check_password ./practice
    

    An illustrative sequence will resemble:

    mov    rax, QWORD PTR [rbp-0x18]   ; the entered string (first argument)
    lea    rdx, [rip+...]              ; address of "orbit-lemur-42"
    mov    rsi, rdx                    ; second argument: expected string
    mov    rdi, rax                    ; first argument: entered string
    call   strcmp@plt
    test   eax, eax
    sete   al
    movzx  eax, al
    ret
    

    strcmp returns zero when two strings match. The compiler converts that result into the Boolean value returned by check_password.

    Review the wider program when needed:

    objdump -d -M intel ./practice | less
    

    4. Confirm the logic in Ghidra

    Start Ghidra:

    ghidra
    

    Create a non-shared project, import ~/re-lab/practice, accept the detected ELF format, and run the default analysis. Open check_password from Symbol Tree > Functions.

    The decompiler should show logic similar to this illustrative pseudocode:

    int check_password(char *input)
    {
        return strcmp(input, "orbit-lemur-42") == 0;
    }
    

    Select the password string and display its references. One reference should lead back to check_password. Then inspect main and follow the call to see how its return value selects the granted or denied message.

    5. Override the return value in GDB

    Start GDB:

    gdb ./practice
    

    Use the following commands:

    (gdb) set disassembly-flavor intel
    (gdb) info functions
    (gdb) break main
    (gdb) break check_password
    (gdb) run
    

    GDB first stops at main. Continue, then enter an incorrect password:

    (gdb) continue
    Enter password: wrong
    Breakpoint 2, check_password (...)
    

    On x86-64 Linux, the first pointer argument is in rdi:

    (gdb) x/s $rdi
    

    Illustrative output:

    0x7fffffffe000: "wrong"
    

    You can inspect instructions or execute one instruction at a time:

    (gdb) disassemble check_password
    (gdb) x/10i $rip
    (gdb) stepi
    

    Restart the session if needed, stop at check_password, and let the function finish:

    (gdb) finish
    

    GDB should stop in main immediately after the call. The incorrect comparison normally returned zero in rax. Change that transient return value:

    (gdb) set $rax = 1
    (gdb) continue
    

    Illustrative result:

    Access granted.
    

    This is a runtime state patch. It changes only the current process; it does not modify practice on disk.

    An alternative is to run disassemble main, identify the first instruction of the granted block, stop at the conditional branch, and use:

    (gdb) jump *ADDRESS_OF_GRANTED_BLOCK
    

    Replace the placeholder with the address from your current GDB session. Never copy an address from another build. Jumping into the middle of a block can corrupt stack or register state, so use this only in your disposable practice program.

    Static Analysis with Ghidra

    This section provides a compact Ghidra tutorial for repeating the workflow on your own binaries.

  • Run ghidra and create a non-shared project.
  • Select File > Import File and choose the binary.
  • Confirm the detected language and compiler specification.
  • Open the imported program and allow auto-analysis to run.
  • Enable the Decompiler window through Window > Decompiler if it is hidden.
  • For an unstripped practice binary, find main and check_password under Symbol Tree > Functions. Selecting a function synchronizes the Listing and Decompiler windows.

    Useful analysis habits include:

  • Rename unidentified functions according to their observed purpose.
  • Rename variables only after collecting evidence about them.
  • Apply types to parameters, return values, and structures.
  • Search for Access granted or the password through Search > For Strings.
  • Select a string, function, or address and press X to view cross-references.
  • Follow callers and callees rather than reading functions in isolation.
  • Compare decompiled statements with the corresponding assembly.
  • Decompiler output is an informed reconstruction, not original source. If the C-like output appears suspicious, trust the instructions and observed runtime behavior over an attractive pseudocode guess.

    Dynamic Analysis with GDB

    GDB lets you stop a process at a specific instruction and inspect its live state.

    A useful session for the practice program is:

    $ gdb ./practice
    (gdb) set disassembly-flavor intel
    (gdb) set pagination off
    (gdb) break check_password
    (gdb) run
    Enter password: wrong
    (gdb) info registers
    (gdb) x/10i $rip
    (gdb) x/s $rdi
    

    To watch the two strings reach strcmp, set another breakpoint while stopped in check_password:

    (gdb) break strcmp
    (gdb) continue
    (gdb) x/s $rdi
    (gdb) x/s $rsi
    

    The first string should be the entered input and the second should be the expected password. Exact breakpoint names and addresses can differ because system libraries may use optimized strcmp implementations.

    Important stepping commands are:

  • step: enter the next source-level operation when debug information exists
  • next: execute the next source line without entering called functions
  • stepi: execute one machine instruction
  • nexti: execute one machine instruction while stepping over calls
  • finish: continue until the current function returns
  • continue: resume until another breakpoint or signal
  • When a program crashes, use info registers, x/i $rip, and backtrace before changing anything. Record the input, arguments, environment, and last successful instruction so the result can be reproduced.

    Finding Hidden Behavior: Strings, Imports and Network Calls

    Begin with a focused strings search:

    strings -a -n 5 ./practice | grep -Ei 'http|socket|token|password|/etc/|\.so'
    

    Strings can reveal paths, domains, commands, error messages, and configuration keys. They can also be unused, encoded, constructed at runtime, or deliberately misleading.

    Inspect relocations and dynamic symbols:

    readelf -r ./practice
    nm -D ./practice
    

    Search for functions associated with files, processes, or networking:

    nm -D ./practice | grep -E 'open|fopen|exec|system|socket|connect|getaddrinfo|send|recv'
    

    An imported function indicates capability, not confirmed behavior. Observe execution to determine whether a path actually calls it.

    Trace the authorized practice binary:

    printf 'wrong\n' | ltrace -f -o ltrace.log ./practice
    printf 'wrong\n' | strace -f -o strace.log ./practice
    

    Review potentially significant system calls:

    grep -E 'openat|execve|socket|connect|sendto|recvfrom' strace.log
    

    ltrace focuses on many library calls, while strace records system calls crossing into the kernel. Neither tool reveals every possible path from one execution.

    Common Binary Protections and How to Recognize Them

    Use file, checksec, readelf, Ghidra, and controlled execution to identify likely complications.

    Protection or complicationRecognitionBeginner response
    Stripped symbolsfile reports "stripped", or nm reports no symbolsUse strings, imports, cross-references, and control flow; obtain an authorized debug build when possible
    PIE and ASLRchecksec reports PIE; runtime addresses moveUse symbolic breakpoints, module-relative offsets, and addresses from the current run
    NX, canaries, and RELROReported by checksecTreat them as hardening context; they do not prevent ordinary reading or debugging
    Compiler optimizationVariables disappear, functions are inlined, and control flow changesCompare an -O0 build with an -O2 build of your own source
    UPX packingUPX markers, unusual sections, or successful upx -t testWork on a copy and use upx -d only when authorized
    Anti-debuggingChecks involving ptrace, timing, signals, or /proc/self/statusDocument the check first; practice on purpose-built labs rather than real software
    ObfuscationExcessive indirect branches, opaque conditions, encoded strings, or confusing dispatch loopsIsolate one function at a time and combine static and dynamic evidence

    For an authorized UPX sample, preserve the original and unpack a copy:

    cp authorized-sample authorized-sample.work
    upx -t authorized-sample.work
    upx -d authorized-sample.work
    

    A beginner should not expect to defeat custom packers, advanced virtualization, kernel anti-debugging, or sophisticated obfuscation immediately. Build fluency on simple, self-compiled programs first.

    Reverse Engineering vs Malware Analysis vs Debugging

    DisciplinePrimary goalTypical starting pointTypical tools
    Reverse engineeringUnderstand a finished program's design and logicA binary, firmware image, or file formatGhidra, GDB, objdump, radare2
    Malware analysisDetermine the capabilities and impact of suspected malicious codeAn untrusted sample handled under strict containmentStatic tools, debuggers, tracers, sandboxes
    DebuggingFind why a program behaves incorrectlyA reproducible defect, often with source codeGDB, logs, sanitizers, source-level debuggers

    The activities overlap. Malware analysis uses reverse engineering, while reverse engineering often uses debugging techniques. The main differences are the objective, authorization, and risk of execution.

    Practice Path: Crackmes and CTFs

    After mastering your own program, use purpose-built challenges from crackmes.one. Select beginner-level entries, read each author's terms, and treat every downloaded file as untrusted even when it is presented as a challenge.

    TryHackMe and Hack The Box also provide authorized training environments. Stay inside each platform's stated scope and do not transfer techniques to unrelated systems.

    WeekFocusPractice
    1C and ELF fundamentalsCompile small programs with conditions, loops, and string comparisons; inspect them with file, readelf, strings, and objdump
    2Ghidra workflowFind main, rename functions, follow string references, and compare decompiled output with source you wrote
    3GDB workflowBreak on functions, inspect arguments, step through branches, and compare registers before and after calls
    4Authorized challengesSolve simple crackmes without reading solutions first; document every conclusion and verify it dynamically

    Compile both optimized and unoptimized versions of your own code:

    gcc -g -O0 -o example-O0 example.c
    gcc -g -O2 -o example-O2 example.c
    

    Comparing them demonstrates why real binaries rarely resemble their original source exactly.

    Reverse Engineering Cheat Sheet

    Tool commands

    ToolCommandWhat it shows
    filefile ./practiceFile type, architecture, linking, and stripped status
    readelfreadelf -h ./practiceELF header and entry-point information
    stringsstrings -a -n 5 ./practicePrintable sequences of at least five characters
    objdumpobjdump -d -M intel ./practiceIntel-syntax disassembly
    nmnm ./practiceSymbols from an unstripped binary
    nmnm -D ./practiceDynamic symbols and imports
    xxdxxd -g 1 -l 64 ./practiceFirst 64 bytes in hexadecimal
    checksecchecksec --file=./practiceCommon binary hardening properties
    ltraceltrace ./practiceMany dynamic library calls
    stracestrace -f ./practiceSystem calls, signals, and child processes
    GhidraghidraLaunches the graphical analysis suite
    GDBgdb ./practiceStarts a debugging session
    radare2r2 -A ./practiceOpens the binary and runs automatic analysis

    GDB commands

    CommandPurpose
    info functionsLists known functions
    break mainSets a breakpoint at main
    break *0xADDRESSBreaks at a specific current-session address
    runStarts the program
    continueResumes execution
    step / nextSource-level step into or over
    stepi / nextiInstruction-level step into or over
    disassemble mainDisplays a function's instructions
    info registersDisplays register values
    x/10i $ripShows ten instructions at the instruction pointer
    x/s $rdiTreats the address in rdi as a C string
    x/32bx ADDRESSDisplays 32 individual bytes
    backtraceDisplays the current call stack
    finishRuns until the current function returns
    set $rax = 1Changes the x86-64 return register for the current process
    quitEnds the debugging session

    Troubleshooting Reverse Engineering Problems

    ProblemLikely cause and response
    Ghidra won't start or reports a Java errorRun it from a terminal to read the error, check java -version, and reinstall the packaged dependencies with sudo apt install --reinstall ghidra. Use the Java version required by the installed Ghidra package.
    The binary is strippedFunction names and debug metadata were removed. Start from imports, strings, entry points, cross-references, and recognizable library-call patterns.
    nm reports no symbolsTry nm -D for dynamic symbols. A fully static stripped binary may expose very few names, so use Ghidra's function discovery and control-flow analysis.
    GDB says "no debugging symbols found"Assembly debugging still works. For your own program, rebuild with -g -O0 to restore source lines, types, and local-variable information.
    PIE or ASLR makes addresses changeUse function names and addresses from the current run. For your own lab, set disable-randomization on can help, but symbolic breakpoints are more portable.
    The program crashes under GDBConfirm arguments, input, working directory, environment, and signals. Use backtrace, info registers, and x/i $rip before applying patches.
    Ghidra's decompiler output is unreadableConfirm the architecture, rerun analysis, inspect assembly, apply accurate types, rename proven concepts, and analyze smaller functions first.
    The binary appears UPX-packedTest only an authorized copy with upx -t, preserve the original, and use upx -d if the format is supported. Custom packers require more advanced analysis.

    Common Mistakes Beginners Make

  • Trusting strings as proof. A string can be unused, decoy data, or referenced only on an unreachable path.
  • Treating decompiled code as exact source. Validate types, branches, and arithmetic against assembly.
  • Starting with an optimized commercial application. Begin with self-compiled -O0 programs and authorized crackmes.
  • Stepping through every instruction. Use strings, imports, cross-references, and breakpoints to narrow the search.
  • Ignoring architecture and calling conventions. Register roles differ between x86-64, x86, ARM, and other targets.
  • Changing many values at once. Make one runtime modification, record it, and retest from a clean run.
  • Forgetting authorization and containment. A technically possible analysis may still violate a license, contract, or law.
  • Best Practices

  • Work only on binaries you own or have explicit permission to analyze.
  • Preserve the original and calculate a hash with sha256sum before modifying copies.
  • Keep notes containing addresses, function names, hypotheses, inputs, and observed results.
  • Validate static conclusions with controlled dynamic tests.
  • Use snapshots and minimal network access for downloaded training files.
  • Report discovered vulnerabilities through the owner's authorized disclosure process rather than testing unrelated deployments.
  • Summary

    Reverse engineering combines binary structure, C concepts, assembly, static analysis, and runtime observation. Start with a program you compiled yourself, use strings and imports to form hypotheses, inspect the logic in Ghidra, and confirm it with GDB.

    The essential learning loop is simple: observe, hypothesize, test, document, and repeat. Once that workflow is comfortable, progress to beginner crackmes and authorized CTF environments instead of real commercial software.

    Knowledge Check

  • What is the main difference between static and dynamic analysis?
  • Which x86-64 register normally carries the first pointer argument on Linux?
  • Which ELF section usually contains executable instructions?
  • Why does finding a string not prove that the program uses it?
  • What do -g and -O0 do when compiling a practice binary?
  • Which command lists a binary's dynamic symbols?
  • Why did setting rax to 1 change the result in the practice program?
  • What authorization should you obtain before analyzing someone else's binary?
  • Answers: 1. Static analysis does not run the binary; dynamic analysis observes an execution. 2. rdi. 3. .text. 4. It may be unused, unreachable, or misleading. 5. -g adds debug information and -O0 minimizes optimization. 6. nm -D ./binary. 7. rax held the x86-64 integer return value tested by main. 8. Explicit permission that covers the planned analysis.

    Keep Learning

  • Linux Privilege Escalation Guide
  • Malware Basics
  • Malware Analysis Guide
  • Steganography Tools Guide
  • Command Line Essentials
  • Netcat Guide
  • Metasploit Fundamentals
  • Ghidra
  • Radare2
  • Binwalk
  • Nmap
  • Frequently Asked Questions

    What is reverse engineering?

    Reverse engineering is the process of examining a finished program, binary, device, or format to understand its structure and behavior. In software, this commonly involves inspecting strings, machine instructions, imported functions, decompiled code, memory, and runtime activity. It should be performed only on your own software or with explicit authorization.

    How do I learn reverse engineering from scratch?

    Start with basic C, Linux command-line skills, ELF structure, and a small amount of x86-64 assembly. Compile simple programs yourself, inspect them with file, strings, readelf, and objdump, then compare the source with Ghidra's decompiler. Use GDB to verify arguments, branches, and return values before moving to authorized beginner crackmes.

    Is reverse engineering legal?

    It depends on the jurisdiction, purpose, license, contract, and software involved. Analyzing your own code and explicitly authorized training challenges is the safest approach. A EULA or anti-circumvention law may restrict activities that are technically possible. Obtain written permission for third-party binaries and consult a qualified lawyer when the scope is uncertain.

    What is the best tool for reverse engineering beginners?

    Ghidra is an excellent first static-analysis tool because it combines disassembly, decompilation, strings, cross-references, and annotations in one interface. Pair it with GDB for runtime analysis. Command-line tools such as file, strings, readelf, nm, and objdump remain important because they provide quick, focused evidence.

    How long does it take to learn reverse engineering?

    There is no fixed timeline. Basic comfort with simple self-compiled binaries can develop after consistent practice, while fluency with optimized code, unfamiliar architectures, complex data structures, packing, and obfuscation takes much longer. Progress depends more on regular hands-on analysis and careful documentation than on finishing a single course.

    Do I need to know assembly to reverse engineer?

    You can begin before mastering assembly, especially with Ghidra's decompiler, but you eventually need to read basic instructions and control flow. Focus first on registers, function arguments, return values, stack frames, mov, comparisons, conditional jumps, call, and ret. Decompiler output should always be checked against assembly when accuracy matters.

    What is Ghidra and is it free?

    Ghidra is a free, open-source software reverse engineering suite originally developed by the US National Security Agency. It supports many architectures and file formats and includes disassembly, decompilation, scripting, cross-references, data types, and collaborative analysis features. On Kali Linux, install it with sudo apt install ghidra and run it with ghidra.

    Can I reverse engineer Android apps?

    Yes, if you own the app or have explicit authorization. Android analysis can involve APK resources, manifests, Java or Kotlin bytecode, and native .so libraries. The workflow and tools differ from native Linux ELF analysis. App licenses, user data, signing controls, and platform rules still apply, so use a test device or emulator and your own applications first.

    What is the difference between reverse engineering and malware analysis?

    Reverse engineering is the broader process of understanding a finished system or program. Malware analysis applies reverse engineering and behavioral techniques specifically to suspected malicious code to determine its capabilities and impact. Malware analysis requires stronger containment because executing a sample can damage systems, expose data, or communicate with external infrastructure.

    How do I start with crackmes?

    First solve the self-compiled password program in this guide. Then select beginner challenges from crackmes.one whose authors permit analysis. Use an isolated VM, preserve the original file, begin with static triage, and test one hypothesis at a time in a debugger. Avoid reading solutions until you have documented your own approach.

    Can reverse engineering get me a job?

    Reverse engineering is relevant to malware analysis, vulnerability research, incident response, product security, digital forensics, embedded security, compatibility engineering, and security-tool development. Employers also value supporting skills such as C, operating systems, debugging, scripting, technical writing, and responsible disclosure. A portfolio of authorized write-ups and original lab programs can demonstrate those skills.

    Is reverse engineering hard?

    It can be challenging because compiled code loses source-level names and may be optimized, stripped, packed, or obfuscated. It becomes manageable when you analyze small functions, use both static and dynamic evidence, and practice on programs whose source you can compare afterward. Beginners do not need to understand an entire binary at once.

    Continue Learning

    Ethical Hacking · Intermediate

    Malware Analysis: Beginner's Guide to Static & Dynamic Analysis in Kali Linux

    Learn malware analysis from scratch: build a safe isolated lab, triage samples with static and dynamic analysis, write YARA rules, and report IOCs.

    Ethical Hacking · Beginner

    Steganography Tools: Best Free Tools to Hide & Detect Hidden Data in Kali Linux

    Learn the best free steganography tools for Kali Linux: hide files in images with Steghide and OpenStego, then detect hidden data with zsteg.

    Ethical Hacking · Intermediate

    Cloud Penetration Testing: Complete Guide to AWS, Azure and GCP Security Testing

    Cloud penetration testing for AWS, Azure, and GCP: the 6-phase methodology, IAM analysis, chained attack paths, and tools — with a worked lab example.

    Ethical Hacking · Beginner

    Ethical Hacking Fundamentals: Principles, Methodology, and Best Practices

    Learn the core principles of ethical hacking, the five-phase penetration testing methodology, types of security testing, and how to build your own hacking lab.

    Related Security Tools

    Reverse Engineering

    GDB

    Learn how to use GDB, the GNU Debugger, by building a small C program with debug symbols and following it from the first breakpoint to a crash. Use the same steps to inspect variables, read a backtrace, and tell when a core dump or a look at the assembly would help.

    Reverse Engineering

    Ghidra

    This hands-on guide shows how to use Ghidra to inspect a program you compile yourself. You'll compare decompiled code with the underlying assembly, follow cross-references, and document what the binary does without executing it.

    Reverse Engineering

    Frida

    Frida is a dynamic instrumentation toolkit for developers, reverse-engineers, and security researchers. It allows you to inject snippets of JavaScript or your own library into native apps on various platforms — making it the industry standard for runtime analysis and mobile app security testing.

    Reverse Engineering

    Objection

    Objection is a runtime mobile exploration toolkit, powered by Frida, built to help you assess the security of your mobile applications without needing a jailbroken or rooted device.

    Written by GO KALI FREE Team