pwnlib.util.getdents
— Linux binary directory listing
- pwnlib.util.getdents.dirents(buf)[source]
unpack_dents(buf) -> list
Extracts data from a buffer emitted by getdents()
- Parameters
buf (str) – Byte array
- Returns
A list of filenames.
Example
>>> data = '5ade6d010100000010002e0000000004010000000200000010002e2e006e3d04092b6d010300000010007461736b00045bde6d010400000010006664003b3504' >>> data = unhex(data) >>> print(dirents(data)) ['.', '..', 'fd', 'task']