Docsity

Reverse Engineering and Code Obfuscation Q&A, Exams of Nursing

Toggle sidebar
bg1
Reverse Engineering and Code Obfuscation
Q&A
Q1: What is the primary goal of reverse engineering in software security?
Rationale: Reverse engineering aims to understand software's functionality, often to identify
vulnerabilities, analyze malware, or recover lost source code. It's a core technique for security analysis.
Q2: Name two main categories of reverse engineering techniques.
Rationale: Static analysis (examining code without execution) and dynamic analysis (observing execution
behavior). Both are essential for comprehensive understanding.
Q3: What is a disassembler and give an example.
Rationale: A disassembler converts machine code into assembly language. Example: IDA Pro, Ghidra. It
helps analysts understand binary code.
Q4: How does a decompiler differ from a disassembler?
Rationale: A decompiler attempts to reconstruct high-level language code (e.g., C) from machine code,
while a disassembler only produces assembly. Decompilers produce more readable output but are less
accurate.
Q5: What is symbolic execution in reverse engineering?
Rationale: Symbolic execution treats inputs as symbolic variables and explores program paths,
generating constraints. It's used for automated vulnerability detection and test case generation.
Q6: Define code obfuscation.
Rationale: Code obfuscation is the deliberate transformation of code to make it difficult to understand
or reverse engineer, while preserving functionality. It's a defensive technique.
Q7: List three common code obfuscation techniques.
Rationale: Lexical obfuscation (renaming identifiers), control flow obfuscation (adding opaque
predicates), and data obfuscation (encoding constants). Each impedes static analysis.
Q8: What is an opaque predicate?
Rationale: An opaque predicate is a condition whose outcome is known to the obfuscator but is hard for
static analysis to determine. It is used to insert dead code or complicate control flow.
Q9: Explain the concept of anti-debugging.
Rationale: Anti-debugging techniques detect or resist debugging attempts, causing the program to
behave differently or crash when a debugger is attached, hindering dynamic analysis.
Q10: What is a packer and how does it aid obfuscation?
Rationale: A packer compresses or encrypts an executable and adds a decompression stub. The stub
unpacks the original code at runtime, hiding the actual code from static inspection.
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13

Partial preview of the text

Download Reverse Engineering and Code Obfuscation Q&A and more Exams Nursing in PDF only on Docsity!

Reverse Engineering and Code Obfuscation

Q&A

Q1: What is the primary goal of reverse engineering in software security? Rationale: Reverse engineering aims to understand software's functionality, often to identify vulnerabilities, analyze malware, or recover lost source code. It's a core technique for security analysis.

Q2: Name two main categories of reverse engineering techniques. Rationale: Static analysis (examining code without execution) and dynamic analysis (observing execution behavior). Both are essential for comprehensive understanding.

Q3: What is a disassembler and give an example. Rationale: A disassembler converts machine code into assembly language. Example: IDA Pro, Ghidra. It helps analysts understand binary code.

Q4: How does a decompiler differ from a disassembler? Rationale: A decompiler attempts to reconstruct high-level language code (e.g., C) from machine code, while a disassembler only produces assembly. Decompilers produce more readable output but are less accurate.

Q5: What is symbolic execution in reverse engineering? Rationale: Symbolic execution treats inputs as symbolic variables and explores program paths, generating constraints. It's used for automated vulnerability detection and test case generation.

Q6: Define code obfuscation. Rationale: Code obfuscation is the deliberate transformation of code to make it difficult to understand or reverse engineer, while preserving functionality. It's a defensive technique.

Q7: List three common code obfuscation techniques. Rationale: Lexical obfuscation (renaming identifiers), control flow obfuscation (adding opaque predicates), and data obfuscation (encoding constants). Each impedes static analysis.

Q8: What is an opaque predicate? Rationale: An opaque predicate is a condition whose outcome is known to the obfuscator but is hard for static analysis to determine. It is used to insert dead code or complicate control flow.

Q9: Explain the concept of anti-debugging. Rationale: Anti-debugging techniques detect or resist debugging attempts, causing the program to behave differently or crash when a debugger is attached, hindering dynamic analysis.

