INDEX

A

ABI (application binary interface), 100, 101, 103, 458

About Ghidra, 34

abstract base class (C++), 174

abstract function, 174

access control (Ghidra Server), 218, 221, 231

activation records. See stack frame.

Add Block (Memory Map toolbar), 370

addEntryPoint method, 383, 396

Add File to Version Control, 235

Add Functions, 539, 541

adding an analyzer module (Eclipse), 329, 337339

Add Reference dialog, 196

Add Reference from, 195

Address Interface, 298

getOffset method, 307310

AddressOfEntryPoint field, 369

address ranges, 531, 535

AddressSourceInfo object, 524, 525

address table, 10

Address Type overview bar, 480

addrinfo data type, 148, 149, 172

ai_socktype, 149

alignment gap, 520

ALT-left arrow hotkey (Go To Previous Location), 92, 93

ALT-right arrow hotkey (Go To Next Location), 92, 93

analysis

dynamic, 6, 491

static, 6, 12

analysis engine (Decompiler), 430

Analysis menu (CodeBrowser), 57

analysis options, 428, 429

analyzers, 50, 436

Analysis Options, 48, 49, 51

-analysisTimeoutPerFile (headless analyzer), 350, 351

Analyze All Open, 265, 283

analyzeHeadless, 342360

analyzeHeadlessREADME.html, 34, 342, 350, 352

analyzer, 428, 436

analyzer modules

example

ROP gadget, 329

template (Eclipse), 323, 328, 331

testing with Eclipse, 337

analyzers

creating with Eclipse, 329

decompiler, 428, 436

Decompiler, 428430

Decompiler Parameter ID, 50, 53, 109, 113

PE files, 110

Decompiler Switch Analysis, 50, 53

Function ID, 73, 272, 273, 278, 279, 283

headless, 340345, 347, 354, 357, 358

non-returning functions, 436

one shot, 265, 279

results, 51

RTTI, 181

Stack, 94

annotation, 128, 132, 153

anti-debug techniques, 505

anti-piracy protections, 505

anti-reverse engineering, 470

anti-reverse engineering tools, 471, 475, 490, 491

API (application programming interface), 52, 477, 489, 490, 500

application binary interface (ABI), 100, 101, 103, 458

application programming interface (API), 52, 477, 489, 490, 500

Apply Differences, 534, 537, 538

Apply Function Signature To Other Side, 546

applying structure layouts, 171

Apply Selection (hotkey F3), 537

architecture size, 263

Archive Current Project (Ghidra), 225

archives

creating data type archives, 269

creating new file archives, 271

creating new project archives, 272

data type archives, 268

arguments. See also parameters, 94113, 453, 454, 458, 464-466

ARM, 405, 418, 491

instructions, 9496, 113

arrays, 140, 144

Array type option (Ghidra), 156

base address, 150, 152, 153, 158, 159, 160, 170

bounds, 151

constant indices, 153, 154, 159, 160

create, 139

elements, 150153, 156, 158, 159, 169

globally allocated, 150, 154, 161

heap-allocated, 157, 158

index value, 150, 153, 156, 160, 161, 165

member access, 150

reference, 150, 160

stack-allocated, 154, 162

example, 155

static assignments, 156

of structures, 164

variable indices, 151, 153

Array type option (Ghidra), 156

articulation, 200

ASCII, 16, 28, 111, 183, 486

ASCII format export (Ghidra), 514, 522, 523

askAddress method, 300

askDirectory method, 301

askFile method, 301

askInt method, 300

askString method, 293, 300

askYesNo method, 300

ASPack, 19, 479, 496

ASProtect, 479

assembler (Ghidra), 513, 515518, 528

Assembler Rating, 516

assemblers, 4, 7, 9

assembly language

directives, 4

-a strings option, 29

Attach existing FidDb, 275

attaching FidDbs, 275

authentication

functions, 512

Ghidra Server, 219, 221, 227, 228, 230, 231

auto analysis, 5253, 90, 107, 110, 261, 265, 268, 273

Analysis Options, 48, 49, 51

options, 50

results, 51

Auto Analysis Summary dialog, 50

Auto Create Structure, 439, 441

automated structure creation, 437

automatic storage class (C++), 177

B

back references, 184, 185, 195

backward navigation (Go To Previous Location)

hotkey ALT-left arrow, 92, 93

hotkey OPTION-left arrow (Mac), 93

backward slice, 435

base address, 47

base address (array), 150, 152, 153, 158, 159, 160, 170

Base Library (FidDb), 277

base virtual address (PE files), 367, 369

basic block, 66, 67, 190, 198, 199, 203208, 428, 436

basic data transformations, 140

basic disassembly algorithm, 8

batch import, 226, 227, 346, 359

Batch Import dialog, 282

batch import (Ghidra), 282

batch import (headless analyzer), 346, 347, 359

Batch mode (import), 226, 227, 282

binaries, 4

ELF, 92

importing, 262, 264, 276, 278

stripped, 18, 152, 461, 465

binary differencing, 529

Binary format export (Ghidra), 522, 523, 525

binary search, 444, 446448

bitness, 263

breakpoints

hardware, 477, 489

software, 490

Browser Field Formatter, 65, 66, 133, 134, 247, 248, 419

.bss section, 71, 150, 153

buffer overflow, 184, 330

buildLanguage.xml, 404

build options (compiler), 152, 444, 451, 455

BuiltInTypes, 268

Burneye, 492, 493, 495, 496

byte code, 4

Byte Viewer, 514

editing, 513

Byte Viewer Options, 78, 514

Bytes window, 78, 79, 513, 514

options, 244

C

C/C++ format export (Ghidra), 522

C hotkey (Clear Code Bytes), 139, 473, 503

C language

calling conventions, 96

compilers, 160, 173, 176, 178, 181, 443, 448451, 453, 456, 459, 463, 465

format export (Ghidra), 522

malloc function, 157

strcpy function, 194

C++

abstract base class, 174

calling conventions, 99

compilers, 160, 443, 448451, 453457, 463465

compiler variations

function overloading, 458

RTTI, 459

constructor, 173, 177, 178, 181

delete operator, 178

destructors, 177, 179

dynamic_cast, 180, 181, 458460

inheritance, 172, 173, 179182, 459

multiple inheritance, 180

name mangling, 27, 179181, 458, 459

new operator, 157, 175, 178

object life cycle, 177

polymorphism, 172, 180

pure virtual function, 174, 175

reversing, 172

RTTI analyzer, 181

RTTI (Runtime Type Identification), 180, 181, 459461

storage class, 177

this pointer, 173, 176, 181

typeid, 180, 181, 458

vftable pointer, 173176, 178, 179

vftables, 173179, 181, 182, 191, 192, 194, 459, 460, 462, 463

vftables indexing, 176

virtual functions, 173176, 178, 179, 191, 192, 195, 459, 460, 463

c++filt, 26, 27

call flow, 186, 189

callee-saved registers. See no-clobber register, 100, 101

caller-saved registers. See clobber register, 100, 101

calling conventions, 9495, 100101, 113, 139

C, 96

C++

thiscall, 99, 173

cdecl, 96, 97, 99, 102, 103, 105

fastcall, 98, 99

standard calling convention, 98

stdcall, 98, 99, 102

call mechanics, 94

cdecl, 96, 97, 99, 102, 103, 105

changing appearance (windows), 250, 251

Characteristics field (PE files), 374

CheatSheet.html, 35

checkpoint, 487

child processes, 475

Choose active FidDbs, 275

Choose Data Type (hotkey T), 366

clang, 443, 459, 464

Classes folder (Symbol Tree), 74, 75, 192, 459, 460

classification tools, 15

Clear Code Bytes (hotkey C), 139, 473, 503

clearListing method, 304, 515

clipboard icon (Eclipse), 320

clobber register, 101, 104

Close (display windows), 242

Close View (Ghidra Project), 229

code caves, 519

code cross-reference, 186, 187, 190, 192

code display options, 133

code optimization, 99, 109, 453, 455, 466

CodeBrowser, 48, 49, 50, 5254

CodeBrowser menu

Analysis menu, 57

Analyze All Open, 261, 265, 268, 273, 283

auto analysis, 90, 107

Auto Analyze, 4853, 261, 265, 268, 273

One Shot, 110

Edit menu, 57, 59, 62

Tool Options, 54, 244, 246

File menu, 56

Export Program, 522

Parse C Source, 270, 271

Help menu, 58

About Ghidra, 34

Search menu, 58

For Direct References, 508

For Instruction Patterns, 508511

