Latest / CyberSecurity Summary / The Ghidra Book: The Definitive Guide
Transcript
- 0:00Speaker 1: Have you ever looked at a piece of software, you know,
- 0:02Speaker 1: an app or maybe part of your OS, and just
- 0:05Speaker 1: wondered what's really going on under the hood, Especially when
- 0:08Speaker 1: all you've got is that compiled binary, that black box
- 0:13Speaker 1: of machine language. How do you even start to peel
- 0:16Speaker 1: back those layers?
- 0:17Speaker 2: How do you see inside?
- 0:18Speaker 1: Our deep dive today is all about cracking that open
- 0:22Speaker 1: We're talking GIEDRA. It's a real powerhouse for software reverse engineering. Sorry.
- 0:28Speaker 2: Absolutely think of it like a universal translator from machine
- 0:31Speaker 2: code exactly.
- 0:32Speaker 1: Takes that dense, inscrutable stuff and makes it well understandable.
- 0:35Speaker 1: And here's the kicker, right, GUIDRA wasn't just built by
- 0:38Speaker 1: some startup. This thing came out of the NSA.
- 0:41Speaker 2: Yeah, a National security agency, developed in house.
- 0:44Speaker 1: And then amazingly they released it open source to the public,
- 0:48Speaker 1: which was.
- 0:49Speaker 2: A pretty big deal at the time.
- 0:50Speaker 1: Still is it really is? So this isn't some niche tool,
- 0:53Speaker 1: it's government grade stuff for understanding compiled code, and now
- 0:57Speaker 1: you know, anyone can use it. So our mission today
- 1:00Speaker 1: is to unpack what GEDRA can do from just looking
- 1:03Speaker 1: at a file to really advance stuff like customization, even
- 1:09Speaker 1: tackling antire tricks.
- 1:10Speaker 2: Yeah, it's about getting you informed about that digital.
- 1:13Speaker 1: Core, giving you that shortcut.
- 1:15Speaker 2: What's really cool is how Geedra kind of levels the
- 1:17Speaker 2: playing field. It gives you insights into binaries that would
- 1:20Speaker 2: otherwise just be opaque. Whether you're a pro reverse engineer
- 1:25Speaker 2: looking at malware or just you know, super curious about
- 1:28Speaker 2: how software actually works. Guidra lets you see that digital core.
- 1:32Speaker 1: Okay, so before we jump right into Gidra itself, let's
- 1:34Speaker 1: back up a bit. Why do we even need tools
- 1:36Speaker 1: like this? Why look inside compiled software? Shouldn't we just
- 1:39Speaker 1: I don't know, trust it?
- 1:41Speaker 2: Well? Ideally maybe, but the real world's mess here. A
- 1:45Speaker 2: huge reason is vulnerability.
- 1:47Speaker 1: Analysis, finding security holes.
- 1:49Speaker 2: Exactly, discovering and analyzing potentially exploitable flaws. You might use
- 1:53Speaker 2: fuzzing dynamic stuff to find crashes, but Guedra lets you
- 1:56Speaker 2: do static analysis to really understand if something's exploitable and
- 2:00Speaker 2: how what are the conditions? Static analysis is key? There?
- 2:04Speaker 1: Gotcha? What else?
- 2:05Speaker 2: Then? There's software interoperability, big one. If something's only released
- 2:09Speaker 2: as a binary, making other software work with it, or
- 2:12Speaker 2: writing plugins, it's incredibly hard.
- 2:15Speaker 1: Ah like writing drivers for hardware maybe.
- 2:18Speaker 2: Perfect example, drivers for hardware that only officially supports, say Windows,
- 2:22Speaker 2: but you want it on Linux, you'll probably need to
- 2:25Speaker 2: do some serious reverse engineering, maybe even beyond drivers into
- 2:29Speaker 2: the firmware.
- 2:30Speaker 1: Okay, that makes sense.
- 2:31Speaker 2: And then there's always the let's call it source code recovery.
- 2:34Speaker 1: Angle, right, trying to get back to something readable.
- 2:36Speaker 2: Yeah, you'll never get the original source code back perfectly
- 2:39Speaker 2: with comments and all that. We can't do something readable
- 2:42Speaker 2: from a binary. That's still super attractive competitive analysis, understanding
- 2:47Speaker 2: old systems. Lots of reasons.
- 2:49Speaker 1: Okay, I get the why, But what makes it so
- 2:52Speaker 1: darn difficult going from that compiled binary back to something
- 2:56Speaker 1: human readable. You said it's like rebuilding a cake from crumb.
- 3:00Speaker 2: That's a good analogy. The core problem is the compilation
- 3:03Speaker 2: process itself.
- 3:04Speaker 1: It's lossy, lossy meaning information gets thrown away.
- 3:07Speaker 2: Exactly when you compile C plus plus or Java down
- 3:10Speaker 2: to machine code. Tons of useful info is just gone.
- 3:14Speaker 2: Variable names, function names, comments, forget it. Wow, even variable types.
- 3:20Speaker 2: At the machine level, GIDRA might see, say thirty two
- 3:23Speaker 2: bits of data being moved. Is that an integer, a
- 3:25Speaker 2: floating point number, a memory address, a pointer.
- 3:28Speaker 1: It doesn't know.
- 3:29Speaker 2: It has to infer it, it has to look at
- 3:30Speaker 2: how that data is used later on to make an
- 3:32Speaker 2: educated guess ah, and that ambiguity that inferenced. That's why
- 3:36Speaker 2: decompilation is still a really active research area in computer science.
- 3:40Speaker 2: It's fundamentally hard.
- 3:41Speaker 1: So gijra's first big job is to try and bridge
- 3:43Speaker 1: that gap, to get those machine code crumbs into some
- 3:46Speaker 1: kind of order, and that starts with disassembly right.
- 3:49Speaker 2: Right at its most basic level. GIDRA takes the machine language,
- 3:53Speaker 2: those raw binary patterns OPT codes and turns them into
- 3:56Speaker 2: assembly language.
- 3:57Speaker 1: The mnemonics like a push and mov.
- 4:00Speaker 2: Exactly, those short memorable sequences pH EBP, mv EAX, stuff
- 4:05Speaker 2: like that. It makes the raw instructions way easier for
- 4:08Speaker 2: humans to read and track.
- 4:10Speaker 1: But even that basic step isn't simple, not entirely.
- 4:14Speaker 2: First, Geedra has to figure out what's actually code versus
- 4:17Speaker 2: what's just data stored in.
- 4:18Speaker 1: The program because they can be mixed together.
- 4:20Speaker 2: They often are. Luckily standard file formats like PE for
- 4:25Speaker 2: Windows or ELF for Linux and Unix have headers. These
- 4:29Speaker 2: headers give GEDRA clues about where the code sections likely
- 4:32Speaker 2: start and end.
- 4:33Speaker 1: OK.
- 4:34Speaker 2: Then it has to match the binary opcodes it finds
- 4:37Speaker 2: to the right assembly mnemonic that's mostly a table look up,
- 4:40Speaker 2: but it gets tricky with things like instruction prefixes or
- 4:43Speaker 2: variable length instructions, which you see a lot in say
- 4:46Speaker 2: Intel by eighty six architecture.
- 4:48Speaker 1: Right, So, assuming it figures out the instructions, how does
- 4:50Speaker 1: it know which one comes next. Programs don't just run
- 4:53Speaker 1: straight down, they jump around.
- 4:54Speaker 2: That's the next big challenge navigating control flow. A really
- 4:57Speaker 2: simple approach is linear sweep, just assemble one instruction after
- 5:01Speaker 2: the other.
- 5:01Speaker 1: But that breaks easily.
- 5:03Speaker 2: Oh yeah, it gets totally confused by jumps and branches,
- 5:06Speaker 2: and it can easily misinterpret data as code. So GIDRI
- 5:09Speaker 2: uses a much smarter method called recursive descent.
- 5:12Speaker 1: Recursive descent how does that work?
- 5:15Speaker 2: So when it hits a conditional jump like jump if
- 5:17Speaker 2: not zero, it basically says, okay, the program could go
- 5:20Speaker 2: this way, or it could just continue straight on. It
- 5:24Speaker 2: picks one path to follow immediately and puts the other
- 5:27Speaker 2: path's starting address on a list to check out later,
- 5:29Speaker 2: a to do list pretty much a list of deferred addresses.
- 5:33Speaker 2: If it's an unconditional jump, it tries to figure out
- 5:35Speaker 2: the target and just goes there.
- 5:36Speaker 1: Okay, that sounds much more robust, but What about jumps
- 5:39Speaker 1: where the target isn't obvious.
- 5:40Speaker 2: Ah. Yeah, that's where recursive descent hits its limits too,
- 5:44Speaker 2: things like jump racks in I two. The target addresses
- 5:48Speaker 2: whatever value is in the racks register at runtime.
- 5:50Speaker 1: So GIDRA can't know that just by looking at the code.
- 5:53Speaker 2: Nope, static analysis can't predict runtime values. Or think about
- 5:57Speaker 2: a reinstruction return from function That tells you nothing about
- 6:01Speaker 2: where execution will go next.
- 6:02Speaker 1: So what does it do?
- 6:03Speaker 2: Then? That's when it goes back to its to do list.
- 6:06Speaker 2: It picks up one of those deferred addresses it saved
- 6:08Speaker 2: earlier and starts disassembling from there. That's the recursive part
- 6:12Speaker 2: of the name. It keeps exploring all these potential paths
- 6:15Speaker 2: until it's mapped out as much of the program's structure
- 6:18Speaker 2: as possible.
- 6:19Speaker 1: Wow. Okay, so it's not just translating, it's actively exploring
- 6:23Speaker 1: and mapping the possibilities.
- 6:24Speaker 2: Quite the detective, you could say that.
- 6:26Speaker 1: So GIDRA does all this heavy lifting with disassembly. How
- 6:30Speaker 1: does a user someone sitting down with it, actually get started?
- 6:34Speaker 1: What's the entry point?
- 6:35Speaker 2: It's actually pretty user friendly. You launch gedra first time,
- 6:38Speaker 2: you'll see the license agreement. Click through that. Then you
- 6:41Speaker 2: get a tip of the day and the main Gidra
- 6:43Speaker 2: project window pops up. Okay, your first real step is
- 6:46Speaker 2: to create a project. Geedra uses this project to keep
- 6:49Speaker 2: everything organized. The file you're analyzing, your notes, everything. You
- 6:53Speaker 2: choose between non shared or shared. For working alone, you
- 6:57Speaker 2: just pick non shared, give it a directory and a name. Simple,
- 7:00Speaker 2: got it.
- 7:01Speaker 1: Project setup. Then you bring in the file.
- 7:03Speaker 2: Right, you import the file either file import file or
- 7:07Speaker 2: just drag and drop it onto the project window. Geedra
- 7:10Speaker 2: looks at the file, tries to figure out what it
- 7:13Speaker 2: is pe elf, macho, and suggests a format a loader.
- 7:17Speaker 1: And you usually just accept the default.
- 7:19Speaker 2: Often yeah, getar's pretty good at recognizing common formats. If
- 7:24Speaker 2: it's something weird or just raw binary code, you might
- 7:26Speaker 2: select raw binary and maybe give it some hints. There
- 7:29Speaker 2: are options you can tweak as you get more experienced,
- 7:31Speaker 2: like telling it to load external libraries.
- 7:34Speaker 1: Okay, file imported. What happens then?
- 7:36Speaker 2: Then Gidra asks if you want to autoanalyze it, and
- 7:40Speaker 2: you almost always say yes.
- 7:42Speaker 1: That's where the magic happens.
- 7:43Speaker 2: That's where a ton of automated work kicks in. Getra
- 7:45Speaker 2: starts identifying functions finding data, recognizing common code patterns, building
- 7:49Speaker 2: cross references, all that stuff we talked about. You can
- 7:52Speaker 2: actually watch its progress in the bottom right of the
- 7:54Speaker 2: main window the cod browser, or look at the detailed
- 7:57Speaker 2: log file.
- 7:57Speaker 1: So it does a massive amount of groundwork automatically.
- 8:00Speaker 2: Absolutely, it takes that raw imported binary and brings it
- 8:04Speaker 2: into a much more structured, analyzed state ready for you
- 8:07Speaker 2: to start exploring. It really guides you in.
- 8:09Speaker 1: Okay, So the auto analysis finishes and you're dropped into
- 8:13Speaker 1: the Gidra code Browser. That's the main workspace, right, What
- 8:16Speaker 1: does that look like? What are the key parts?
- 8:18Speaker 2: Code browser is your command center. It's a multi window interface,
- 8:21Speaker 2: quite rich by default. You'll likely see a few key windows,
- 8:26Speaker 2: but let's focus on maybe the three most important ones
- 8:28Speaker 2: to start. Okay, First, there's the listing window. This is
- 8:31Speaker 2: your assembly view. The direct translation of machine code into mnemonics.
- 8:35Speaker 2: You see addresses the bites.
- 8:37Speaker 1: The instructions, and those arrows you mentioned.
- 8:39Speaker 2: Yeah, crucial feature flow arrows. They graphically show you where
- 8:43Speaker 2: jumps and calls go. Solid arrows for unconditional jumps, dash
- 8:47Speaker 2: for conditional ones, hover over them, double click to follow them.
- 8:50Speaker 2: Makes tracing the program's path so much easier than just
- 8:53Speaker 2: reading addresses.
- 8:54Speaker 1: Helps visualize the flow exactly.
- 8:56Speaker 2: Then right next to it often is the decompiler window.
- 9:00Speaker 1: Ah, the crown jewel.
- 9:01Speaker 2: Arguably yes, this is where GADRA tries its best to
- 9:05Speaker 2: reconstruct high level C like source code from the assembly.
- 9:10Speaker 1: How good is it?
- 9:11Speaker 2: It's often remarkably good. It gives you a much much
- 9:15Speaker 2: higher level understanding of what the code is trying to
- 9:17Speaker 2: do the logic compared to just staring at assembly. Now,
- 9:20Speaker 2: it's not perfect.
- 9:21Speaker 1: Right because of that lossy compilation precisely.
- 9:24Speaker 2: Sometimes it has to guess types, maybe it overuses casts,
- 9:27Speaker 2: and it always generates C even if the original code
- 9:29Speaker 2: was C plus plus or something else. But still it's
- 9:32Speaker 2: incredibly valuable for quickly grasping function logic.
- 9:35Speaker 1: Okay, listing for assembly decompiler for pseudo C. What's the
- 9:39Speaker 1: third key window?
- 9:40Speaker 2: The symbol tree window. This is all about program structure.
- 9:43Speaker 2: It shows you information extracted from the binary symbol tables
- 9:46Speaker 2: if they exist, like function names, functions, labels, global variables, classes,
- 9:50Speaker 2: name spaces, and really importantly, imports and exports.
- 9:54Speaker 1: Imports being stuff the program uses from outside, like libraries.
- 9:58Speaker 2: YEP functions imports from shared libraries and exports are the
- 10:03Speaker 2: entry points into this file. Things it provides for others,
- 10:06Speaker 2: including the main program entry point often called entry.
- 10:09Speaker 1: Or start, and this helps you navigate massively.
- 10:12Speaker 2: It's also where you often spot C plus plus code
- 10:15Speaker 2: because of name mangling. C plus plus compilers tweak function
- 10:19Speaker 2: names to handle overloading adding extra characters. GIDRA shows you
- 10:23Speaker 2: these mangled names and often tries to demangle them back
- 10:26Speaker 2: to something readable. Super useful for understanding C plus plus binaries.
- 10:30Speaker 1: So these three windows listing, Decompiler, symbol tree give you
- 10:34Speaker 1: different complementary views into the binary.
- 10:37Speaker 2: That's the idea assembly for the ground truth dcompiler for
- 10:40Speaker 2: high level logic, Symbol tree for overall structure and external connections.
- 10:44Speaker 2: GET helps you bring order to the chaos.
- 10:46Speaker 1: It's like giving you different lenses to look through. Okay,
- 10:48Speaker 1: so you have these views, how do you actually see
- 10:51Speaker 1: the connections? How does function A relate to function B?
- 10:54Speaker 1: Or where is this piece of data used?
- 10:56Speaker 2: This where cross references or xrafs come in.
- 11:00Speaker 1: Absolutely fundamental the glue holding the program together.
- 11:03Speaker 2: Exactly what they are. Think of every address in the
- 11:06Speaker 2: program as a potential node in a giant graph. Xrfs
- 11:10Speaker 2: are the edges connecting those notes.
- 11:11Speaker 1: How do they show up?
- 11:12Speaker 2: In the listing window? Next to an instruction or a
- 11:15Speaker 2: data definition, you'll often see something like XRF three function
- 11:19Speaker 2: AC data location R. It tells you what other locations refer.
- 11:23Speaker 1: To this spot, and the letters mean different things. Are
- 11:26Speaker 1: WCB right.
- 11:29Speaker 2: For data references, you'll see R for read, W for wright.
- 11:32Speaker 2: If its address is taken used as a pointer for
- 11:35Speaker 2: code references, C means it's being called like a function call,
- 11:39Speaker 2: and J means it's being jumped to.
- 11:41Speaker 1: Okay, so how would you use that in practice?
- 11:43Speaker 2: Let's say you find a suspicious string in the data section,
- 11:46Speaker 2: maybe something like enter password. You can look at the
- 11:49Speaker 2: xrfs to that string's address, and that tells you it'll
- 11:51Speaker 2: point you directly to the code locations that use that string,
- 11:54Speaker 2: so you can instantly jump to the part of the
- 11:56Speaker 2: code that's probably handling the password input.
- 11:59Speaker 1: AH very power erful for tracking.
- 12:00Speaker 2: Things down incredibly or flip it around. If you identify
- 12:05Speaker 2: a function that looks vulnerable, you can look at its
- 12:07Speaker 2: XRIs to see which other functions call this potentially dangerous function.
- 12:12Speaker 2: GEDRA has dedicated windows just for managing and exploring these references.
- 12:16Speaker 2: It lets you build that mental map of dependencies.
- 12:19Speaker 1: Beyond just lists of references. Does giredra help visualize these connections?
- 12:23Speaker 2: Yes, absolutely, okay. Graphs are another strong point. The main
- 12:26Speaker 2: one is the function graph few what does that show?
- 12:29Speaker 2: It takes a single function and displays it as a
- 12:32Speaker 2: flood chart. Each node is a basic block, a sequence
- 12:35Speaker 2: of instructions with no jumps in or out except at
- 12:38Speaker 2: the beginning and end. The edges show the control flow
- 12:40Speaker 2: that jumps and branches between blocks.
- 12:42Speaker 1: So you can see loops and conditional paths visually.
- 12:45Speaker 2: Precisely. You can zoom in, pan around, even collapse blocks
- 12:48Speaker 2: to simplify complex functions. It makes understanding the logic flow
- 12:52Speaker 2: much more intuitive than just reading linear assembly. Guedra also
- 12:55Speaker 2: offers function call graphs, which show the bigger picture how
- 12:58Speaker 2: different functions across the entire program call each other.
- 13:01Speaker 1: So putting it together, the xrafs and graphs really let
- 13:05Speaker 1: you untangle that complex web inside a binary.
- 13:08Speaker 2: They make the invisible structure visible, letting you navigate and
- 13:11Speaker 2: comprehend behavior that would otherwise be incredibly hard to follow.
- 13:15Speaker 1: Now, Geidra sounds amazing out of the box, but you
- 13:18Speaker 1: mentioned it's extensible. What if it doesn't do exactly what
- 13:21Speaker 1: you need, or you want to automate something repetitive.
- 13:24Speaker 2: Great question. That's where Giedra's extensibility really shines. If you
- 13:29Speaker 2: need a feature Gedra doesn't have, or you want to
- 13:31Speaker 2: automate a tedious analysis task, you often can the primary
- 13:35Speaker 2: ways through giedras scripting.
- 13:37Speaker 1: Scripting like writing small programs to control Gijra exactly.
- 13:41Speaker 2: You can write scripts in Java or Python. There's a
- 13:44Speaker 2: built in script manager to organize, edit and run them.
- 13:47Speaker 1: What can scripts do?
- 13:48Speaker 2: Lots of things? They have access to a simplified flat
- 13:51Speaker 2: API that lets you interact with the program being analyzed.
- 13:54Speaker 2: You can get the current address, read or write bytes,
- 13:57Speaker 2: find specific byte sequences, iterate through funds, examine instructions.
- 14:02Speaker 1: So you could write a script to say, find all
- 14:05Speaker 1: functions that use a specific instruction.
- 14:07Speaker 2: Easily, or account how many times a certain function is called,
- 14:11Speaker 2: or automatically rename functions based on patterns you find, or
- 14:14Speaker 2: even modify the program's memory. If you're doing emulation or patching,
- 14:18Speaker 2: you can print results to the console, add comments automatically.
- 14:21Speaker 2: It's very flexible for automating tasks.
- 14:24Speaker 1: Beyond simple scripts, can you add bigger pieces of functionality.
- 14:28Speaker 2: Yes, you can develop custom analyzers. Gadra's autoanalysis uses many
- 14:33Speaker 2: built in analyzers. One example is the function id analyzer,
- 14:37Speaker 2: which tries to identify common library functions by matching their
- 14:40Speaker 2: code patterns against pre built databases fight dates.
- 14:44Speaker 1: So it labels things like print automatically, right.
- 14:47Speaker 2: If it recognizes the pattern. But you can build your
- 14:49Speaker 2: own analyzers in Java using gidra's development framework in Eclipse.
- 14:53Speaker 2: Maybe an analyzer that specifically looks for return oriented programming
- 14:56Speaker 2: ROP gadgets those short instruction sequences useful for exploitation.
- 15:00Speaker 1: Okay, and you mentioned loaders earlier.
- 15:02Speaker 2: Yes, custom loadors. If Gidra doesn't recognize a specific file format,
- 15:06Speaker 2: maybe some custom firmware image or packed executable, you can
- 15:10Speaker 2: write a loader module to teach Gidra how to interpret it,
- 15:13Speaker 2: how to map it into memory for analysis.
- 15:15Speaker 1: So you could write a loader for maybe shell code
- 15:18Speaker 1: embedded inside a word document.
- 15:20Speaker 2: Potentially. Yes, if you can write code to extract the
- 15:23Speaker 2: shell code and tell Gidra where to load it and
- 15:25Speaker 2: how it's structured, then gidrick can analyze.
- 15:27Speaker 1: It, and the deepest level of customization.
- 15:30Speaker 2: That would be processor modules. These define how gidra actually
- 15:33Speaker 2: disassembles instructions for a given CPU architecture. Gidri uses its
- 15:38Speaker 2: own language called s LAAG. For this. You could potentially
- 15:42Speaker 2: modify existing processor definitions or even add support for a
- 15:45Speaker 2: whole new processor. Although that's quite advanced.
- 15:48Speaker 1: Wow, And can you automate all this without the GI.
- 15:51Speaker 2: Yep headless mode. You can run gidra from the command
- 15:53Speaker 2: line using Analyze headless. You can tell it to import
- 15:56Speaker 2: a file, run the AutoAnalyzers, run spasific scripts, bulkitscript, and
- 15:59Speaker 2: out results all without ever opening the graphical interface.
- 16:03Speaker 1: Oh.
- 16:03Speaker 2: Great for batch processing lots of files.
- 16:05Speaker 1: So gidra isn't just a tool, It's really a platform.
- 16:08Speaker 1: You can shape it, extend it, automate it to tackle
- 16:11Speaker 1: very specific problem.
- 16:12Speaker 2: That's exactly right. You're not just using it, you can
- 16:14Speaker 2: build upon it.
- 16:15Speaker 1: Okay, let's talk about the real world, which, as you said,
- 16:19Speaker 1: is messy. Reverse engineering isn't always against clean, straightforward code.
- 16:24Speaker 1: What about differences between compilers or when software deliberately tries
- 16:29Speaker 1: to hide what it's doing.
- 16:31Speaker 2: Yeah, those are major hurdles. First, compiler variations, the exact
- 16:35Speaker 2: same C plus plus code can produce wildly different assembly
- 16:39Speaker 2: depending on the compiler GCC versus CLIG versus Microsoft's compiler,
- 16:43Speaker 2: and even just the optimization level used like Nanniko two
- 16:46Speaker 2: versus a debug build. How different, very different. A simple
- 16:49Speaker 2: switch statement might become an efficient jump table or slow
- 16:52Speaker 2: series of comparisons. Debug builds often have extra checks and
- 16:56Speaker 2: simple information, while release builds are stripped and optimized.
- 17:00Speaker 1: What about optimizations like inlining.
- 17:02Speaker 2: That's a big one. Function inlining can completely remove a
- 17:05Speaker 2: function call. Pasting the function's code directly where it was
- 17:08Speaker 2: called makes following the logic harder because the explicit call
- 17:11Speaker 2: is gone.
- 17:12Speaker 1: And C plus plus adds its own wrinkles.
- 17:15Speaker 2: Oh yes, things like run time type information RTTI use
- 17:19Speaker 2: for features like dynamic AST. Guidra has analyzers for some
- 17:23Speaker 2: RTTI formats, but often relies on that name. Mangling we
- 17:26Speaker 2: talked about. If a binary is stripped, meaning simple information
- 17:30Speaker 2: is removed, finding C plus plus structures gets much harder.
- 17:35Speaker 2: Even finding the main entry point main function in a
- 17:38Speaker 2: stripped binary requires knowing how the specific compiler sets things.
- 17:42Speaker 1: Up, So just the compiler choices make a big difference.
- 17:44Speaker 1: What about intentional roadblocks anti reverse engineering?
- 17:48Speaker 2: That's the next level of challenge obfuscation is about making
- 17:51Speaker 2: the binary intentionally confusing many ways, inserting junk code instructions
- 17:56Speaker 2: that don't actually do anything but look like real code
- 17:58Speaker 2: to confuse the disassembler using obscure jump targets, maybe jumping
- 18:02Speaker 2: into the middle of another valid instruction. Sometimes they'll load
- 18:06Speaker 2: libraries dynamically using OS functions like load library instead of
- 18:09Speaker 2: standard imports, hiding dependencies. Or they might use hashes of
- 18:13Speaker 2: function names instead of plane strings, making simple stream searches less.
- 18:16Speaker 1: Effective, trying to break the analysis tools exactly.
- 18:20Speaker 2: And then there's anti dynamic analysis detecting if the program
- 18:23Speaker 2: is running inside a virtual machine or a sandbox, looking
- 18:27Speaker 2: for specific files, registry keys, or artifacts left by virtualization
- 18:32Speaker 2: software like VMware tools. If detected, the program might just
- 18:36Speaker 2: refuse to run or behave.
- 18:37Speaker 1: Differently sneaky and anti debugging yep.
- 18:41Speaker 2: Actively trying to stop debuggers. Yeah, they might intentionally trigger
- 18:44Speaker 2: exceptions that debuggers handled differently, or on Linux Unix they
- 18:48Speaker 2: might use tricks with the sirtrace system call, which debuggers
- 18:51Speaker 2: like GDB rely on to prevent a debugger from attaching
- 18:54Speaker 2: in the first place.
- 18:54Speaker 1: It really is an arms race. So faced with all this,
- 18:57Speaker 1: can GUDRA still.
- 18:58Speaker 2: Help it absolutely can. Static analysis is often key to
- 19:02Speaker 2: defeating these techniques For things like packed or encrypted code
- 19:05Speaker 2: where the real code is hidden initially. You could sometimes
- 19:08Speaker 2: use GETRA scripting and emulation capabilities to simulate the unpacking
- 19:12Speaker 2: or decryption routine.
- 19:13Speaker 1: You run the deoccuscation code virtually sort of, you emulate
- 19:17Speaker 1: just that small part.
- 19:18Speaker 2: Let it decode the hidden section in memory, and then
- 19:21Speaker 2: you can tell Guedro to reanalyze that now decoded memory.
- 19:24Speaker 2: It lets use statically analyzed code that was initially hidden.
- 19:28Speaker 1: Clever, and what about changing the binary? Can GEDRA help
- 19:31Speaker 1: with patching?
- 19:32Speaker 2: Yes? Patching binaries is another common use case. Maybe you
- 19:35Speaker 2: want to change a string bypass a license check for
- 19:38Speaker 2: educational purposes, of course, or fix a bug in a
- 19:41Speaker 2: program where you don't have the source.
- 19:42Speaker 1: How do you do it?
- 19:43Speaker 2: Guedra helps you find the spot you want to change,
- 19:46Speaker 2: using a search tools, searching memory for byte sequences or strings,
- 19:50Speaker 2: or even searching for specific instruction patterns. Once you find it,
- 19:54Speaker 2: you can use the byte viewer window, which acts like
- 19:56Speaker 2: a hex editor, to directly modify the bytes, or use
- 19:59Speaker 2: scripts for more complex patches, and.
- 20:01Speaker 1: Then save the modified file.
- 20:03Speaker 2: File export program. Unless you save your changes back to
- 20:05Speaker 2: a new executable file, though you need to be careful
- 20:08Speaker 2: about things like file offsets and relocations.
- 20:11Speaker 1: One last area comparing files. What if you have two
- 20:14Speaker 1: versions of a program or want to see what changed
- 20:17Speaker 1: in an update.
- 20:17Speaker 2: Guidra has excellent binary diffing tools for that. It's super
- 20:22Speaker 2: useful for seeing what changed between versions, maybe porting your
- 20:25Speaker 2: analysis from an old version to a new one, or
- 20:27Speaker 2: merging work with colleagues.
- 20:29Speaker 1: What tools does it offer.
- 20:31Speaker 2: There's program diff which shows two files side by side
- 20:34Speaker 2: and synchronized listing windows, highlighting differences in color. You can
- 20:38Speaker 2: choose to ignore, replace, or merge changes. There's also function
- 20:42Speaker 2: comparison for just comparing two specific functions and for more
- 20:46Speaker 2: complex scenarios. Version tracking helps correlate functions in data between
- 20:51Speaker 2: different versions, even finding functions that are similar but not
- 20:54Speaker 2: identical fuzzy matches.
- 20:56Speaker 1: So it's not just analysis, but also modification and comparison
- 20:59Speaker 1: whole life cycle.
- 21:00Speaker 2: Pretty much. Geydra provides a really comprehensive toolkit for dealing
- 21:04Speaker 2: with binaries, from initial understanding right through to modification and
- 21:08Speaker 2: tracking changes over time, even when facing obfuscation.
- 21:11Speaker 1: It's incredible. From its somewhat shadowy origins inside the NSA
- 21:15Speaker 1: to now being this vital open source tool. Geedra really
- 21:18Speaker 1: does empower anyone to decode that digital core.
- 21:21Speaker 2: It truly does. It goes way beyond just showing you bytes.
- 21:25Speaker 2: It's an ecosystem for deep analysis, for active modification, for collaboration.
- 21:30Speaker 2: That ability to pull together different kinds of information, assembly,
- 21:33Speaker 2: decompiled code, cross references graphs, and look at the problem
- 21:37Speaker 2: from multiple angles is just so valuable.
- 21:40Speaker 1: So thinking about all this, the complexity compilers add, the
- 21:44Speaker 1: deliberate tricks used to hide code, makes you wonder, doesn't it.
- 21:48Speaker 1: What surprising things might Geidra reveal If you pointed it
- 21:51Speaker 1: at the everyday software you use, maybe even the OS
- 21:54Speaker 1: on your phone.
- 21:54Speaker 2: Or computer, it's a fascinating thought. You might be surprised
- 21:57Speaker 2: what's really going on under the surface.