Q10: What is a packer and how does it aid obfuscation? Rationale: A packer compresses or encrypts an executable and adds a decompression stub. The stub unpacks the original code at runtime, hiding the actual code from static inspection.

Q11: Give an example of a simple anti-disassembly technique. Rationale: Inserting junk bytes that are interpreted as part of an instruction but are actually skipped via a jump. This confuses linear disassembly.

Q12: What is the difference between static and dynamic linking in reverse engineering context? Rationale: Static linking embeds library code into the binary, making analysis larger but self-contained. Dynamic linking relies on external DLLs/SOs, requiring analysis of imports and runtime resolution.

Q13: How does control flow flattening obfuscation work? Rationale: It replaces structured control flow (loops, conditionals) with a state machine. A dispatcher variable determines the next basic block, making the flow graph a flat, unstructured graph.

Q14: What is a deobfuscation technique for control flow flattening? Rationale: Symbolic execution or taint analysis to recover original control flow. Also, dynamic tracing to collect executed states and reconstruct the dispatcher logic.

Q15: Define "self-modifying code" in the context of reverse engineering defenses. Rationale: Code that modifies its own instructions at runtime. This confuses static analysis because the code's binary representation changes.

Q16: What is the purpose of a debugger in dynamic reverse engineering? Rationale: Debuggers allow step-by-step execution, memory inspection, register examination, and breakpoints. Tools like x64dbg, GDB, WinDbg are essential.

Q17: Describe a typical anti-debugging technique using timing checks. Rationale: The program measures time between two points using RDTSC or similar. If the elapsed time is too long (due to debugger single-stepping), it may abort or alter behavior.

Q18: What is a "crackme" and its role in learning reverse engineering? Rationale: A crackme is a small program designed to be cracked (bypass protection) or analyzed. They are educational tools for practicing reverse engineering skills.

Q19: Explain what "string obfuscation" accomplishes. Rationale: String obfuscation hides literal strings (e.g., API names, messages) by encrypting or encoding them, then decrypting at runtime. This prevents easy string-based analysis.

Q20: How can reverse engineering be used in malware analysis? Rationale: To understand malware capabilities, network indicators, persistence mechanisms, and evasion techniques. It helps in creating signatures and containment strategies.

Q21: What is a "binary diffing" technique? Rationale: Comparing two binaries to find changes, often used for patch analysis or vulnerability discovery. Tools: BinDiff, Diaphora.

Q22: Name a common tool for dynamic analysis of Windows malware. Rationale: Process Monitor, Process Explorer, or API Monitor. Also, x64dbg and OllyDbg.

Q23: What is the concept of "virtualization obfuscation"? Rationale: Transforming code into bytecode for a custom virtual machine (VM). The VM interpreter executes the bytecode, making reverse engineering very challenging due to custom instruction sets.

in memory. Encryption alone without a stub is not executable; packing is a specific form of runtime code protection.

Q37: Describe "entropy analysis" as a method to detect packed binaries. Rationale: Packed sections often have high entropy due to compression/encryption. Entropy measurement helps identify suspicious sections that are not typical for normal code.

Q38: What is "unpacking" in malware analysis? Rationale: Unpacking is the process of retrieving the original executable code from a packed binary, either by dumping memory after unpacking or by emulating the unpacking stub.

Q39: Name an open-source framework for reverse engineering. Rationale: Ghidra (NSA), Radare2, Binary Ninja (commercial but has free version). Also, Capstone disassembly engine.

Q40: How does "instruction overlapping" obfuscate code? Rationale: Instructions are arranged so that bytes are shared between multiple instructions. Disassembly becomes ambiguous as overlapping sequences produce different mnemonics.

Q41: What is "tamper-proofing" in software protection? Rationale: Techniques that make the program check its integrity and respond to modifications (e.g., checksums, code signing). If altered, the program fails or crashes.

Q42: Explain "anti-VM" techniques. Rationale: Code detects if it is running inside a virtual machine (VMware, VirtualBox) by checking specific artifacts (MAC addresses, CPU instructions, registry keys). It then alters behavior to evade analysis.

