Skip to content

Commit

Permalink
Adds taint visualizer which reveals bitmaps of nudge dumps
Browse files Browse the repository at this point in the history
Issue #1
Fixes #3
  • Loading branch information
toshipiazza committed Jan 13, 2018
1 parent f9773c9 commit 6b40f8f
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
2 changes: 1 addition & 1 deletion drtaint_shadow.c
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ shadow_memory_iter_func(umbra_map_t *map, umbra_shadow_memory_info_t *info,
{
if (info->shadow_type == UMBRA_SHADOW_MEMORY_TYPE_NORMAL) {
FILE *fp = (FILE *)user_data;
fprintf(fp, "APP %08x SHADOW %08x:",
fprintf(fp, "APP %08x SHADOW %08x ",
info->app_base,
info->shadow_base);
fwrite(info->shadow_base, 1, info->shadow_size, fp);
Expand Down
28 changes: 28 additions & 0 deletions scripts/vis.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import numpngw
import operator
import sys
import numpy

file = sys.argv[1]

file = open(file).read()
file = file.split("\n")

# make sure it's the right type of file
assert file[0].rstrip() == "TAINT DUMP"
file = file[1:-1]
def parse_line(i):
i = i.rstrip().split(" ")
assert i[0] == "APP" and \
i[2] == "SHADOW"
return int(i[1], 16), i[4]
mappings = map(parse_line, file)

for n,shadow in mappings:
shadow = map(ord, shadow)
shadow = numpy.asarray(shadow,
dtype=numpy.uint8)
shadow.resize(256, 64)

numpngw.write_png("app_{:x}.png".format(n),
shadow, bitdepth=1)

0 comments on commit 6b40f8f

Please sign in to comment.