rdis - docs

For responsive rdis help, drop by irc.freenode.net#haxathon


Building Rdis
Rdis is developed in Arch Linux, but should build for any platform that supports GTK-3. Rdis requires the following libraries:
  • gtk-3
  • luajit
  • jansson
  • udis86
Once you have the dependencies, grab a copy of rdis from:
github.com/endeav0r/rdis.

I haven't put anything together for rdis using autotools, so you may need to hand-patch some #include paths. Makefiles are included, and rdis builds to src/rdis.

git clone git://github.com/endeav0r/rdis.git
cd rdis
make -j
make install

Rdis Internals
The internal state of rdis is included in a struct named
_rdis. _rdis includes four important data structures.
  • Loader Graph - A directional graph where each node (vertex) is a list of instructions.
  • Function Map - A mapping of 64-bit addresses to information about the function found at that address
  • Labels Map - A mapping of 64-bit addresses to textual labels which describe that address
  • Memory Map - A mapping of 64-bit addresses to buffers which comprise the program's virtual address space in its current state.
Rdis uses loaders to fill these data structures with information, and then allows the user to interact with these data structures through a simple GUI. A better understanding of what a loader is responsible for can be gained by looking at loader.h.

Loading a binary in rdis takes part in four steps, one for each data structure:
  1. Request a memory map from the loader
  2. Feed the memory map back to the loader and request a function map
  3. Feed the memory map and function map back to the loader and request a loader graph
  4. Feed the memory map and function map back to the loader and request a label map
When rdis displays information such as data references and call graphs to the user, it extracts this information on-the-fly from its internal representation of the program.

Miscellaneous Internal Details
  • Comments are stored with instructions, not in the label map.
  • Rdis does not use a 3rd party graph layout library.
  • Rdis loaders use a memory map for tasks such as graphing functions as this allows an external process (IE: debugger/lua script) to update the rdis state.
  • Updating a region of memory in the memory map causes different actions to fire, most importantly regraphing of select functions.
  • Many rdis loader functions should be pure, allowing them to be used with rdis' internal threaded work queue.
  • If you are considering hacking rdis, you should first familiarize yourself with rdis' internal object/container model.





© rainbowsandpwnies 2012