-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from SoftSec-KAIST/dev
Update Eclipser to v2.0
- Loading branch information
Showing
149 changed files
with
3,831 additions
and
7,887 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
VERSION="2.10.0" | ||
|
||
cp -r qemu-${VERSION}-bbcount-x64 qemu-${VERSION}-bbcount | ||
|
||
cp qemu-${VERSION}-bbcount/eclipser.cc ./patches-bbcount/ | ||
|
||
cp qemu-${VERSION}/accel/tcg/cpu-exec.c \ | ||
qemu-${VERSION}-bbcount/accel/tcg/cpu-exec.c.orig | ||
diff -Naur qemu-${VERSION}-bbcount/accel/tcg/cpu-exec.c.orig \ | ||
qemu-${VERSION}-bbcount/accel/tcg/cpu-exec.c \ | ||
> patches-bbcount/cpu-exec.diff | ||
|
||
cp qemu-${VERSION}/Makefile.target \ | ||
qemu-${VERSION}-bbcount/Makefile.target.orig | ||
diff -Naur qemu-${VERSION}-bbcount/Makefile.target.orig \ | ||
qemu-${VERSION}-bbcount/Makefile.target \ | ||
> patches-bbcount/makefile-target.diff | ||
|
||
cp qemu-${VERSION}/linux-user/syscall.c \ | ||
qemu-${VERSION}-bbcount/linux-user/syscall.c.orig | ||
diff -Naur qemu-${VERSION}-bbcount/linux-user/syscall.c.orig \ | ||
qemu-${VERSION}-bbcount/linux-user/syscall.c \ | ||
> patches-bbcount/syscall.diff | ||
|
||
rm -rf qemu-${VERSION}-bbcount |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
#!/bin/bash | ||
|
||
VERSION="2.10.0" | ||
|
||
cp -r qemu-${VERSION}-branch-x64 qemu-${VERSION}-branch | ||
|
||
cp qemu-${VERSION}-branch/afl-qemu-cpu-inl.h ./patches-branch/afl-qemu-cpu-inl.h | ||
|
||
cp qemu-${VERSION}-branch/tcg/eclipser.c ./patches-branch/eclipser.c | ||
|
||
cp qemu-${VERSION}/accel/tcg/cpu-exec.c \ | ||
qemu-${VERSION}-branch/accel/tcg/cpu-exec.c.orig | ||
diff -Naur qemu-${VERSION}-branch/accel/tcg/cpu-exec.c.orig \ | ||
qemu-${VERSION}-branch/accel/tcg/cpu-exec.c \ | ||
> patches-branch/cpu-exec.diff | ||
|
||
cp qemu-${VERSION}/Makefile.target \ | ||
qemu-${VERSION}-branch/Makefile.target.orig | ||
diff -Naur qemu-${VERSION}-branch/Makefile.target.orig \ | ||
qemu-${VERSION}-branch/Makefile.target \ | ||
> patches-branch/makefile-target.diff | ||
|
||
cp qemu-${VERSION}/linux-user/syscall.c \ | ||
qemu-${VERSION}-branch/linux-user/syscall.c.orig | ||
diff -Naur qemu-${VERSION}-branch/linux-user/syscall.c.orig \ | ||
qemu-${VERSION}-branch/linux-user/syscall.c \ | ||
> patches-branch/syscall.diff | ||
|
||
cp qemu-${VERSION}/tcg/optimize.c \ | ||
qemu-${VERSION}-branch/tcg/optimize.c.orig | ||
diff -Naur qemu-${VERSION}-branch/tcg/optimize.c.orig \ | ||
qemu-${VERSION}-branch/tcg/optimize.c \ | ||
> patches-branch/optimize.diff | ||
|
||
cp qemu-${VERSION}/tcg/tcg-op.h \ | ||
qemu-${VERSION}-branch/tcg/tcg-op.h.orig | ||
diff -Naur qemu-${VERSION}-branch/tcg/tcg-op.h.orig \ | ||
qemu-${VERSION}-branch/tcg/tcg-op.h \ | ||
> patches-branch/tcg-op.diff | ||
|
||
cp qemu-${VERSION}/tcg/tcg-opc.h \ | ||
qemu-${VERSION}-branch/tcg/tcg-opc.h.orig | ||
diff -Naur qemu-${VERSION}-branch/tcg/tcg-opc.h.orig \ | ||
qemu-${VERSION}-branch/tcg/tcg-opc.h \ | ||
> patches-branch/tcg-opc.diff | ||
|
||
cp qemu-${VERSION}/tcg/i386/tcg-target.inc.c \ | ||
qemu-${VERSION}-branch/tcg/i386/tcg-target.inc.c.orig | ||
diff -Naur qemu-${VERSION}-branch/tcg/i386/tcg-target.inc.c.orig \ | ||
qemu-${VERSION}-branch/tcg/i386/tcg-target.inc.c \ | ||
> patches-branch/tcg-target.diff | ||
|
||
cp qemu-${VERSION}/target/i386/helper.h \ | ||
qemu-${VERSION}-branch/target/i386/helper.h.orig | ||
diff -Naur qemu-${VERSION}-branch/target/i386/helper.h.orig \ | ||
qemu-${VERSION}-branch/target/i386/helper.h \ | ||
> patches-branch/target-helper.diff | ||
|
||
cp qemu-${VERSION}/target/i386/translate.c \ | ||
qemu-${VERSION}-branch/target/i386/translate.c.orig | ||
diff -Naur qemu-${VERSION}-branch/target/i386/translate.c.orig \ | ||
qemu-${VERSION}-branch/target/i386/translate.c \ | ||
> patches-branch/target-translate.diff | ||
|
||
rm -rf qemu-${VERSION}-branch |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
|
||
VERSION="2.10.0" | ||
|
||
diff -Naur qemu-${VERSION}/configure.orig \ | ||
qemu-${VERSION}/configure \ | ||
> patches-common/configure.diff | ||
|
||
diff -Naur qemu-${VERSION}/linux-user/elfload.c.orig \ | ||
qemu-${VERSION}/linux-user/elfload.c \ | ||
> patches-common/elfload.diff | ||
|
||
diff -Naur qemu-${VERSION}/util/memfd.c.orig \ | ||
qemu-${VERSION}/util/memfd.c \ | ||
> patches-common/memfd.diff | ||
|
||
diff -Naur qemu-${VERSION}/linux-user/signal.c.orig \ | ||
qemu-${VERSION}/linux-user/signal.c \ | ||
> patches-common/signal.diff |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/bin/bash | ||
|
||
VERSION="2.10.0" | ||
|
||
cp -r qemu-${VERSION}-coverage-x64 qemu-${VERSION}-coverage | ||
|
||
cp qemu-${VERSION}-coverage/accel/tcg/afl-qemu-cpu-inl.h ./patches-coverage/ | ||
|
||
cp qemu-${VERSION}-coverage/accel/tcg/eclipser.c ./patches-coverage/ | ||
|
||
cp qemu-${VERSION}/accel/tcg/cpu-exec.c \ | ||
qemu-${VERSION}-coverage/accel/tcg/cpu-exec.c.orig | ||
diff -Naur qemu-${VERSION}-coverage/accel/tcg/cpu-exec.c.orig \ | ||
qemu-${VERSION}-coverage/accel/tcg/cpu-exec.c \ | ||
> patches-coverage/cpu-exec.diff | ||
|
||
cp qemu-${VERSION}/accel/tcg/Makefile.objs \ | ||
qemu-${VERSION}-coverage/accel/tcg/Makefile.objs.orig | ||
diff -Naur qemu-${VERSION}-coverage/accel/tcg/Makefile.objs.orig \ | ||
qemu-${VERSION}-coverage/accel/tcg/Makefile.objs \ | ||
> patches-coverage/makefile-objs.diff | ||
|
||
cp qemu-${VERSION}/linux-user/syscall.c \ | ||
qemu-${VERSION}-coverage/linux-user/syscall.c.orig | ||
diff -Naur qemu-${VERSION}-coverage/linux-user/syscall.c.orig \ | ||
qemu-${VERSION}-coverage/linux-user/syscall.c \ | ||
> patches-coverage/syscall.diff | ||
|
||
cp qemu-${VERSION}/target/i386/helper.h \ | ||
qemu-${VERSION}-coverage/target/i386/helper.h.orig | ||
diff -Naur qemu-${VERSION}-coverage/target/i386/helper.h.orig \ | ||
qemu-${VERSION}-coverage/target/i386/helper.h \ | ||
> patches-coverage/target-helper.diff | ||
|
||
cp qemu-${VERSION}/target/i386/translate.c \ | ||
qemu-${VERSION}-coverage/target/i386/translate.c.orig | ||
diff -Naur qemu-${VERSION}-coverage/target/i386/translate.c.orig \ | ||
qemu-${VERSION}-coverage/target/i386/translate.c \ | ||
> patches-coverage/target-translate.diff | ||
|
||
rm -rf qemu-${VERSION}-coverage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
--- qemu-2.10.0-bbcount/accel/tcg/cpu-exec.c.orig 2020-09-29 08:25:21.151543920 -0700 | ||
+++ qemu-2.10.0-bbcount/accel/tcg/cpu-exec.c 2020-09-29 08:23:51.822938454 -0700 | ||
@@ -36,6 +36,10 @@ | ||
#include "sysemu/cpus.h" | ||
#include "sysemu/replay.h" | ||
|
||
+extern abi_ulong eclipser_entry_point; | ||
+extern void eclipser_setup(void); | ||
+extern void eclipser_log_bb(abi_ulong addr); | ||
+ | ||
/* -icount align implementation. */ | ||
|
||
typedef struct SyncClocks { | ||
@@ -144,6 +148,11 @@ | ||
int tb_exit; | ||
uint8_t *tb_ptr = itb->tc_ptr; | ||
|
||
+ if(itb->pc == eclipser_entry_point) { | ||
+ eclipser_setup(); | ||
+ } | ||
+ eclipser_log_bb(itb->pc); | ||
+ | ||
qemu_log_mask_and_addr(CPU_LOG_EXEC, itb->pc, | ||
"Trace %p [%d: " TARGET_FMT_lx "] %s\n", | ||
itb->tc_ptr, cpu->cpu_index, itb->pc, |
Oops, something went wrong.