Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ROP example to sample binaries #69

Merged
merged 1 commit into from
Sep 23, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions wp/resources/sample_binaries/rop_example/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
BASE=main

PROG1=$(BASE)-original

PROG2=$(BASE)-rop

all: $(PROG1).bpj $(PROG2).bpj

$(PROG1).bpj:
bap --pass=save-project --save-project-filename=$(PROG1).bpj $(PROG1)

$(PROG2).bpj:
bap --pass=save-project --save-project-filename=$(PROG2).bpj $(PROG2)

clean:
rm -f $(PROG1).bpj $(PROG2).bpj
Binary file not shown.
1,256 changes: 1,256 additions & 0 deletions wp/resources/sample_binaries/rop_example/main-original.dmp

Large diffs are not rendered by default.

Binary file added wp/resources/sample_binaries/rop_example/main-rop
Binary file not shown.
1,923 changes: 1,923 additions & 0 deletions wp/resources/sample_binaries/rop_example/main-rop.dmp

Large diffs are not rendered by default.

17 changes: 17 additions & 0 deletions wp/resources/sample_binaries/rop_example/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
int test1(int a, int b)
{
return a + b;
}

int main()
{
int i = 0;
int ret = 0;

for (i=0; i<10; i++)
{
ret += test1(i, i++);
}

return ret;
}
17 changes: 17 additions & 0 deletions wp/resources/sample_binaries/rop_example/run_wp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
set -x

dummy_dir=../dummy

compile () {
make
}

run () {
bap $dummy_dir/hello_world.out --pass=wp \
--wp-compare=true \
--wp-file1=main-original.bpj \
--wp-file2=main-rop.bpj \
--wp-inline=true
}

compile && run