-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Witness extraction and validation (#71)
* feat(witness extraction): merge witness extraction into main * feat(witness extraction): add example files for bachelor thesis witness extraction * chore: Add bachelor_thesis_haslauer.pdf and thesis abstract to README.md --------- Co-authored-by: haslauerbe <[email protected]>
- Loading branch information
1 parent
5f498a1
commit 3a9ffcd
Showing
14 changed files
with
367 additions
and
38 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
Example in Bernhard Haslauer's Bachelor Thesis. | ||
Input == #b00110000 (== 48 == '0') or | ||
Input == #b00110010 (== 50 == '2') | ||
*/ | ||
|
||
uint64_t main() { | ||
uint64_t a; | ||
uint64_t* x; | ||
|
||
x = malloc(8); | ||
*x = 0; | ||
|
||
read(0, x, 1); | ||
|
||
*x = *x - 48; | ||
|
||
// division by zero if the input was '0' (== 48) | ||
a = 41 + (1 / *x); | ||
|
||
// division by zero if the input was '2' (== 50) | ||
if (*x == 2) | ||
a = 41 + (1 / 0); | ||
|
||
if (a == 42) | ||
return 1; | ||
else | ||
return 0; | ||
} |
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 @@ | ||
// Example in Bernhard Haslauer's Bachelor Thesis. | ||
// input "11111111" (8 '1's) lead to division by zero | ||
uint64_t main() { | ||
uint64_t a; | ||
uint64_t* x; | ||
|
||
x = malloc(8); | ||
*x = 0; | ||
|
||
read(0, x, 8); | ||
|
||
a = 3544668469065756977; | ||
// input == "11111111" == 3544668469065756977 | ||
if (*x == a) | ||
*x = 42 / 0; | ||
|
||
return 0; | ||
} | ||
|
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,22 @@ | ||
// Example in Bernhard Haslauer's Bachelor Thesis. | ||
// invalid memory access if the input was '1' (== 49) or '2' (==50) | ||
uint64_t main() { | ||
uint64_t a; | ||
uint64_t* x; | ||
|
||
x = malloc(8); | ||
|
||
*x = 0; | ||
|
||
read(0, x, 1); | ||
|
||
if (*x == 49) | ||
// address outside virtual address space -> invalid memory access | ||
*(x + (4 * 1024 * 1024 * 1024)) = 0; | ||
if (*x == 50) | ||
// address between data and heap -> invalid memory access | ||
*(x + -2) = 0; | ||
|
||
return 0; | ||
} | ||
|
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
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
Oops, something went wrong.