3.2 Block size

The block size is the default view size for radare. All commands will work with this constraint, but you can always temporally change the block size just giving a numeric argument to the print commands for example (px 20)

[0xB7F9D810]> b?
Usage: b[f flag]|[size]  ; Change block size
  > b 200                ; set block size to 200
  > bt next @ here       ; block size = next-here
  > bf sym.main          ; block size = flag size

The 'b' command is used to change the block size:

[0x00000000]> b 0x100   ; block size = 0x100
[0x00000000]> b +16     ;  ... = 0x110
[0x00000000]> b -32     ;  ... = 0xf0

The 'bf' command is used to change the block size to the one specified by a flag. For example in symbols, the block size of the flag represents the size of the function.

[0x00000000]> bf sym.main    ; block size = sizeof(sym.main)
[0x00000000]> pd @ sym.main  ; disassemble sym.main
  ...

You can perform these two operations in a single one (pdf):

[0x00000000]> pdf @ sym.main

Another useful block-size related is 'bt' that will set a new block size depending on the current offset and a 'end' address. This is useful when working with io-streams like sockets or serial ports, because you can easily set the block size to fit just a single read. For example

$ radare socket://www.gogle.com:80/
[0x0000000]> w GET /\r\n\r\n
[0x0000000]> bt _sockread_2 @ _sockread_1

You can also use this command to manually get the interpolation between two search hits (for example when looking for headers and footers in a raw disk image).