Memory, 116, 117, 507

Tools menu, 56, 58, 68

Function ID menu, 274

Program Differences, 530

Window menu. See also CodeBrowser windows, 5887

CodeBrowser toolbar

Navigation toolbar, 70, 92, 93

Redo, 120

Undo, 120

CodeBrowser windows

Bytes, 78, 79, 513, 514

options, 244

Console, 75

Data Type Manager, 48, 52, 75, 148, 149, 167, 169, 176, 214, 267269, 271, 272, 279

Decompiler, 59, 7578, 427432, 434437, 439, 442

Defined Data, 75, 80, 81

Defined Strings, 81, 82

Function Call Graph, 86, 87

Function Call Tree, 87, 214

Function Graph, 6669, 197202, 205, 207, 208

Listing, 52, 472, 481, 482, 500, 503, 509, 514522, 526

Memory Map, 48, 85, 86, 368374

Program Trees, 71, 214, 519

Script Manager, 286297, 314319, 321, 326, 327

Symbol References, 8285, 90

Symbol Table, 82, 83, 85

Symbol Tree, 48, 49, 5860, 7275, 9092, 121124, 148, 181, 192, 214, 272280, 459461

collaborative SRE, 33, 37, 217222, 224, 227, 228, 230, 231, 235, 240

collapse sections (Eclipse), 318

collapsing blocks (Function Graph View), 68, 69

color customization (Function Graph), 208

Color Editor, 244

command line options (headless analyzer), 347

comments (Eclipse), 332

comments (Ghidra), 125, 137, 145

annotation, 128, 132

Symbol option, 153

EOL (end-of-line) comments, 128, 129, 132, 134, 302, 463

plate comments, 130, 279, 302

post comments, 130, 302

pre comments, 130, 131, 302

repeatable comments, 128, 131, 302

set comment, 128, 129, 132

-commit (headless analyzer), 353

Common Symbols File, 278

Compare Selected Functions (hotkey SHIFT-C), 538, 539, 541543, 545, 546

comparing functions, 538, 539, 541543, 545, 546

compilers

build options, 444, 451, 455

clang, 443, 459, 464

compiler field, 263

compiler options, 452

debug versions, 443, 450, 452, 453

Delphi, 443

GNU gcc/g++, 160, 443, 448451, 453455, 464

-O2 option, 456, 457

identification, 52

linker options, 452

Microsoft C/C++, 160, 173, 176, 178, 181, 443, 448451, 453, 456, 459, 463, 465

release versions, 452

validation, 7

compiler-specific behavior, 466

compiler variations, 443

build options, 444, 451, 455

compiler-specific behavior, 466

C++, 458

C++ Function Overloading, 458

C++ RTTI, 459

inline functions, 457, 458

main(), 463

modulo operator, 452454

switch statement, 444451

ternary operator, 455, 456

conditional branching instructions, 11

conditional jump, 474

configurations (Ghidra)

Configure Tool window, 255

Developer, 34, 252

Experimental, 34, 252

Function ID, 34, 73, 74, 254

Ghidra Core, 34, 252, 255, 256

ImporterPlugin, 253

Configure Gradle (Eclipse), 338

Configure Tool (Ghidra), 255

-connect (headless analyzer), 353

Console window (CodeBrowser), 75

constant indices, 153, 154, 159, 160

constructors

C++, 173, 177, 178, 181

inline, 181

SLEIGH, 408

control flow, 197, 200, 205, 208

converting data and code

Clear Code Bytes (hotkey C), 139, 473, 503

Disassemble (hotkey D), 140, 374, 378, 473, 503

Convert to Shared (Ghidra Server), 231

correlators, 547549

C-Parser plugin, 269, 270

crackme, 497, 498, 502

createAsciiString method, 305

createByte method, 304

createData method, 395

Create Function (hotkey F), 137

createFunction method, 305

Create Ghidra Script, 356

createLabel method, 303, 396

createMemoryBlock method, 383, 389, 395

createMemoryReference method, 396

Create new empty FidDb, 275, 277

Create Tool

example, 254

createUnicodeString method, 305

creating

analyzer modules (Eclipse), 329

