Megabeets
  • Member for 5 years
  • Last seen more than a month ago
How to print the value of register with Radare 2
Accepted answer
8 votes

Printing the registry values in radare2 is quite simple. All registers You can print all the General Purpose registers using dr: [0x55bea3305070]> dr rax = 0x55bea3305070 rbx = 0x00000000 rcx = ...

View answer
Is there any tool to visually see program stack in linux while debugging?
12 votes

You can easily view it using Visual Panels in radare2. Here's a teaser: Installation First of all, install radare2 from git repository: $ git clone https://github.com/radare/radare2.git $ cd radare2 $...

View answer
Creating a struct in IDA which contains a cString?
1 votes

IDA introduced "Variable Length Structures" and describe the usage of it with a very straight forward tutorial. In short, you need to make sure the "flexible" item is the last item ...

View answer
Writing a file with radare2 `w`?
Accepted answer
6 votes

TLDR radare2 opens a file in read-only mode by default. (see the manual r2 -h for further information.) to allow writing to a file, start radare2 in write mode (r2 -w file). when in a read-only ...

View answer
Import table vs Import Address Table
Accepted answer
14 votes

As general, I recommend reading the PE Format documentation on MSDN regarding the PE structure. Import Table The Import Table is actually called "Import Directory Table" and contains entries for ...

View answer
Reverse engineer .so file from android app with radare2
4 votes

There are several ways to show the different functions of a binary file in radare2. Start by opening the binary file and analyze it. $ r2 -A libdbm64.so Command: afl The simplest way to list the ...

View answer
Radare2 Debugging: How do I pipe a program's output to another's input?
Accepted answer
7 votes

This is a great question, and lucky you - radare2 provides several ways to achieve this. Let's go over the more basic and straightforward options. Setting up First things first, make sure to have ...

View answer
Radare2 produces null bytes on write
2 votes

This was probably a bug which I can't reproduce this now. My guess is that the VA is moved and now this address doesn't contain anything. If this bug still happens, please open an issue describing it ...

View answer
Is there any way to display the standard input and output of a program to Cutter's console while debugging?
Accepted answer
5 votes

Good news! In Cutter v1.10 (December 20, 2019) the team introduced native and remote debugger support. By default, the STDIO of the debuggee is redirected to the Console Widget inside Cutter. ...

View answer
How to find a symbol in a binary using radare2?
Accepted answer
15 votes

The f command is used to list all the flags from the selected flagspace. By default all the available flagspaces are selected. In order to select the 'symbols' flagspace and list only the flags inside ...

View answer
Meaning of Flags in ELF Section header?
Accepted answer
4 votes

The flag abbreviation of the letter "I" stands for SHF_INFO_LINK. Since readelf is open-source you can access its code to verify this. This will also show you the full list of Flag possibilities: ......

View answer
How to decompile with Hex Rays via a Python API?
Accepted answer
5 votes

Yes. The newer versions of IDA has official bindings for the Hex-Rays decompiler. Originally, the Python bindings were written by EiNSTeiN around the Hex-Rays Decompiler SDK API. Later it has been ...

View answer
radare2 how to interpret ascii-art color bars?
Accepted answer
2 votes

This chart describes the different Sections and Memory Segments in your binary. Each row in the chart is a different section where its name is in the rightest column. From the left, you can see its ...

View answer
Radare2 Disassembler How Do You Organize Visual Panels (V!)?
6 votes

Use TAB to move between the windows, use e to change name and command of a specific panel you are on. Use w to enter the window mode. "Window mode" allows you to control how the panels look like. In ...

View answer
Function names syntax returned by radare2's afl?
Accepted answer
5 votes

I will start by answering your specific three questions, and then will shed more light about the naming structure of functions in radare2. What is the meaning of the hexadecimal number after the ...

View answer
How to make Radare2 automatically disassemble next instruction after each `ds` debug single-step?
Accepted answer
2 votes

If you want to execute another command after doing ds you can simply use ; to add a new command. So for example, the command ds; pd 1 @ rip will step one instruction and disassemble the instruction at ...

View answer
radare2 ascii graph to image?
Accepted answer
9 votes

The ag command and subcommands can help you to output the visual graph into Graphviz format. [0x00000000]> ag? Usage: ag<graphtype><format> [addr] Graph commands: | aga[format] ...

View answer
How to identify different memory regions of an elf binary in radare2?
Accepted answer
2 votes

It is possible to list the sections and segments of a program using radare2. Sections Use iS to list the program's Sections: [0x00001c50]> iS [Sections] Nm Paddr Size Vaddr Memsz Perms ...

View answer
Writing ELF headers in Radare?
Accepted answer
16 votes

Yes, obviously you can. radare2 has built-in features to handle binary headers. This including reading, parsing and modifying the headers of the binary. And this is not different for elf or pe files, ...

View answer
Make r2 -i <script> use python3 rather than python2
Accepted answer
3 votes

OP did not mention their OS, thus I assume the OS is Linux. radare2 is using the default python version on your machine. That means that, probably, /usr/bin/python on your machine points to /usr/bin/...

View answer
Learning fine grained analysis in Radare with `a`?
2 votes

Binary analysis is not a simple thing and it is structured from a lot of different tasks that together might create a heavy and slow task. In order to get the best results, you need to understand what ...

View answer
Radare's `aaaa` and -AA what does it do, exactly?
Accepted answer
2 votes

When you execute the aaa command, radare is showing you what are the steps it takes. Each step has the command responsible for it inside parentheses. [0x00000000]> aaa [x] Analyze all flags ...

View answer
Debugging with radare2 using two terminals
Accepted answer
27 votes

It is actually very simple and works for me just fine as you can see in the following gif: First you need to figure out the tty of the terminal you want to redirect the STDIO to (a.k.a Terminal 2, T2)...

View answer
Does the Radare Debugger support STABS?
1 votes

radare2 is not a source level debugger, thus there is no support for STABS. That said, you can always use gdb as a backend for radare2 either by connecting radare2 to a running gdb session or by using ...

View answer
What does paddr, baddr, laddr, haddr, and hvaddr refer to?
Accepted answer
5 votes

Most of the time, you would not need any of these except the vaddr and the paddr. Since thoroughly explaining each of these names would take too much time, I'll share here the short meaning of each of ...

View answer
What is the right way to pack a payload with Python3's pwntools
Accepted answer
2 votes

Actually, this is a programming question and not an RE question. Anyway, you simply need to tell python to treat your payload as bytes by adding the bytes-literal b before the 'A'*140. >>> ...

View answer
`dmi libc puts~GLOBAL` does not show puts, just putspent?
Accepted answer
2 votes

This is right, and it was caused by using the wrong grep (the ~ character) in the article. This was due the fact that the output of dmi libc is different on different machines and also, the syntax of ...

View answer
What does the `$r` do in `pd $r`?
Accepted answer
4 votes

$r is one of the variables available in radare2. More specifically, $r is a variable which holds the height of the console. This command is shown on Visual Disassembly mode (Vp) and usually is not ...

View answer
Radare2 C output
15 votes

The pc command will output n bytes from the current seek (s) as a C array, where n is the Block size (b) or the length mentioned in the command. The output is then can be used to, for example, ...

View answer
How do I view the registers as signed intergers?
2 votes

Although radare2 provides a rich amount of commands to handle registers (see dr?), it is quite tricky to view the values of the registers in decimal mode. That said, I will show you two simple ...

View answer
1
2 3 4 5