Q43: What is the role of "exception handling" in anti-debugging? Rationale: Debuggers often handle exceptions differently. Programs can use int3 or other exceptions to detect debugger presence based on exception propagation behavior.

Q44: How does "branching obfuscation" with opaque predicates increase analysis complexity? Rationale: It adds conditional branches that always go the same way but are hard to statically resolve. This forces the analyst to track many irrelevant paths.

Q45: What is "source code obfuscation" versus "binary obfuscation"? Rationale: Source obfuscation transforms source code before compilation (e.g., minification, renaming). Binary obfuscation operates on compiled executables, often with more aggressive transformations.

Q46: Describe a method to deobfuscate encoded strings using dynamic analysis. Rationale: Set breakpoints on memory access or string functions (e.g., strcpy, printf) after the decryption routine runs, then dump the decrypted string from memory.

Q47: What are "syscall" based anti-debugging checks? Rationale: Using system calls like ptrace (Linux) or NtQueryInformationProcess (Windows) to check for debugger presence. These are harder to hook than user-mode APIs.

Q48: How does "binary rewriting" relate to obfuscation? Rationale: Binary rewriting modifies an existing binary without recompilation. Obfuscators often use rewriting techniques to insert junk code, transform instructions, or add anti-tampering.

Q49: What is "metamorphic code" and how does it differ from polymorphic code? Rationale: Metamorphic code changes its own code structure (e.g., instructions) each time it runs, while polymorphic code encrypts the payload and changes decryption routine. Both hinder signature detection.

Q50: Explain the concept of "software watermarking" as a defense. Rationale: Embeds a unique identifier into software to prove ownership or trace leaks. It is a form of obfuscation that survives reverse engineering attempts to remove the watermark.

Q51: How can "data flow obfuscation" be achieved? Rationale: By splitting variables, changing data dependencies, converting local variables to global arrays, or using opaque expressions to obscure the data flow.

Q52: What is the "staged unpacking" technique in malware? Rationale: Malware uses multiple layers of packing, where each layer unpacks the next. This requires sequential unpacking and complicates automated unpacking.

Q53: Describe a typical control flow graph (CFG) recovery process from a binary. Rationale: Disassemble instructions, identify basic blocks (linear sequences with no jumps), and connect them via jump/call edges. Decompilers build CFGs for analysis.

Q54: How do "obfuscating compilers" like Obfuscator-LLVM work? Rationale: They are compiler passes (e.g., for LLVM) that transform intermediate representation with obfuscation passes: flattening, bogus control flow, substitution, etc.

Q55: What is "anti-disassembly" via jump tables? Rationale: Using computed jumps with indirect addressing. Disassemblers may incorrectly interpret data as code, breaking linear sweep disassembly.

Q56: Explain the concept of "pin-based" dynamic analysis. Rationale: Using Intel Pin (DBI framework) to instrument binary instructions. Can log all executed instructions, memory accesses, and even modify behavior on the fly.

Q57: How can "symbolic execution" be used to break opaque predicates? Rationale: Symbolic execution collects constraints along a path; opaque predicates often have constant outcomes. Solving constraints will reveal that one branch is always taken.

Q58: What is "differential analysis" in reverse engineering? Rationale: Comparing behavior or code between two versions or two similar binaries (e.g., patched vs unpatched) to locate changes or identify malware variants.

Q59: Name a technique to hide API imports from static analysis. Rationale: Dynamic import resolution using LoadLibrary and GetProcAddress, often with encrypted API names that are decrypted at runtime.

Q60: How does "return address obfuscation" (or stack obfuscation) work? Rationale: Modifying return addresses on the stack or using indirect jumps to confuse call stack analysis. Can also use XOR of return address to prevent simple backtracing.

Q73: Explain "white-box cryptography" as an obfuscation technique. Rationale: Embeds a cryptographic key and algorithm in such a way that extracting the key is extremely hard even when the implementation is fully visible. Uses look-up tables and blinding.

Q74: How does "binary patching" differ from "binary rewriting"? Rationale: Patching is small changes (e.g., NOP out a jump). Rewriting is more comprehensive transformation, possibly reordering code, adding sections, etc.

