-
Notifications
You must be signed in to change notification settings - Fork 472
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into native-arb-cf-redirect-detector
* master: Improve performance of bulk read/writes to memory (#1509) Fixes ConstraintSet.new_bitvec size check (#1511) Fix operators.ORD for BitVecs of size > 8 (#1512) Removed redeclared smtlibv2 tests (#1513) Update manticore.py (#1508) Improve smemory tests (#1506) Manticore 0.3.1 (#1503) Optimize repeated division in CMPXCHG8B (#1501) Detecting the use of BALANCE in a strict comparison (#1481) Initial master merge into experimental state merging for native (#1482) Update crackme example to match the description (#1502) Add SHL/SHR/SAR (#1498) Add deprecation warnings for outdated API members (#1500) Patching STAICCALL (#1494) WIP: Support lsr.w on ARMv7 THUMB (#1363) Update evm examples (#1486) Logic Bomb Bugfixes (#1485) Add error for unsupported solc versions (#1488) Fix documentation typo in ManticoreBase (#1492) Add crytic-compile support (#1406)
- Loading branch information
Showing
46 changed files
with
2,108 additions
and
413 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
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,63 @@ | ||
/** | ||
* Symbolic values are read from stdin using standard libc calls. | ||
* Program compares if two binary packed integers at the input with 0x41. | ||
* | ||
* Compile with : | ||
* $ gcc -static -Os basic_statemerging.c -o basic_statemerging | ||
* | ||
* Analyze it with: | ||
* $ python examples/script/basic_statemerging.py examples/linux/basic_statemerging | ||
* | ||
* The Merger plugin used in basic_statemerging.py will find two states with state IDs 2, 4 to be at the same program | ||
* location (0x40060d) and merge their CPU states which should only require the value for RDI to be merged. | ||
* | ||
* Expected output: | ||
* $ python /Users/vaibhav/git_repos/manticore/examples/script/basic_statemerging.py examples/linux/basic_statemerging-Os | ||
about to load state_id = 0 | ||
loaded state_id = 0 at cpu = 0x4008e0 | ||
about to load state_id = 1 | ||
loaded state_id = 1 at cpu = 0x400604 | ||
about to load state_id = 2 | ||
Merged registers: | ||
RDI | ||
at PC = 0x40060d, merge succeeded for state id = 2 and 4 | ||
loaded state_id = 2 at cpu = 0x40060d | ||
about to load state_id = 3 | ||
loaded state_id = 3 at cpu = 0x400612 | ||
* | ||
*/ | ||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
#include <unistd.h> | ||
#include <stdbool.h> | ||
|
||
int main(int argc, char* argv[], char* envp[]){ | ||
unsigned int cmd1, cmd2; | ||
unsigned int cmdChanged = 0; | ||
|
||
if (read(0, &cmd1, sizeof(cmd1)) != sizeof(cmd1)) | ||
{ | ||
printf("Error reading stdin!"); | ||
exit(-1); | ||
} | ||
if (read(0, &cmd2, sizeof(cmd2)) != sizeof(cmd2)) | ||
{ | ||
printf("Error reading stdin!"); | ||
exit(-1); | ||
} | ||
|
||
if (cmd1 > 0x41) | ||
{ | ||
cmdChanged = cmd1 - 0x42; | ||
} | ||
if (cmd2 < 0x41) | ||
{ | ||
cmdChanged = cmd2 + 0x42; | ||
} | ||
|
||
if (cmdChanged == 0) printf("equal\n"); | ||
else printf("not equal\n"); | ||
|
||
return 0; | ||
} |
Oops, something went wrong.