Create Array (hotkey [), 144

Create Structure (hotkey SHIFT-[), 166, 167

Create Structure window, 166, 167

data type archives, 269

FidDbs, 275, 277

file archives, 271

Ghidra tools, 253

example, 254

loader modules, 376, 379

module projects (Eclipse), 322

project archives, 272

projects (Ghidra), 43

script projects (Eclipse), 321

scripts (Eclipse), 317, 319, 321

shared projects (Ghidra Server), 221, 222

Close View, 229

structures, 160, 166

cross-references, 64, 69, 80, 86, 183184, 188189, 193, 195, 196, 401, 461463, 508, 512, 521, 523

code, 186, 187, 190, 192

data, 185, 187, 190, 191, 459, 460

enumerating, 308

jump, 190

pointer, 191, 192

read, 191

suffix (*), 185, 191, 212

suffix (R), 185

suffix (T), 212

suffix (W), 185

write, 191

-cspec (headless analyzer), 351, 352

C-style structs. See structures.

CTRL-L hotkey (Retype), 434

CTRL-SHIFT-Z hotkey (redo), 120

CTRL-Z hotkey (undo), 120

Cuckoo Sandbox, 479

currentAddress, 299, 308, 309

current file location, 64

currentLocation, 299

currentProgram, 293, 296, 299, 305, 307310

currentSelection, 293, 300

customizing (Function Graph View), 69

customizing Ghidra, 241, 258

cycle groups, 141

Cygwin, 16, 25

D

data cross-reference, 185, 187, 190, 191, 459, 460

Data Execution Prevention (DEP), 330

data/languages directory, 397

.data section, 71, 150, 373

data structures, 147, 150, 164, 172, 182

data type archives, 267, 269, 272

BuiltInTypes, 268

opening, 268

Data Type Manager window, 48, 52, 75, 148, 149, 167, 169, 176, 214, 267, 279

BuiltInTypes, 268

data type archives, 268

creating, 269

opening, 268

New File Archive, 271

New Project Archive, 272

data types, 147, 150, 153, 169, 182, 431, 432

addrinfo, 148, 149, 172

DAT_ prefix, 91, 120, 126, 144

dead listings, 90

debug mode, 443, 450, 452, 453

debuggers, 280, 476, 477, 480, 490491, 503, 504, 525528

GNU debugger (GDB), 11, 478

OllyDbg, 478

preventing debugging, 489

WinDbg, 11

debugging displays, 7

debugging registers (x86), 477

decode, 491, 492, 495

Decompiler analyzer, 428430

decompiler-assisted stack frame analysis, 109

Decompiler Parameter ID, 50, 53, 109, 113

PE files, 110

decompilers, 5

Decompiler Switch Analysis, 50, 53

Decompiler window, 59, 7578, 427

analysis engine, 430

analysis options, 436

Eliminate unreachable code, 428, 429

Simplify predication, 428, 430

Auto Create Structure, 439, 441

automated structure creation, 437

backward slice, 435

data types, 431, 432

Edit Function Signature, 437

editing in the Decompiler window, 431

editing variable types and names, 434

error bookmark, 437

forward slice, 435

function prototypes, 432

highlighting slices, 435

non-returning function, 436, 437

Override Signature, 433

overriding function signatures, 433

program slice, 435

Retype variables, 434, 440

Structure Editor window, 442

Decompile View (Function Comparison), 539, 542

decompression, 482, 489

deep inspection tools, 27

defined data, 507

Defined Data window, 75, 80, 81

Defined Strings window, 81, 82, 144

Delete Function (hotkey DEL), 137

delete operator (C++), 178

Delete Project (Ghidra), 225

-deleteProject (headless analyzer), 349

Delphi, 443

density, 445447

deobfuscation, 479490, 492495, 503, 504

emulation-oriented, 496

script-oriented, 491

deobfuscation stub, 479, 480, 483, 485, 496

DEP (Data Execution Prevention), 330

Destination Folder field (Import File), 45

destructors (C++), 177, 179

desynchronization, 471, 474, 478

Detach existing FidDb, 275

detaching FidDbs, 275

Determine Program Differences dialog, 530

Developer configuration, 34

Developer configuration (Ghidra), 252

D hotkey (Disassemble), 140, 374, 378, 473, 503

Diff Details window, 531, 532, 534535

EOL-Comment section, 536

Pre-Comment section, 537, 538

Diff View, 259, 530, 532, 534, 538, 546

directives, 4

direct references search, 462, 508

Disassemble (hotkey D), 140, 374, 378, 473, 503

disassemble method, 304

disassemblers, 5, 7, 12, 13

diStorm, 29

MASM, 9

NASM, 29

ndisasm, 29, 30

disassembly

basic algorithm, 8

conditional branching instructions, 11

desynchronization, 471

function call instructions, 12

introduction to, 314

linear sweep, 913

navigation, 90

recursive descent, 11, 13

return instructions, 13

sequential flow, 11

theory, 4

tools, 15

unconditional branching instructions, 11

dist directory, 337, 338

diStorm, 29

divide-by-zero exception, 477

DLL (dynamic link library), 484, 485

docs directory, 3437

downloading Ghidra, 35

-d strings option, 29

dumpbin, 2426, 29, 483

dynamic analysis, 6, 491

dynamic_cast, 180, 181, 458460

dynamic linking, 22, 23, 209, 212, 213

dynamic link library (DLL), 484, 485

dynamic memory allocation, 157, 178

E

Eclipse

analyzer module template, 323, 328, 331

clipboard icon, 320

collapse sections, 318

comments, 332

Create Ghidra Script dialog, 319, 321

creating module projects, 322

creating modules, 376, 379

creating script projects, 321

creating scripts, 317, 319, 321

directories

module projects, 327

edit script, 316, 317

error tag, 320

expand lines, 318, 328

Exporter, 337

exporter module template, 323

export module, 337

file system module template, 323

GhidraDev, 315322, 324, 331, 337, 402, 403, 409

Home scripts, 325, 499

integration, 316, 329, 340

Link options, 322, 324, 325

loader module template, 323, 328

module templates, 379, 397

Package Explorer, 322326, 331

plugins module template, 323

processor module template, 323

Quick Fix options, 315, 320, 321

Run options, 327, 337

task tag, 320, 323, 328, 332, 333

testing modules, 385

TODO comments, 320, 332334, 403, 410, 411

tutorials, 316

Eclipse menus

GhidraDev, 317, 318, 324

edge color (Function Graph), 207

edges, 184

Edit function (hotkey F), 137139

Edit Function Signature, 437

editing

in the decompiler window, 431

labels, 125, 126

scripts (Eclipse), 316, 317

structure members, 169

the tool (Tool Options), 246

variable types and names, 434

Edit menu (CodeBrowser), 57, 59, 62

Edit menu (Ghidra Project), 227

Edit Plugin Path (Ghidra Project), 227

Edit Tool Options (Ghidra Project), 227

educational content, 36

EEPROM, 523

E hotkey (Set Equate), 136

ELF binaries

analyzing, 265, 463

file format, 8, 17, 23, 25, 268, 392

importing, 262, 264, 276, 278

locating main, 463, 464

loader example, 391400

obfuscation, 276279, 479, 490, 492, 496

utilities 17, 23, 25, 28, 29, 280

Eliminate unreachable code, 428, 429

emulating assembly language behavior, 311

emulation, 469, 495497, 500, 501, 503, 504

emulation-oriented deobfuscation, 496

emulator, 496, 503

SimpleEmulator example, 497499

Emulator class, 469, 497, 499

EmulatorHelper, 497, 499

dispose method, 502

enableMemoryWriteTracking method, 500

getEmulateExecutionState method, 501

getTrackedMemoryWriteSet method, 501

readMemoryByte method, 502

run method, 494, 501

setBreakpoint method, 500

encode, 478

encrypt, 478

endianness, 263

end-of-line (EOL) comment, 128, 129, 132, 134, 302, 463

end-user license agreement (EULA), 37

Entropy bar (Ghidra), 62

entry point, 8, 73, 85, 463, 464

enumerating cross-references, 308

enumerating functions, 307

enumerating instructions, 308

EOL-Comment section, 536

EOL (end-of-line) comment, 128, 129, 132, 134, 302, 463

epilogue, 95, 100, 103, 105

error bookmark, 437, 472

error messages (headless analyzer), 344

error tag (Eclipse), 320

-e strings option, 29

EULA (end-user license agreement), 37

exception handler, 476, 477

exceptions, 476, 477, 490, 494, 502, 504

Executable and Linkable Format. See ELF.

Expand Down (Memory Map toolbar), 373, 374

expand lines (Eclipse), 318, 328

Experimental configuration (Ghidra), 34, 252

explicit forward reference, 195

exploit, 184, 330, 487

Export dialog, 522

Exporter (Eclipse), 337

exporter module template (Eclipse), 323

exporting files (Ghidra), 506

ASCII format, 514, 522, 523

Binary format, 522, 523, 525

C/C++ format, 522

HTML format, 523

Intel Hex format, 523

XML format, 523

zip format, 522

export module (Eclipse), 337

Export Program menu (CodeBrowser), 522

Exports folder (Symbol Tree), 73

Export Tool, 257

Extensions directory, 34, 37

external references, 195

EXT_ prefix, 91, 120, 126

F

Failed to disassemble (Ghidra error message), 472

fallthrough, 518

override, 473

fastcall, 98, 99

F hotkey (Create/Edit Function), 137139

F1 hotkey (Ghidra Help), 34, 58, 186, 196, 270, 273, 506, 516, 549

F2 hotkey (Apply Selection), 537

F5 hotkey (Program Diff toolbar), 532, 534

FidDbs (Function ID databases), 272, 273, 276, 278280, 282284, 466

attaching, 275

creating, 275, 277

detaching, 275

populating FidDbs from programs, 275, 277

FidPlugin, 274

FileBytes object, 524, 525

file extensions, 16

File menu (CodeBrowser), 56, 522

File menu (Ghidra Project), 224, 225

file offset, 47

files

extensions, 363

.a, 280, 282, 283

.class, 268

.cspec, 404

.dll, 23, 26, 73, 98, 483486

.drv, 26

.fidb, 277

.fidbf, 74, 280

.gdt, 268, 270

.gif, 257

.gpr, 232

.h, 405, 412

.idx, 406, 407

.jpg, 257

.keep, 238

.ldefs, 396, 404

.o, 280

.opinion, 380, 397398, 404

.pdf, 406, 407

.png, 257

.prf, 270

.pspec, 397398, 404

.py, 295296

.rep, 220, 232

.sinc, 404, 405, 408426

.sla, 404, 405, 408418

.slaspec, 404, 405, 408, 412, 415, 418

.sng, 266, 267

.so, 23

.tar, 227

.tool, 255257

.txt, 404, 407

.xml, 404

.zip, 219, 220, 227, 337, 338

hijacked (Ghidra Server), 236, 238

loading (Ghidra), 44

private (Ghidra Server), 238, 239

filesystem paths, 342

file system mode (import), 281

file system module template (Eclipse), 323

filesystem paths, 342

file utility, 16, 18, 280

findBytes method, 303

find method, 302, 303

findSupportedLoadSpecs method, 381, 382

first-generation languages, 4

Flat API, 297, 299, 301, 302, 304, 308

FlatProgramAPI class, 297300, 306

addEntryPoint method, 383, 396

clearListing method, 304

createAsciiString method, 305

createByte method, 304

createData method, 395

createFunction method, 305

createLabel method, 303, 396

createMemoryBlock method, 383, 389, 395

createMemoryReference method, 396

createUnicodeString method, 305

disassemble method, 304

findBytes method, 303

find method, 302, 303

getByte method, 301, 312, 313

getBytes method, 301

getDataAfter method, 302

getDataAt method, 302, 396

getFirstData method, 302

getFirstFunction method, 303, 307

getFirstInstruction method, 302

getFunctionAfter method, 304, 307

getFunctionAt method, 304, 310

getInstructionAfter method, 302

getInstructionAt method, 302

getInt method, 301

getLong method, 302

getReferencesFrom method, 304, 309

getReferencesTo method, 304, 310

getSymbolAt method, 303, 309

getSymbols method, 303

removeFunctionAt method, 304

setEOLComment method, 305

flow, 186, 187, 189, 190, 194

flow arrow, 64

flow types

call, 186, 189

jump, 190

sequential, 186, 187, 189, 190, 198, 205

footprints icon (Version Tracking), 547

forbidden labels and names, 123

For Direct References (Search menu), 462

For Instruction Patterns (Search menu), 508, 509, 512

Format option, 263

formatting instruction operands, 133, 135

formatting XREFs, 186

forward navigation (Go To Next Location)

hotkey ALT-right arrow, 92, 93

hotkey OPTION-right arrow (Mac), 93

forward references, 184, 195, 196

forward slice, 435

fourth-generation languages, 4

fragment, 71

frame pointer, 95, 103106, 113, 114

FrontEndPlugin. See Ghidra Project window.

full hash, 272

Function Call Graph window, 86, 87, 197, 210211, 213, 214

satellite view, 67, 68, 199, 208, 209

function call instructions, 12

Function Call Tree window, 87, 214

Function Comparison toolbar, 540

Function Comparison window

Add Functions, 539, 541

Decompile View, 539, 542

Listing View, 539, 542, 543

toolbar, 538543, 545, 546

Function Graph View, 66

Function Graph window, 66, 197198, 201, 205, 207, 447

articulation, 200

basic block toolbar

background color, 208

combine vertices, 203

restore group, 203

collapsing blocks, 68, 69

color customization, 208

edge color, 207

Function Graph View zooming, 58, 60, 68

grouping blocks, 68, 203

interaction threshold, 202

nodes, 199, 208, 209

panning, 68, 69

satellite view, 67, 68, 199, 208, 209

toolbar, 202, 203

Function ID analyzer, 73, 272283

Function ID configuration (Ghidra), 34, 73, 74, 254

Function ID database (FidDb), 272283, 466

Function ID menu, 274

Attach existing FidDb, 275

Choose active FidDbs, 275

Create new empty FidDb, 275, 277

Detach existing FidDb, 275

Function ID plugin

example, 275, 279

Populate FidDb from programs, 275, 277

Function ID plugin, 273

example, 275, 279

Function IDs, 272

Function interface

getBody method, 306309

getPrototypeString method, 306

getStackFrame method, 306, 307

functions

arguments, 94, 96, 98, 105, 106, 110

identifying, 52

attributes, 137, 138

call mechanics, 94

comparing, 538, 539, 541543, 545, 546

Create (hotkey F), 137

Delete (hotkey DEL), 137

Edit (hotkey F), 137139

epilogue, 95, 100, 103, 105

header, 535

inline, 181, 457, 458

library, 52, 178, 212, 482, 483

getaddrinfo, 148, 149

locating main, 452, 455, 457, 460, 463466

manipulating, 133, 137

modifying signatures, 433, 434, 436, 437

namespace, 124

non-returning, 436, 437

overloading, 26, 179, 458

parameters, 148, 158, 173, 179, 457, 458

prologue, 95, 100, 102, 104, 105, 110, 375

prototypes, 127, 140, 148, 179, 432

signature, 434, 437, 535, 537, 543, 546

modifying, 433, 435, 436

thunk, 149, 212

variable number of arguments, 97, 179, 432, 433

Functions folder (Symbol Tree), 73, 74

FUN_ prefix, 91, 120, 126

fuzzing, 6

G

Gaobot worm, 19

gcc, 443, 448451, 453457, 464

gcc/ld (-s option), 152

GDB (GNU debugger), 11, 478

getAddress method, 298, 310

getaddrinfo, 148, 149

getBody method, 306309

getByte method, 301, 312, 313

getBytes method, 301

getComment method, 307

getDataAfter method, 302

getDataAt method, 302, 396

getDefaultOptions method, 384

getFirstData method, 302

getFirstFunction method, 303, 307

getFirstInstruction method, 302

getFromAddress method, 299, 310

getFunctionAfter method, 304, 307

getFunctionAt method, 304, 310

getFunctionManager method, 305

getInstructionAfter method, 302

getInstructionAt method, 302

getInt method, 301

getLanguageID method, 306

getListing method, 293, 305, 308, 309

getLong method, 302

getMaxAddress method, 306, 307

getMemory method, 305

getMinAddress method, 306, 307, 309

getMnemonicString method, 306

getName method, 293, 298, 307310, 381, 388, 392, 394

getNumOperands method, 307

getOffset method, 307310

getOperandType method, 307

GetProcAddress function (Windows), 483487

getPrototypeString method, 306

getReferenceManager method, 306

getReferencesFrom method, 304, 309

getReferencesTo method, 304, 310

getReferenceType method, 299, 309, 310

getStackFrame method, 306, 307

getSymbolAt method, 303, 309

getSymbols method, 303

getSymbolTable method, 305, 310

getTier method, 382, 392

getTierPriority method, 382, 388

getToAddress method, 299, 309

Ghidra

Address Type overview bar, 480

CheatSheet.html, 35

directory structure, 36

download

releases, 35

educational content, 36

Entropy bar, 62

error

bookmarks, 502

error message

Failed to disassemble, 472

file loading, 44

for IDA users, 551556

icon, 37

known structure layouts, 171

licenses, 34, 37

logfile, 46, 52

Module

Install Extension, 329, 337

server

directory, 35

installation, 35

source code, 35

source repository, 316

startup script, 37

support documentation, 3437

tutorials, 35

versions, 35

Ghidra.app.script.GhidraScript, 289, 294

Ghidra Core configuration, 34, 255, 256

Plugin Path, 252

ImporterPlugin, 253

Ghidra data displays, 55

GhidraDev, 315316, 318, 324, 337, 402, 403, 409

New menu

Ghidra Module Project, 319, 322, 323, 331

Ghidra Script, 317, 319, 321, 326, 327

Ghidra Script Project, 319, 321

GhidraDev menu, 317, 318, 324

GhidraDev_README.html, 316

GhidraDevUser Consent, 317

Ghidra directories

data, 397

data/languages, 397

dist, 337, 338

Ghidra/Features, 316, 326, 334

languages, 397, 404, 407, 409, 415, 418

Ghidra directory structure, 36

docs, 3437

Extensions, 34, 37

Ghidra, 37

GPL, 37

licenses, 37

server, 37

support, 37

Ghidra extensions

Gradle, 337

install, 338

Ghidra/Features directory, 316, 326, 334

Ghidra GUI, 341, 345348, 351, 353, 355

Ghidra Help (F1 hotkey), 58, 186, 196, 270, 273, 506, 516, 549

Ghidra Help menu

About, 51

Contents (F1 hotkey), 34

$GHIDRA_HOME, 354

ghidra.ico, 37

Ghidra installation directory, 354

Ghidra Module Extension

Export, 337

Ghidra Module Project, 322

templates, 320, 327, 329

Analyzer, 323, 328, 331

Exporter, 323

FileSystem, 323

Loader, 323, 328

plugins, 323

Processor, 323

Ghidra modules, 315, 322

Ghidra Project menu

Edit

Plugin Path, 227

Edit menu

Tool Options, 227

File menu, 224

Archive Current Project, 225

Delete Project, 225

Import File, 44

New Project, 43, 222

Help menu

About Ghidra, 34

Project

View Project, 229, 231

View Recent, 229

View Repository, 229

Project menu, 229, 231

Ghidra Project window, 4142, 48, 52, 242, 253

creating projects, 43

Running Tools, 249, 250

Table View, 223

Tool Chest, 249, 257259, 547

Tool Options

Eclipse Integration, 250

Key Bindings, 245, 250

Recovery, 250

Tool, 250

window, 364, 385, 398

Ghidra releases, 35

ghidraRun, 37

Ghidra Script, 319, 321, 326, 327

GhidraScript class, 289, 292, 294, 296

askAddress method, 300

askDirectory method, 301

askFile method, 301

askInt method, 300

askString method, 293, 300

askYesNo method, 300

currentAddress instance variable, 299, 308, 309

currentLocation instance variable, 299

currentProgram instance variable, 293, 296, 299, 305, 307310

currentSelection instance variable, 293, 300

goTo method, 301

popup method, 300, 308

printf method, 293, 300, 307, 309, 310

toAddr method, 301, 312, 313

Ghidra Script Project, 321

ghidra_scripts, 286

Ghidra Server, 217, 230, 235, 240

access control, 218, 221, 231

authentication methods, 219, 221, 227, 228

configuration file, 218

Convert to Shared, 231

example, 219

headless analyzer options, 352353

hostname, 222

installation, 219

IP address, 222

platforms, 219

race condition, 221, 233

server administrator, 224

-u parameter, 220

Ghidra Server project, 235

Ghidra site, 35

Ghidra source code, 35, 316, 549

Ghidra Tools

CodeBrowser, 4850, 5254

Version Tracking, 529, 546549

Ghidra Tools menu

Create Tool

example, 254

Export Tool, 257

Import Tool, 257

Ghidra User Agreement, 34, 37, 38

Ghidra versions, 34

Ghidra workspace, 242, 258

G hotkey (Go To Address/Label), 92, 93, 214

GitHub, 277, 479, 549

Ghidra source code, 35

global arrays, 150, 154, 161

global namespace, 124

global structures, 161, 162, 166

global variable, 151153, 161, 167

GNU debugger (GDB), 11, 478

GNU gcc/g++, 443, 448451, 453457, 464

packed attribute, 160

pack pragma, 160

Go To (hotkey G), 92, 93, 214

goTo method, 301

GPL directory, 37

GPL (GNU General Public License), 34, 37

Gradle Wrapper option, 337

grep, 280

grouping blocks

Function Graph window, 68, 203

H

hardware breakpoints, 477, 489

hashing

full hash, 272

hash function, 272, 487

hash values, 487

specific hash, 272

headless analyzer, 340341, 345

batch import, 347

example, 346, 359

command line options, 347

error messages, 344

example

launching, 342, 343

Ghidra Server options, 352

launching, 342344, 347352, 354, 357360

readme file, 342, 350, 352

scripting, 355

syntax, 343, 351, 355, 356

wildcards, 350

headless analyzer options

general

-analysisTimeoutPerFile, 350, 351

-cspec, 351, 352

-deleteProject, 349

-import, 343, 344, 347352, 354, 355, 357359

-loader, 352

-log, 348

-max-cpu, 352

-noanalysis, 344, 348, 353

-overwrite, 348

-processor, 351, 352, 359

-readOnly, 348, 349, 359

-recursive, 349, 358, 359

script

-okToDelete, 354, 355

-postScript, 354, 355, 357359

-preScript, 354

-process, 343, 348, 351353, 359

-propertiesPath, 354

-scriptPath, 353, 354, 357359

server

-commit, 353

-connect, 353

-keystore, 353

-p, 353

headless Ghidra. See headless analyzer.

headless mode. See headless analyzer.

heap-allocated array, 157, 158

heap-allocated structures, 162, 163

Help menu

About Ghidra, 34

Help menu (CodeBrowser), 58

hex editor. See Byte Viewer, 513, 528

H hotkey (Label History), 123, 127

highlighting slices, 435

hijacked file (Ghidra Server), 236, 238

Home scripts (Eclipse), 325, 499

hostname (Ghidra Server), 222

hotkeys, 59

ALT-left arrow (Go To Previous Location), 92, 93

ALT-right arrow (Go To Next Location), 92, 93

C (Clear Code Bytes), 139, 473, 503

[ (Create Array), 144

CTRL-L (Retype), 434

CTRL-SHIFT-Z (Redo), 120

CTRL-Z (Undo), 120

D (Disassemble), 140, 374, 378, 473, 503

E (Set Equate), 136

F (Create/Edit Function), 137139

F1 (Ghidra Help), 34, 58, 186, 196, 270, 273, 506, 516, 549

F3 (Apply Selection), 537

F5 (Program Diff toolbar), 532, 534

G (Go To Address/Label), 92, 93, 214

H (Label History), 123, 127

L (Label), 120, 123128, 206, 434

OPTION-left arrow (Go To Previous Location; Mac), 93

OPTION-right arrow (Go To Next Location; Mac), 93

; (Set Comment), 128132, 279

SHIFT-C (Compare Selected Functions), 538, 539, 541543, 545, 546

SHIFT-[ (Create Structure), 166, 167

S (Search), 58, 116, 117, 507511

T (Choose Data Type), 366

hotkey SHIFT-C (Compare Selected Functions), 538, 539, 541543, 545, 546

HTML format export (Ghidra), 523

I

ia.sinc, 409413, 415, 416, 418421, 423425

IDA

Ghidra for IDA users, 551556

.idata section, 373

IDE (integrated development environment), 316318, 327, 328, 333, 340

IL (intermediate language), 418

ImageBase field, 367, 369

IMAGE_DOS_HEADER, 366

IMAGE_NT_HEADERS, 367, 369

IMAGE_SECTION_HEADER, 369, 370, 372

Import dialog, 262, 282

imported function obfuscation, 482

Imported libraries (Symbol Tree), 73

importer loader poll, 364, 381

ImporterPlugin, 253

Import File (Ghidra), 44

-import (headless analyzer), 343, 344, 347352, 354, 355, 357359

importing

Batch Import dialog, 282

Batch mode, 226, 227, 282

ELF binaries, 262, 264, 276, 278

files

override recommendations, 262

File System mode, 281

PE files, 262

Import Results Summary, 45, 46, 264

Imports folder (Symbol Tree), 72, 73, 280

Import Tool, 257

index (array), 150, 153, 156, 160, 161, 165

inheritance (C++), 172, 173, 179, 180, 181, 182, 459

inline constructors, 181

inline functions, 181, 457, 458

inlining (compiler variations), 457

installing Ghidra

Installation Guide, 3537

on Linux, 34, 37

on macOS, 34, 37

on Windows, 34, 36

Instruction Info window, 405

Instruction interface

getComment method, 307

getMnemonicString method, 306

getNumOperands method, 307

getOperandType method, 307

toString method, 307

instruction patching, 505, 507, 508, 512, 515, 517, 518, 519

instruction patterns, 508, 509, 512

instruction pattern search, 508511

Instruction Pattern Search dialog, 509511

instruction pointer, 471, 477

instruction set architectures, 33

integrated development environment (IDE), 316318, 327, 328, 333, 340

Intel Hex format export (Ghidra), 523

Intel x86. See x86, 8

interaction threshold, 202

inter-function alignment gap, 520

intermediate language (IL), 418

intermediate representation (IR), 418

interprocess communication (IPC), 475

IP address, 148

IP address (Ghidra Server), 222

IPC (interprocess communication), 475

IR (intermediate representation), 418

IsDebuggerPresent, 489

J

JDK (Java Development Kit), 37

jump

conditional, 474

cross-reference, 190

flow, 190

hook, 519

table, 7, 10, 11, 445451

target, 471, 474

to XREF (Function Graph), 208

Jython, 295, 296

K

kernel32.dll, 465

GetModulehandleA, 483, 485, 486

GetProcAddress function, 483487

LoadLibrary function, 483, 485

key bindings, 245, 246, 250

-keystore (headless analyzer), 353

L

Label, 120, 123128

Label History, 123, 127

labels, 90, 302

adding, 125, 126, 206

manipulating, 120

navigating, 128

pinned, 127

prefix

DAT_, 91, 120, 126, 144

EXT_, 91, 120, 126

FUN_, 91, 120, 126

LAB_, 91, 120, 126, 131

OFF_, 91, 120, 126

SUB_, 126

UNK_, 91, 120, 126

removing, 127

rules for, 123

Labels folder (Symbol Tree), 74

LAB_ prefix, 91, 120, 126, 131

language/compiler specification, 44, 265, 366, 377, 386, 394, 396399

architecture size, 263

compiler field, 263

endian field, 263

language field, 263

processor name field, 263

processor variant/mode field, 263

language definition file (ldef), 396, 397

Language field, 263

Language field (Import File), 44

language generations, 4

languages directory, 397, 404, 407, 409, 415, 418

launching headless, 342, 343

layouts, 171

ldd (list dynamic dependencies), 2226, 483

ldef (language definition file), 396, 397

L hotkey (Label), 120, 123128, 206, 434

libc, 464, 465

libraries

functions, 52, 148, 178, 482, 483

dynamically linked, 212

imported, 73

libc, 282

libc.a, 280, 282, 283

libcrypto.so, 264

lib.so.6, 264

libssl.so, 264

loading external, 45

shared, 482

type libraries, 149

Library Family Name (populating FidDbs), 277

library functions

getaddrinfo, 148, 149

Library Variant (populating FidDbs), 277

Library Version (populating FidDbs), 277

licenses, 34, 37

licenses directory, 37

lifting, 418

linear sweep disassembly, 913

linker, 152

Link options (Eclipse), 322, 324, 325

Linux, 490, 491, 495, 496

list dynamic dependencies (ldd), 2226, 483

Listing View (Function Comparison), 539, 542, 543

Listing window, 52, 427, 428, 430, 431, 436, 437, 442, 472, 481, 482, 500, 503, 509, 514, 516, 517, 519, 520, 522, 526

editing, 247

rearranging fields, 247

Listing window toolbar

Browser Field Formatter, 65, 66, 133, 134, 247, 248, 419

little-endian architecture, 11

liveness, 173

-loader (headless analyzer), 352

loader module, 365, 375, 376, 379, 387, 397, 398, 400

example, 381384, 388, 392394

loader module template (Eclipse), 323, 328, 379, 397

loaders, 44, 263

creating modules, 376, 379

examples

unknown file type (PE), 366375

shellcode loader, 391400

importer poll, 364, 381

module template, 379, 397

option fields, 47

Raw Binary, 46, 48, 363366, 368, 375379, 382, 388, 391, 523

unknown file types, 365

load external libraries, 45

LoadLibrary function, 483, 485

load method, 383, 388

loadSpecs list, 388, 393, 394

local_ prefix, 120, 122, 123, 135, 136

local variables, 89, 94, 95, 102108, 110, 111, 114, 152, 154, 156, 158, 535, 547

identifying, 52

layout, 101

locating main function, 452, 455, 457, 460, 463466

log file, 46, 52

-log (headless analyzer), 348

lossy, 5, 523

M

MAC address, 488

machine language, 4

macOS, 34, 37, 93, 491

magic file, 16

magic number, 16, 18, 363, 367, 381, 393, 398

main

locating, 452, 455, 457, 460, 463, 464, 465, 466

Make Char Array, 144

Make String, 144

malloc function (C), 157

malware, 6, 470, 476, 479, 487489, 504

malware analysis, 6

manipulating functions, 133, 137

MASM (Microsoft Assembler), 9

-max-cpu (headless analyzer), 352

meaningful names, 120, 125

member functions

nonstatic, 99, 173, 458

static, 90, 99, 105

memory allocation, 158, 175

dynamic, 157, 178

memory blocks, 85, 367372, 383, 389, 395

Memory class, 301, 302

memory footprint, 513, 521

memory layout

base address, 47

file offset, 47

memory leaks, 177

Memory Map window, 48, 85, 86

Add Block, 370

Expand Down, 373, 374

Move Block, 373

Set Image Base, 369

Split Block tool, 370

toolbar, 368

memory references, 195

memory (search), 507

memory search, 115, 117, 507

merging analyzed files, 534

Metasploit, 30

Microsoft Assembler (MASM), 9

Microsoft C/C++, 173, 176, 178, 181, 443, 448451, 453, 456, 459, 463, 465

pack pragma, 160

MIPS, 10, 491, 496

instruction, 94, 95, 113

mnemonics, 4, 8, 302, 511, 516

modifying word models, 267

modules

analyzer, 323, 328, 329, 331, 337

loader, 365, 375, 376, 379, 387, 397, 398, 400

processor, 401405, 407409, 415, 418, 424, 426

modulo operator (compiler variations), 452, 453, 454

monitor, 293, 300, 307309

monitor.isCancelled, 293, 300, 307309

Move Block (Memory Map toolbar), 373

Move (display windows), 243

MS-DOS header, 366

multiple inheritance, 180

N

name decoration. See name mangling, 179

name mangling (C++), 27, 179, 180, 181, 458, 459

names, 92, 108110, 112, 116, 124, 127, 132, 145

examples, 126

manipulating, 120

meaningful, 120, 125

prefix

local_, 120, 122, 123, 135, 136

param_, 120123, 130, 131, 139

rules for, 123

symbolic, 90, 111

namespace, 125127

function, 124

global, 124

Namespaces folder (Symbol Tree), 75

naming convention, 91

Ghidra decompiler, 109

NASM (Netwide Assembler), 29

National Security Agency (NSA), 33

navigable objects, 185

navigating labels, 128

navigating Package Explorer, 324

Navigation bar, 62

navigation history, 92, 93

navigation marker, 62

Navigation toolbar (CodeBrowser), 70

navigational target, 9093, 471, 474

ndisasm, 29, 30

Netwide Assembler (NASM), 29

New File Archive, 271

new operator (C++), 157, 175, 178

New Project Archive, 272

New Project (Ghidra), 43, 222

nm utility, 20, 21, 25, 27

-noanalysis (headless analyzer), 344, 348, 353

no-clobber register, 101, 104

nodes (Function Graph), 184, 199, 203, 205, 208, 209

nonbranching instruction, 186

Non-eXecutable (NX), 330

nonlinear flow, 64

non-returning functions, 437

Non-Returning Functions-Discovered, 436

Non-Returning Functions-Known, 436

nonshared projects, 34, 224, 232, 240

nonstatic, 99, 173, 458

NSA (National Security Agency), 33

NX (Non-eXecutable), 330

O

-O2 option (gcc), 456, 457

obfuscation, 18, 470, 482, 489, 490

imported function, 482

obfuscated control flow, 475

obfuscated instruction, 478

utilities

ASPack, 19, 479, 496

ASProtect, 479

tElock, 476, 478, 479, 483, 485, 486, 496

UPX, 275280, 282, 479486, 496

VMProtect, 479

objdump, 11, 24, 25, 29, 90, 111, 483

object file, 152

object life cycle (C++), 177

object-oriented, 172, 174

OFF_ prefix, 91, 120, 126

offsets, 150, 153, 158164, 166, 168, 170172

-okToDelete (headless analyzer), 354, 355

OllyDbg, 478

one-shot analyzers, 265, 279

opcode, 8, 410, 411, 413, 414, 419, 421, 422

opcode obfuscation, 478

Open (display windows), 242

Open File Archive, 268

OpenJDK, 219

open source, 33

OpenSSL, 264, 270

operating systems

Linux, 34, 37, 490, 491, 495, 496

macOS, 34, 37, 491

Windows, 34, 36, 47, 476, 477, 479, 480, 483, 485, 487489, 496

opinion file, 381, 397, 398

opinion service, 393, 394

optimized code, 99, 109, 453, 455, 466

OPTION-left arrow hotkey (Go To Previous Location; Mac), 93

OPTION-right arrow hotkey (Go To Next Location; Mac), 93

Options frame (analyzers), 50

organizationally unique identifier (OUI), 488

otool, 24, 25, 29

OUI (organizationally unique identifier), 488

overloaded functions, 26, 179

Override fallthrough, 473

overriding function signatures

Override Signature, 433

oversized code patches, 519

overview bar, 62, 480, 481, 482

-overwrite (headless analyzer), 348

P

Package Explorer, 322323, 325326, 331

navigating, 324

packed attribute, 160

packet captures, 46

pack pragma, 160

padding bytes, 160, 170

panning (Function Graph View), 68

parameters. See also arguments. 94112, 148, 158, 179, 457, 458

register-based, 113

liveness, 173

renaming, 121125, 153, 434

param_ prefix, 120123, 130, 131, 139

parsing C header files

Parse C Source, 269271

Parse to File, 270

Parse to Program, 270

passwords, 221, 230, 231

patching, 506, 509, 520522, 525, 528

basic patches

assembler, 515

byte viewer, 513

scripting, 515

complex patches, 519

example, 525

export formats, 522

generating patched files, 523

instructions, 505, 507, 508, 512, 515, 517519

oversized code patches, 519

patched file, 529531, 534

Patch Instruction, 515, 517, 527

script-assisted export, 523

scripted exports, 523

p-code, 411, 417419, 424, 425, 428

pcodeop, 410, 411, 418

PDB (Program Database), 50, 53

PE files,

analyzing, 110

base virtual address, 367, 369

code caves, 519, 520

Characteristics field, 374

file format, 8, 17, 365

headers, 18, 189

IMAGE_DOS_HEADER, 366

IMAGE_NT_HEADERS, 367, 369

IMAGE_SECTION_HEADER, 369, 370, 372

importing, 262

loader priority, 382, 385, 386

loading (manually) example, 366375

loading options, 45, 50

locating main, 463, 465, 466

patching, 523

PDB (Program Database), 50, 53

utilities, 17, 25, 26, 29

PEiD (tool), 19, 20

PE Tools (tool), 18, 19, 20

-p (headless analyzer), 353

pinned labels, 127

PKI certificates, 219, 221, 227, 228

plate comments, 130, 279, 302

Platforms (Ghidra Server), 219

plugin path, 252

plugins, 33, 34, 48, 242, 316, 402

C-Parser, 269, 270

dependencies, 256

FidDbPlugin, 274

FrontEndPlugin, 250

module template (Eclipse), 323

Plugin Path, 227

pointer arithmetic, 172

pointer cross-reference, 191, 192

PointerToRawData, 370

polymorphism (C++), 172, 180

Populate Fid Database, 275, 277

Populate FidDb from programs, 275, 277

populating FidDbs

Populate Fid Database

Base Library, 277

Common Symbols File, 278

Fid Database, 275, 277

Language, 263, 277

Library Family Name, 277

Library Variant, 277

Library Version, 277

Root Folder, 277

Populate FidDb from programs, 275, 277

popup method, 300, 308

Portable Executable (PE) format. See PE files, 8

post comments, 130, 302

-postScript (headless analyzer), 354, 355, 357359

pre comments, 130, 131, 302

Pre-Comment section, 537, 538

prefixes, 120, 126

-preScript (headless analyzer), 354

preventing debugging, 489

printf method, 300, 307, 309, 310

println method, 293, 300

private files (Ghidra Server), 238, 239

private headers, 24

-process (headless analyzer), 343, 348, 351353, 359

Process Monitor (procmon), 488

-processor (headless analyzer), 351, 352, 359

processor manuals, 5, 58, 375, 406, 407, 409

processor modules, 401403, 405, 408, 418, 426

adding an instruction, 409

adding a register, 424

files

buildLanguage.xml, 404

README.txt, 404

sleighArgs.txt, 404

modifying, 407

modifying an instruction, 415

template (Eclipse), 323

processor name field, 263

processors

ARM, 9496, 113, 405, 418, 491

MIPS, 491, 496

SuperH, 426

x86, 474, 476478, 488, 490, 491, 494, 496

processor specification language, 36

processor type, 263

processor variant/mode field, 263

process tracing. See ptrace, 490

procmon (Process Monitor), 488

Program API, 297, 302, 304306

Program class, 297, 299

getFunctionManager method, 305

getLanguageID method, 306

getListing method, 293, 305, 308, 309

getMaxAddress method, 306, 307

getMemory method, 305

getMinAddress method, 306, 307, 309

getReferenceManager method, 306

getSymbolTable method, 305, 310

Program Database (PDB), 50, 53

Program Differences, 530

Program Diff tool, 530532, 534, 538, 540, 541, 546, 547, 549

Program Diff toolbar (hotkey F5), 532

Apply Differences, 534, 537, 538

Program Diff View, 532

program entry point, 8

program section, 71

program slice, 435

program stack pointer, 94, 95, 97, 98, 101106, 108, 111, 113, 500

program text search, 115, 508

Program Trees window, 71, 214, 519

project (Ghidra Server), 235

Project menu (Ghidra Project), 229, 231

project repository, 221, 223, 232

projects

nonshared, 34, 224, 232, 240

shared, 34

shared (Ghidra Server), 225

prologue, 95, 100, 102, 104, 105, 110, 375

-propertiesPath (headless analyzer), 354

ptrace, 490

pure virtual function, 174, 175

python_basics.py, 295

Q

Quick Fix options (Eclipse), 315, 320, 321

QuickUnpack, 480

R

race condition (Ghidra Server), 221, 233

Raw Binary loader, 46, 48, 363366, 368, 375379, 382, 388, 391, 523

option fields, 47

read cross-reference, 191

readelf, 25

Readme files

analyzeHeadlessREADME.html, 34, 342, 350, 352

GhidraDev_README.html, 316

server/svrREADME.html, 219221, 228

README.txt (processor module), 404

-readOnly (headless analyzer), 348, 349, 359

rearranging windows, 60, 68

Close, 242

Move, 243

Open, 242

redock, 243

Resize, 243

Stack, 243

Undock, 243

recognizing data structure use, 150

recursion, 94, 337

recursive descent disassembly, 11, 13, 140

-recursive (headless analyzer), 349, 358, 359

Red Pill, 488

redock (display windows), 243

Redo (CTRL-SHIFT-Z hotkey), 120

reference (array), 150, 160

Reference Interface

getFromAddress method, 299, 310

getReferenceType method, 299, 309, 310

getToAddress method, 299, 309

references

Add/Edit references, 195

Add Reference dialog, 196

Add Reference from, 195

back, 184, 185, 195

cross-references, 64, 80, 86, 183188, 190193, 195, 196, 401, 459463, 508, 512, 521, 523

explicit forward, 195

external, 195

formatting XREFs, 186

forward, 184, 195, 196

memory, 195

register, 195

stack, 195

to symbols, 153

XREF, 64, 69, 185193

References To window, 194

Refresh BuiltInTypes, 268

register-based parameters, 113

liveness, 173

register references, 195

register transfer language (RTL), 418

register transition, 473

register-to-memory transfer instructions, 11

registry, 479, 488

registry keys, 488

RegOpenKey, 148

regparm, 100

relative virtual address (RVA), 369, 372, 374

release versions, 452

relocation table, 524

removeFunctionAt method, 304

removing a label, 127

renaming parameters, 153, 434

renaming parameters and variables, 121, 122, 124, 125

renaming variables, 153

repeatable comments, 128, 131, 302

Resize (display windows), 243

Restore Defaults, 245

restore group (Function Graph), 203

return address, 94, 98, 103, 105, 106, 108, 112, 113

return instructions, 13

retyping variables, 434, 440

reversing

C++, 172

tools, 15

rollback capabilities, 487

ROM images, 30

Root Folder (populating FidDbs), 277

ROP gadget

analyzer module example, 329, 330, 332, 333, 335, 336

RTL (register transfer language), 418

RTTI (Runtime Type Identification), 460, 461

analyzer, 180, 181

inheritance, 459

Running Tools, 249, 250

Run options (Eclipse), 327, 337

runtime stack, 94, 95, 100

Runtime Type Identification. See RTTI.

RVA (relative virtual address), 369, 372, 374

S

sandbox, 479, 480, 487, 488

satellite view (Graphs), 67, 68, 199, 208, 209

save layout changes, 248

Save Tool As, 257

scripting

headless mode, 355

Jython, 295, 296

Script Manager, 315, 317, 319, 321, 326, 327

Script Manager window, 286, 288290, 292, 294, 295, 298

basic editor, 291

Eclipse, 287, 291, 313

script-oriented deobfuscation, 491

-scriptPath (headless analyzer), 353, 354, 357359

Search Memory, 116, 117

Search menu (CodeBrowser), 58, 114

For Direct References, 462, 508

For Instruction Patterns, 508, 509, 512

Search All, 510, 511

For Strings, 142, 266, 267

Memory, 116, 117, 507

Program Text, 115, 508

Next, 115

Previous, 115

Search All, 115

second-generation languages, 4

section headers, 24

sections

.bss, 71, 150, 153

.data, 71, 150, 373

.idata, 373

.text, 62, 71, 370, 372

self-modifying code, 471, 491

semaphore, 475

sequential flow, 186, 187, 189, 190, 198, 205

sequential flow instructions, 11

server administrator (Ghidra Server), 224

server directory, 35

server/server.conf (Ghidra Server), 218

server/svrREADME.html, 219221, 228

sessions, 548

setByte, 506

Set Comment, 128, 129, 132

Set Data Type submenu, 141

Array, 156

setEOLComment method, 305

Set Equate, 136

Set Image Base (Memory Map toolbar), 369

Set Language, 367

Set Register Values, 473

-s (gcc/ld), 152

shared projects, 34, 217, 218, 224, 235237, 240

accessing, 221, 230, 231

archiving, 225

authentication, 219, 221, 227, 228, 230, 231

creating (Ghidra Server), 221, 222

deleting, 225

merging files

no conflict, 234

potential conflict, 234

passwords, 221, 230, 231

PKI, 219, 221, 227, 228

project information, 231

projects and repositories, 221, 223, 229, 232

version control, 232238

viewing project information, 231

shellcode, 363, 365, 375379, 381383, 385394, 396400, 485

SHIFT-[ hotkey (Create Structure), 166, 167

Shiva, 471, 475, 490, 491

S hotkey (Search), 58, 116, 117, 507511

Simplify predication, 428, 430

.sinc file, 400425

slaspec, 428, 515, 516

.slaspec file, 404, 405, 408, 412

SLEIGH, 36, 404, 405

attaching variables, 422, 425

constructors, 408

Editor (Eclipse), 408

ia.sinc, 409425

register address space, 420

register definitions, 420

specification (slaspec), 428, 515, 516

tokens, 422

tokens and fields, 421424

sleighArgs.txt, 404

Snapshot icon, 64, 76, 79

software breakpoints, 490

software Interoperability, 7

source code, 444, 451, 452, 455, 457, 462

source code (Ghidra), 316

source code recovery, 5

source repository (Ghidra), 316

specific hash, 272

specifying data types

Create Array (hotkey [), 144

cycle groups, 141

Split Block tool (Memory Map toolbar), 370

stack, 471, 474476, 492, 493, 495, 496, 500

stack-allocated array, 154, 162

example, 155

stack-allocated parameters, 172

stack-allocated structures, 162

Stack analyzer, 94

Stack (display windows), 243

stack frame, 52, 9395, 100106, 108114, 401

stack frame analysis

decompiler-assisted, 109

Decompiler Parameter ID, 109, 113

PE files, 110

frame pointer, 95, 103106, 113, 114

in Listing view, 106

register-based parameters, 113

Stack Frame Editor, 111, 112

stack-manipulation operations, 11

stack pointer, 9498, 101106, 108, 111, 113, 500

stack references, 195

stack variables, 120124, 132

stack view, 105, 108, 111, 112

stale graph, 205

standard calling convention, 98

_start, 463465

static analysis, 6, 12, 90, 105, 486

static array assignments, 156

static linking, 22, 23, 213, 214, 465, 466

static member functions (C++), 99

static storage class (C++), 177

stdcall, 98, 99, 102

storage class, 177

strcpy function (C), 194

stream disassemblers

diStorm, 29

NASM (Netwide Assembler), 29

ndisasm, 29, 30

stream socket, 149

String Search results window, 265, 461

strings utility, 28

options, 29

stripped binary, 18, 152, 461, 465

structs. See structures.

Structure Editor window, 168171, 442

structure pointers, 171

structures, 147, 182

applying structure layouts, 171

arrays of, 164

creating, 160, 166, 167

decompiled, 160

disassembled, 157, 160, 163, 165

editing, 168171

editing members, 169

field access, 159, 163

field alignment, 160, 170

globally allocated, 161, 162, 166

heap-allocated, 162

disassembled, 157, 163, 165

layouts, 163, 164, 171

member access, 159, 171

offsets, 150, 153, 158164, 166, 168, 170172

recognizing use, 150

size, 163

stack-allocated, 162

starting address, 153, 158, 162

Structure Editor window, 168169, 171

Byte Offset, 170

Component Bits, 170

symbolic references, 150, 153, 158164, 166, 168, 170172

Union Editor window, 168

within structures, 164

SUB_ prefix, 126

superclasses, 175

SuperH4, 426

support directory (Ghidra), 37

support documentation, 3437

svrAdmin, 219221

Swing Look And Feel, 250, 251

switch statement

compiler variations, 444451

symbolic names, 90, 111

Symbol Interface

getAddress method, 298, 310

getName method, 293, 298, 307310

Symbol option (annotations), 153

Symbol References window, 8285, 90, 194, 195

symbols

renaming, 121, 122, 124, 125, 153

symbol table, 25, 52, 152

Symbol Table window, 8286, 194

Symbol Tree window, 48, 49, 5860, 9092, 121124, 148, 149, 181, 192, 214, 272280, 459461

Classes folder, 74, 75, 192, 459, 460

Exports folder, 73

Functions folder, 73, 74

imported libraries, 73

Imports folder, 72, 73, 280

Labels folder, 74

Namespaces folder, 75

synchronization primitives, 475

syntax (headless analyzer), 343, 351, 355, 356

Sysinternals, 488

system call, 99, 100

T

table lookup, 444

Table View (Ghidra Project window), 223

targets (navigational), 9093, 471, 474

TaskMonitor, 300

task tag (Eclipse), 320, 323, 328, 332, 333

tElock, 476, 478, 479, 483, 485, 486, 496

ternary operator (compiler variations), 455, 456

testing modules (Eclipse), 337, 385

.text section, 62, 71, 370, 372, 519, 520

third-generation languages, 4

third-party components, 34, 37

thiscall, 99, 173

this pointer, 99, 173, 176, 178, 181

T hotkey (Choose Data Type), 366

threads, 475

thunk function, 149, 212

Tip of the Day, 42

toAddr method, 301, 312, 313

TODO comments, 320, 332334, 403, 410, 411

Toggle Overview Margin, 62

token (SLEIGH), 421424

Tool Chest, 249, 257259, 547

Tool Options

Restore Defaults, 245

Tool, 250

Tool Options window, 54, 244, 246

tools, 242

connecting Ghidra tools, 68

c++filt utility, 26, 27

dumpbin utility, 2426, 29, 483

file utility, 16, 18, 280

Ghidra

Program Diff, 530532, 534, 538, 540, 541, 546, 547, 549

GNU debugger (GDB), 11, 478

ldd utility, 2226, 483

nm utility, 20, 21, 25, 27

objdump utility, 11, 24, 25, 29, 90, 111, 483

otool utility, 24, 25, 29

PeID (utility), 19, 20

PE Tools (utility), 1820

Running Tools, 249, 250

strings utility, 28, 29, 280

Tool Chest, 249, 257259, 547

VBinDiff, 528, 530

WinDbg, 11

WinDiff, 530

Tools menu (Ghidra)

Create, 253, 254

custom, 253

Save Tool As, 257

Tools menu (CodeBrowser), 56, 58, 68

Tools Options

Color Editor, 244

toString method, 307

-t strings option, 29

tutorials

Python scripting, 295

Eclipse, 316, 317

Ghidra, 35

Java, 316, 317

typeid, 180, 181, 458

type libraries, 149

U

Ultimate Packer for eXecutables. See UPX.

unconditional branching instructions, 11

undefined data, 507

Undock (display windows), 243

Undo (CTRL-Z hotkey), 120

ungroup vertices (Function Graph), 203

union construct, 168

Union Editor window, 168

union type, 168

unknown file analysis, 365

unknown file formats, 360

unknown processor architectures, 360

UNK_ prefix, 91, 120, 126

unpack, 482, 495, 498, 501503

unpatched file, 530, 534

unzip, 219, 220

-u parameter (Ghidra Server), 220

UPX, 275280, 282, 479, 481, 483486, 496

decompression stub, 482

packer, 276, 480

unpacker, 482

user32.dll

MessageBoxA, 483

user agreement (Ghidra), 34, 37, 38

$USER_HOME, 354

user home directory, 354

utilization rate, 445

V

validateOptions method, 384

variable indices, 151, 153

variable number of arguments, 97, 179, 432, 433

variables

global, 151153, 161, 167

layout, 101

local, 89, 94, 95, 101108, 110, 111, 114, 152, 154, 156, 158

renaming, 121, 122, 124, 125, 153

VBinDiff, 528, 530

version control, 232233, 235238

merging files, 234

no conflict, 234

potential conflict, 234

version tracking, 233

Version Tracking tool (Ghidra), 529, 546

correlators, 547549

footprints icon, 547

sessions, 548

Tool Chest, 547

vertices. See nodes.

vftables (C++), 181, 182, 191, 192, 194, 459, 460, 462, 463

indexing, 176

pointer, 173176, 178, 179

viewing

project information, 231

projects, 229

repositories, 229

View Project (Ghidra Project), 229, 231

View Recent (Ghidra Project), 229

View Repository (Ghidra Project), 229

virtual functions (C++), 173179, 191, 192, 195, 459, 460, 463

virtualization, 479

detecting

processor-specific behavioral changes, 488

virtualization-specific hardware, 488

virtualization-specific software, 487

virtual machine extension (VMX), 408411

virtual machine (VM), 487, 488

Visual Studio. See Microsoft C/C++, 452, 453, 454, 456

VM. See virtual machine.

VMProtect, 479

VMware, 487, 488

VMware Tools, 488

VMX (virtual machine extension), 408411

volatile keyword, 455

vulnerabilities, 6, 505

vulnerability analysis, 6

W

wildcards, 350, 510

WinDbg, 11

WinDiff, 530

windows

changing appearance, 250, 251

rearranging, 60, 68, 242

Windows, 47, 476, 477, 480, 483, 485, 487, 496

API, 166

GUI, 489

registry

RegOpenKey, 148

registry keys, 479, 488

SDK, 269

Sysinternals, 488

Windows Subsystem for Linux (WSL), 16, 17, 25

WinMain, 463

winnt.h, 477

Wireshark, 488, 489

word models, 142, 262, 265266, 284

modifying, 267

workspace

example, 258

write cross-reference, 191

X

x86

assembly syntax

AT&T vs. Intel, 9

instruction set, 8, 29

obfuscated binaries, 474496

processor files

ia.sinc, 409425

x86.idx, 406

x86-64.sla, 412, 415, 416

x86-64.slaspec, 412

x86.slaspec, 412

registers

debugging (DR0–DR7), 477

register-based parameters, 113

stack frame analysis, 94105

Z flag, 474

XML format export (Ghidra), 523

XREF, 64, 69, 185193

XREFs Field edit window, 186

XRefs window, 193

Z

Z flag (x86), 474

zip export format (Ghidra), 522

zooming (Function Graph View), 58, 60, 68

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.9.141