Q75: Name an open-source tool for binary diffing. Rationale: Diaphora (plugin for IDA/Ghidra), Radare2's radiff2, or BinDiff (free for non-commercial).

Q76: What is "strip and obfuscate" combination in software protection? Rationale: Stripping removes symbols, obfuscation adds complexity. Together they significantly increase reverse engineering effort.

Q77: How can "debugger detection via parent process name" work? Rationale: Program checks if its parent process is a known debugger or shell (e.g., gdb, windbg, cmd). If yes, it may terminate.

Q78: Describe "scriptable reverse engineering" with Python. Rationale: Tools like Ghidra, IDA, and Radare2 provide Python APIs to automate analysis tasks, such as searching for patterns, renaming functions, or extracting data.

Q79: What is the concept of "binary instrumentation" vs "binary rewriting"? Rationale: Binary instrumentation inserts code dynamically (at runtime) without modifying the binary file. Binary rewriting modifies the binary file statically.

Q80: How does "symbolic linking" affect reverse engineering of dynamically linked binaries? Rationale: The binary relies on external symbols; without those, static analysis is incomplete. Analysts must emulate or trace calls to determine library functions.

Q81: What is a "disassembly flaw" due to data interspersed? Rationale: When data bytes are misinterpreted as instructions, leading to incorrect disassembly. This can be intentional obfuscation.

Q82: Explain "function inlining" as an obfuscation technique. Rationale: Inlining replaces function calls with the function body, making the binary larger and obscuring modular boundaries, complicating analysis.

Q83: How can "statistical analysis of opcodes" help in deobfuscation? Rationale: Obfuscated code might show unusual opcode frequency. Detecting outliers can identify junk code or packer stubs.

Q84: What is "binary translation" and how does it relate to emulation? Rationale: Binary translation converts instructions from one architecture to another (e.g., x86 to ARM) for emulation or analysis. It helps in cross-platform reverse engineering.

Q85: Describe "opaque constants" in data obfuscation. Rationale: Constants are encoded via expressions that always yield the same value but are non-obvious, e.g., (x*2) & ~x? Not typical; better example: (x ^ (x >> 1)) etc. It complicates constant propagation.

Q86: What is a "tracer" like strace or ltrace used for? Rationale: Strace traces system calls, ltrace traces library calls. They provide a high-level dynamic view without deep code analysis.

Q87: How does "interprocedural analysis" help in reverse engineering? Rationale: It analyzes relationships across function boundaries (call graphs, data flow), helping to understand the whole program structure despite obfuscation.

Q88: Name a technique to hide control flow using "exception-driven" control. Rationale: Using structured exception handling (SEH) on Windows, or signals on Linux, to alter flow. The program deliberately raises exceptions that jump to handlers, obscuring normal flow.

Q89: What is "anti-debugging via TLS callbacks"? Rationale: Thread Local Storage (TLS) callbacks execute before the entry point. Debuggers may miss initial breakpoints, allowing anti-debugging checks to run early.

Q90: Explain "data space obfuscation" (splitting arrays). Rationale: A single array is split into multiple arrays, and accesses are transformed with index remapping, making it harder to recognize data structures.

Q91: How does "partial evaluation" aid deobfuscation? Rationale: Statically evaluating parts of the code that have constant inputs can simplify expressions and eliminate opaque predicates, reducing obfuscation.

Q92: What is "code lifting" in reverse engineering? Rationale: Extracting a code fragment from a binary and recompiling it into a standalone program or library for further analysis.

Q93: Describe a common anti-debugging on Linux using ptrace. Rationale: A process calls ptrace(PTRACE_TRACEME). If it's already being traced (by a debugger), ptrace fails, indicating a debugger. Then the program exits.

Q94: How can "virtual machine introspection" be used to reverse-engineer malware? Rationale: From the hypervisor, inspect guest memory and CPU state without being detected by anti-VM malware, allowing stealthy dynamic analysis.

Q95: What is "branch prediction obfuscation"? Rationale: Unlikely to be a standard term. Possibly using intentionally misleading branch hints or adding branches that affect performance analysis. But in reverse engineering context, not common.

