-
Notifications
You must be signed in to change notification settings - Fork 539
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
RISCV basic support #1318
Merged
Merged
RISCV basic support #1318
Changes from 11 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
46eb0f8
RISCV basic support
Antwy b96f2d4
Fix riscv semantics
Antwy ba2aa12
Add python bindings & binary emulation test for riscv 64/32
Antwy 239c5c6
Fix RV64 bitsize of reg-reg shift semantics (sll/sra/srl)
Antwy f096f25
Fix division operations corner cases semantics
Antwy 181408e
Fix vcpkg CI
Antwy 409a094
Fix word extracting shifts
Antwy df5eca9
Fix immutable register assignments
Antwy aa726cb
Fix compressed shift immediate bits
Antwy 3da06a7
Revert AppVeyor to Capstone 4.0.2
Antwy b727410
Use riscv only with Capstone version 5+
Antwy 43d8399
Fix issues
Antwy ea3cb55
Fix more issues on riscv
Antwy 7d19b69
Fix cmake
Antwy ea19db3
Uncomment mrs/msr aarch64 capstone version depending test
Antwy File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Binary file added
BIN
+9.19 KB
src/examples/python/ctf-writeups/custom-crackmes/riscv32-hash/crackme_hash
Binary file not shown.
33 changes: 33 additions & 0 deletions
33
src/examples/python/ctf-writeups/custom-crackmes/riscv32-hash/crackme_hash.c
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,33 @@ | ||
|
||
#include <stdio.h> | ||
#include <stdlib.h> | ||
|
||
char *serial = "\x31\x3e\x3d\x26\x31"; | ||
|
||
int check(char *ptr) | ||
{ | ||
int i; | ||
int hash = 0xABCD; | ||
|
||
for (i = 0; ptr[i]; i++) | ||
hash += ptr[i] ^ serial[i % 5]; | ||
|
||
return hash; | ||
} | ||
|
||
int main(int ac, char **av) | ||
{ | ||
int ret; | ||
|
||
if (ac != 2) | ||
return -1; | ||
|
||
ret = check(av[1]); | ||
if (ret == 0xad6d) | ||
printf("Win\n"); | ||
else | ||
printf("fail\n"); | ||
|
||
return 0; | ||
} | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What if it's capstone 3? Maybe we should use
GREATER_EQUAL
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Triton's dependency list says that libcapstone >= 4.0.x is required.
Actually it was once GREATER_EQUAL, but vcpkg builder doesn't like it because CS_VERSION_MAJOR is treated as an empty variable
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. Well, ok to lets keep
if(NOT ${CS_VERSION_MAJOR} MATCHES 4)
if it's better for CIs.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other solutions:
GREATER_EQUAL
is used from cmake 3.7.2.GREATER
variable.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like cmake 3.30 is used by vcpkg. So, using
GREATER
should be okThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GREATER_EQUAL is ok too with manually specified first argument