First, you have to understand that the pdf command is used to disassemble functions, so you first have to look for function starting points (I think that they are using symbols and some others heuristics to find it).
To get an automatic analysis of the functions, just type aaa first. It will run most of the required analysis on the executable. Then, type pdf.
If you just want a raw disassembly without function analysis, then type just pd.
The logic behind the radare commands is that each character of the command has a meaning and build tree-like command family.
For example, the 'p' is for the 'printing' command family. Try to type p?, you will get the following:
[0x00005430]> p?
|Usage: p[=68abcdDfiImrstuxz] [arg|len] [@addr]
| p=[?][bep] [blks] [len] [blk] show entropy/printable chars/chars bars
| p2 [len] 8x8 2bpp-tiles
| p3 [file] print stereogram (3D)
| p6[de] [len] base64 decode/encode
| p8[?][j] [len] 8bit hexpair list of bytes
| pa[edD] [arg] pa:assemble pa[dD]:disasm or pae: esil from hexpairs
| pA[n_ops] show n_ops address and type
| p[b|B|xb] [len] ([skip]) bindump N bits skipping M
| pb[?] [n] bitstream of N bits
| pB[?] [n] bitstream of N bytes
| pc[?][p] [len] output C (or python) format
| pC[d] [rows] print disassembly in columns (see hex.cols and pdi)
| pd[?] [sz] [a] [b] disassemble N opcodes (pd) or N bytes (pD)
| pf[?][.nam] [fmt] print formatted data (pf.name, pf.name $<expr>)
| ph[?][=|hash] ([len]) calculate hash for a block
| p[iI][df] [len] print N ops/bytes (f=func) (see pi? and pdi)
| pm[?] [magic] print libmagic data (see pm? and /m?)
| pr[?][glx] [len] print N raw bytes (in lines or hexblocks, 'g'unzip)
| p[kK] [len] print key in randomart (K is for mosaic)
| ps[?][pwz] [len] print pascal/wide/zero-terminated strings
| pt[?][dn] [len] print different timestamps
| pu[?][w] [len] print N url encoded bytes (w=wide)
| pv[?][jh] [mode] show variable/pointer/value in memory
| p-[?][jh] [mode] bar|json|histogram blocks (mode: e?search.in)
| px[?][owq] [len] hexdump of N bytes (o=octal, w=32bit, q=64bit)
| pz[?] [len] print zoom view (see pz? for help)
| pwd display current working directory
Then, the second letter (d) stands for 'disassemble', try pd?:
[0x00005430]> pd?
|Usage: p[dD][ajbrfils] [sz] [arch] [bits] # Print Disassembly
| NOTE: len parameter can be negative
| NOTE: Pressing ENTER on empty command will repeat last pd command and also seek to end of disassembled range.
| pd N disassemble N instructions
| pd -N disassemble N instructions backward
| pD N disassemble N bytes
| pda disassemble all possible opcodes (byte per byte)
| pdb disassemble basic block
| pdc pseudo disassembler output in C-like syntax
| pdC show comments found in N instructions
| pdk disassemble all methods of a class
| pdj disassemble to json
| pdr recursive disassemble across the function graph
| pdf disassemble function
| pdi like 'pi', with offset and bytes
| pdl show instruction sizes
| pds[?] disassemble summary (strings, calls, jumps, refs) (see pdsf and pdfs)
| pdt disassemble the debugger traces (see atd)
As you can see, pdf stands for 'disassemble function'.
But, if you want a raw disassembly of a memory area, then pd is probably what you need. It disassembly blindly from the current address up to a certain windows of memory. If you want to disassemble at a precise address, then use pd @0xdeadbeef.
pdcommand by typingpd nb_instr @addr. For example:pd 1000 @deadbeef. – perror Apr 28 '17 at 09:04