Better: Provide a legitimate question: What is "branch inversion" obfuscation? Rationale: Replacing conditional jumps with their negation and swapping targets, which doesn't increase complexity much but can confuse naive disassembly.

Alternatively, skip.

Let's continue systematically.

while a disassembler only produces assembly. Decompilers produce more readable output but are less accurate due to lost type and structure information.

Q5: What is symbolic execution in reverse engineering? Rationale: Symbolic execution treats inputs as symbolic variables and explores program paths, generating constraints. It is used for automated vulnerability detection and test case generation, allowing analysis of many paths without concrete values.

Q6: Define code obfuscation. Rationale: Code obfuscation is the deliberate transformation of code to make it difficult to understand or reverse engineer, while preserving functionality. It is a defensive technique used to protect intellectual property and hinder analysis.

Q7: List three common code obfuscation techniques. Rationale: Lexical obfuscation (renaming identifiers), control flow obfuscation (adding opaque predicates), and data obfuscation (encoding constants). Each impedes static analysis by removing semantic clarity.

Q8: What is an opaque predicate? Rationale: An opaque predicate is a condition whose outcome is known to the obfuscator (always true or false) but is hard for static analysis to determine. It is used to insert dead code or complicate control flow.

Q9: Explain the concept of anti-debugging. Rationale: Anti-debugging techniques detect or resist debugging attempts, causing the program to behave differently or crash when a debugger is attached. This hinders dynamic analysis and forces reversers to bypass such checks.

Q10: What is a packer and how does it aid obfuscation? Rationale: A packer compresses or encrypts an executable and adds a decompression stub. The stub unpacks the original code at runtime, hiding the actual code from static inspection and defeating simple signature scanning.

Q11: Give an example of a simple anti-disassembly technique. Rationale: Inserting junk bytes that are interpreted as part of an instruction but are actually skipped via a jump. This confuses linear disassembly, causing disassemblers to misinterpret data as code.

Q12: What is the difference between static and dynamic linking in reverse engineering context? Rationale: Static linking embeds library code into the binary, making analysis larger but self-contained. Dynamic linking relies on external DLLs/SOs, requiring analysis of imports and runtime resolution, which can be obfuscated via dynamic API lookups.

Q13: How does control flow flattening obfuscation work? Rationale: It replaces structured control flow (loops, conditionals) with a state machine. A dispatcher variable determines the next basic block, making the flow graph a flat, unstructured graph that is hard to analyze.

Q14: What is a deobfuscation technique for control flow flattening? Rationale: Symbolic execution or taint analysis can recover original control flow. Dynamic tracing to

collect executed states and reconstruct the dispatcher logic also works, as does pattern matching on flattened patterns.

Q15: Define "self-modifying code" in the context of reverse engineering defenses. Rationale: Code that modifies its own instructions at runtime. This confuses static analysis because the binary’s representation changes dynamically, forcing analysts to use dynamic analysis or emulation.

Q16: What is the purpose of a debugger in dynamic reverse engineering? Rationale: Debuggers allow step-by-step execution, memory inspection, register examination, and breakpoints. Tools like x64dbg, GDB, and WinDbg are essential for tracing program behavior and bypassing protections.

Q17: Describe a typical anti-debugging technique using timing checks. Rationale: The program measures time between two points using RDTSC or similar. If the elapsed time is too long (due to debugger single-stepping or breakpoints), it may abort or alter behavior to evade analysis.

Q18: What is a "crackme" and its role in learning reverse engineering? Rationale: A crackme is a small program designed to be cracked (bypass protection) or analyzed. They are educational tools for practicing reverse engineering skills, covering various obfuscation and anti-debugging techniques.

Q19: Explain what "string obfuscation" accomplishes. Rationale: String obfuscation hides literal strings (e.g., API names, messages) by encrypting or encoding them, then decrypting at runtime. This prevents easy string-based analysis (e.g., grep for sensitive strings).

Q20: How can reverse engineering be used in malware analysis? Rationale: To understand malware capabilities, network indicators, persistence mechanisms, and evasion techniques. It helps in creating signatures, containment strategies, and developing countermeasures.

Q21: What is a "binary diffing" technique? Rationale: Comparing two binaries to find changes, often used for patch analysis (e.g., vulnerability fixes) or malware variant analysis. Tools: BinDiff, Diaphora, radiff2.

