dewdrop-0.1: Find gadgets for return-oriented programming on x86




Analyze the ROP gadgets in an ELF binary.

Use this module if you need more control, or integration with a larger program. The module Dewdrop provides a simpler way to put together a standalone gadget finder.


Finding gadgets

newtype Gadget Source

A sequence of instructions, each with metadata.

The Show instance produces assembly code with labeled offsets, so you can print these directly.


Gadget [Metadata] 

gadgets :: Elf -> [Gadget]Source

Find possible gadgets.

You can filter these further using valid or other tests.

valid :: Gadget -> BoolSource

Rejects gadgets which are probably not useful for return-oriented programming. This includes gadgets containing invalid or privileged instructions.

Configuring the gadget finder

data Config Source

Configuration of the gadget finder.




cfgSyntax :: Syntax

Assembly syntax for display

cfgVendor :: Vendor

CPU vendor; affects decoding of a few instructions

cfgMaxSize :: Int

Maximum size of a gadget, in bytes

defaultConfig :: ConfigSource

Default configuration of the gadget finder.

gadgetsWith :: Config -> Elf -> [Gadget]Source

Find possible gadgets, using a custom configuration.