Q22: Name a common tool for dynamic analysis of Windows malware. Rationale: Process Monitor, Process Explorer, or API Monitor. Also, x64dbg and OllyDbg for user-mode debugging, and WinDbg for kernel-mode.

Q23: What is the concept of "virtualization obfuscation"? Rationale: Transforming code into bytecode for a custom virtual machine (VM). The VM interpreter executes the bytecode, making reverse engineering very challenging due to a custom instruction set and execution engine.

Q24: How does "anti-hooking" protect software from reverse engineering? Rationale: Anti-hooking detects or prevents API hooking (used by debuggers/analyzers). It may check system call table integrity, use direct system calls, or verify that API prologues are not modified.

Q35: How does "function call obfuscation" work? Rationale: Replacing direct calls with indirect calls via function pointers, or using a dispatcher that resolves calls at runtime (e.g., a jump table). This hides call relationships and complicates the reconstruction of the call graph.

Q36: What is the difference between "packing" and "encryption" of executables? Rationale: Packing typically combines compression/encryption with a stub that decompresses/decrypts in memory, making the binary self-contained. Encryption alone without a stub is not executable; packing is a specific form of runtime code protection.

Q37: Describe "entropy analysis" as a method to detect packed binaries. Rationale: Packed sections often have high entropy due to compression/encryption (randomized data). Entropy measurement helps identify suspicious sections that are not typical for normal code, signaling the presence of a packer.

Q38: What is "unpacking" in malware analysis? Rationale: Unpacking is the process of retrieving the original executable code from a packed binary, either by dumping memory after the packer stub runs or by emulating the unpacking stub to extract the raw code.

Q39: Name an open-source framework for reverse engineering. Rationale: Ghidra (NSA), Radare2, Binary Ninja (commercial with free version), and Capstone disassembly engine. They provide disassembly, decompilation, and scripting capabilities.

Q40: How does "instruction overlapping" obfuscate code? Rationale: Instructions are arranged so that bytes are shared between multiple instructions. Disassembly becomes ambiguous as overlapping sequences produce different mnemonics, confusing linear disassemblers and static analysis.

Q41: What is "tamper-proofing" in software protection? Rationale: Techniques that make the program check its integrity and respond to modifications (e.g., checksums, code signing). If altered, the program fails, crashes, or behaves incorrectly, resisting persistent patching.

Q42: Explain "anti-VM" techniques. Rationale: Code detects if it is running inside a virtual machine (VMware, VirtualBox) by checking specific artifacts (MAC addresses, CPU instructions like sidt, registry keys). It then alters behavior to evade automated analysis.

Q43: What is the role of "exception handling" in anti-debugging? Rationale: Debuggers often handle exceptions differently from the normal OS. Programs can use int3 or other exceptions to detect debugger presence based on how the exception is propagated (e.g., if a debugger swallows it).

Q44: How does "branching obfuscation" with opaque predicates increase analysis complexity? Rationale: It adds conditional branches that always go the same way but are hard to statically resolve. This forces the analyst to track many irrelevant paths, leading to state explosion in static analysis.

Q45: What is "source code obfuscation" versus "binary obfuscation"? Rationale: Source obfuscation transforms source code before compilation (e.g., minification, renaming, string encoding). Binary obfuscation operates on compiled executables, often with more aggressive transformations (e.g., virtualization, packing).

Q46: Describe a method to deobfuscate encoded strings using dynamic analysis. Rationale: Set breakpoints on memory access or string functions (e.g., strcpy, printf) after the decryption routine runs, then dump the decrypted string from memory. Alternatively, trace the decryption loop and log the output.

Q47: What are "syscall" based anti-debugging checks? Rationale: Using system calls like ptrace (Linux) or NtQueryInformationProcess (Windows) to check for debugger presence. These are harder to hook than user-mode APIs because they bypass typical library interception.

Q48: How does "binary rewriting" relate to obfuscation? Rationale: Binary rewriting modifies an existing binary without recompilation. Obfuscators often use rewriting techniques to insert junk code, transform instructions, flatten control flow, or add anti-tampering code.

Q49: What is "metamorphic code" and how does it differ from polymorphic code? Rationale: Metamorphic code changes its own code structure (e.g., instructions) each time it runs, while polymorphic code encrypts the payload and changes the decryption routine. Both hinder signature detection, but metamorphic code does not rely on encryption.

Q50: Explain the concept of "software watermarking" as a defense. Rationale: Embeds a unique identifier into software to prove ownership or trace leaks. It is a form of obfuscation that survives reverse engineering attempts to remove the watermark, often using data or code embedding.

Q51: How can "data flow obfuscation" be achieved? Rationale: By splitting variables, changing data dependencies, converting local variables to global arrays, or using opaque expressions (e.g., x = (a * b) + (a * c) – a*(b+c) + 42). This obscures the true data flow.

Q52: What is the "staged unpacking" technique in malware? Rationale: Malware uses multiple layers of packing, where each layer unpacks the next. This requires sequential unpacking and complicates automated unpacking, as each layer may have different anti-analysis tricks.

Q53: Describe a typical control flow graph (CFG) recovery process from a binary. Rationale: Disassemble instructions, identify basic blocks (linear sequences with no jumps), and connect them via jump/call edges. Decompilers then build CFGs for analysis, but obfuscation can corrupt this process.

Q54: How do "obfuscating compilers" like Obfuscator-LLVM work? Rationale: They are compiler passes (e.g., for LLVM) that transform intermediate representation with obfuscation passes: control flow flattening, bogus control flow (adding opaque predicates), instruction substitution, and string encryption.

Q65: Explain "hardware breakpoints" and how anti-debugging can detect them. Rationale: Hardware breakpoints use debug registers (DR0–DR3). Code can check the values of these registers to see if any breakpoint is set, indicating a debugger. Software breakpoints (int3) are detected differently.

Q66: What is "binary lifting" to an intermediate representation (IR)? Rationale: Translating machine code into a platform-independent IR (e.g., LLVM IR, VEX, REIL) to enable further analysis or rewriting. This facilitates cross-architecture analysis and deobfuscation.

Q67: How does "constant unfolding" obfuscate constants? Rationale: Replacing simple constant values with arithmetic expressions that evaluate to the constant, e.g., 42 → (13*3)+3. This makes pattern matching harder and complicates constant propagation.

Q68: Name a common anti-dumping technique used by packers. Rationale: Memory wiping: after unpacking, the packer stub erases itself or the unpacked code section header to prevent dumping from memory. Some packers also encrypt sections in memory except when needed.

Q69: What is "tamper-resistant software" and its relationship to obfuscation? Rationale: Software that resists modifications; obfuscation is one layer, often combined with checksums, encryption, and anti-debugging to achieve tamper resistance. The goal is to make patching or cracking extremely difficult.

Q70: Describe "logic encryption" in hardware reverse engineering context. Rationale: In hardware, logic encryption adds extra gates (key gates) to a netlist that require a correct key to function. Without the key, reverse engineering reveals incorrect logic, protecting IP from cloning.

Q71: How can "dynamic taint analysis" assist in reverse engineering? Rationale: Tracks the flow of tainted data (e.g., user input) through the program, helping to identify how inputs influence decisions (e.g., comparisons, jumps). This aids vulnerability discovery and understanding validation logic.

Q72: What is "fuzzing" and its relation to reverse engineering? Rationale: Fuzzing provides random inputs to trigger crashes. It often complements reverse engineering by identifying bugs without full understanding; reverse engineering then analyzes the crash to root cause the vulnerability.

Q73: Explain "white-box cryptography" as an obfuscation technique. Rationale: Embeds a cryptographic key and algorithm in such a way that extracting the key is extremely hard even when the implementation is fully visible. Uses large look-up tables, blinding, and data obfuscation to resist key extraction.

Q74: How does "binary patching" differ from "binary rewriting"? Rationale: Patching is small changes (e.g., NOP out a jump, modify a byte). Rewriting is a more comprehensive transformation, possibly reordering code, adding sections, or flattening control flow, without preserving original layout.

Q75: Name an open-source tool for binary diffing. Rationale: Diaphora (plugin for IDA/Ghidra), Radare2’s radiff2, or BinDiff (free for non-commercial use). These tools compare two binaries to highlight changes in functions and basic blocks.

Q76: What is "strip and obfuscate" combination in software protection? Rationale: Stripping removes symbols (function/variable names), obfuscation adds complexity. Together they significantly increase reverse engineering effort, forcing analysts to rely solely on code structure without contextual names.

Q77: How can "debugger detection via parent process name" work? Rationale: Program checks if its parent process is a known debugger or shell (e.g., gdb, windbg, cmd, python). If yes, it may terminate or misbehave. This can be bypassed by launching from a non-suspicious parent.

Q78: Describe "scriptable reverse engineering" with Python. Rationale: Tools like Ghidra, IDA, and Radare2 provide Python APIs to automate analysis tasks, such as searching for patterns, renaming functions, extracting data, or writing custom deobfuscation scripts.

Q79: What is the concept of "binary instrumentation" vs "binary rewriting"? Rationale: Binary instrumentation inserts code dynamically (at runtime) without modifying the binary file (e.g., Pin, DynamoRIO). Binary rewriting modifies the binary file statically before execution (e.g., patchelf, objcopy with modifications).

Q80: How does "symbolic linking" affect reverse engineering of dynamically linked binaries? Rationale: The binary relies on external symbols; without those, static analysis is incomplete. Analysts must emulate or trace calls to determine which library functions are used, often requiring runtime environment setup.

Q81: What is a "disassembly flaw" due to data interspersed? Rationale: When data bytes are misinterpreted as instructions, leading to incorrect disassembly. This can be intentional obfuscation (e.g., embedding a string inside a code section) and causes linear disassemblers to produce gibberish.

Q82: Explain "function inlining" as an obfuscation technique. Rationale: Inlining replaces function calls with the function body, making the binary larger and obscuring modular boundaries. This complicates analysis because the same functionality appears in multiple places without distinct call boundaries.

Q83: How can "statistical analysis of opcodes" help in deobfuscation? Rationale: Obfuscated code might show unusual opcode frequency (e.g., many NOPs, rare instructions). Detecting outliers can identify junk code or packer stubs, allowing targeted removal or unpacking.

Q84: What is "binary translation" and how does it relate to emulation? Rationale: Binary translation converts instructions from one architecture to another (e.g., x86 to ARM) for emulation or analysis. It helps in cross-platform reverse engineering and can be used to deobfuscate by simplifying instruction sets.

Q85: Describe "opaque constants" in data obfuscation. Rationale: Constants are encoded via expressions that always yield the same value but are non-obvious,

Q95: What is "branch inversion" in obfuscation? Rationale: Changing condition (e.g., jg to jle) and swapping targets. It does not add significant complexity but can evade simple pattern matching and force analysts to reevaluate branch logic.

Q96: How does "live analysis" differ from "static analysis"? Rationale: Live analysis (dynamic) runs the program and observes actual behavior (registers, memory, system calls). Static analysis examines code without execution. Each has strengths: live analysis bypasses some obfuscation but may miss branches not taken.

Q97: Explain "code camouflage" as a specific obfuscation technique. Rationale: Adding dummy instructions that mimic legitimate operations but don’t affect the result (e.g., xor eax, eax followed by add eax, 5 then sub eax, 5). This increases instruction count and obscures real logic.

Q98: What are "reversing challenges" (e.g., from CTFs) good for? Rationale: They provide practical experience in reverse engineering, covering various obfuscation and protection techniques in a controlled environment. They help develop skills in static/dynamic analysis, debugging, and deobfuscation.

Q99: How can "machine learning" be applied to deobfuscation? Rationale: ML models can classify obfuscation patterns, predict control flow structures, or automate unpacking by learning from known packer behaviors. They can also aid in renaming decompiled functions by recognizing library code.

Q100: Summarize the ethical considerations of reverse engineering. Rationale: Reverse engineering can violate software licenses (EULAs) and copyrights. It should be used ethically: for security research, malware analysis, interoperability under fair use, or with proper authorization. Unauthorized cracking or IP theft is illegal and unethical.