Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
N
nebula
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
exchain
nebula
Commits
139155c4
Commit
139155c4
authored
Sep 30, 2021
by
George Hotz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
move mips stack
parent
0ceffdbc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
15 deletions
+7
-15
run.py
risc/run.py
+7
-15
No files found.
risc/run.py
View file @
139155c4
...
...
@@ -25,6 +25,7 @@ regs = ["at", "v0", "v1", "a0", "a1", "a2", "a3"]
SIZE
=
16
*
1024
*
1024
heap_start
=
0x20000000
# 0x20000000-0x30000000
# input oracle @ 0x30000000
# output oracle @ 0x30000800
...
...
@@ -32,6 +33,7 @@ heap_start = 0x20000000 # 0x20000000-0x30000000
# preimage oracle (read) @ 0x31000000-0x32000000 (16 MB)
brk_start
=
0x40000000
# 0x40000000-0x80000000
stack_start
=
0x7FFFF000
# hmm, very slow
icount
=
0
...
...
@@ -305,26 +307,16 @@ entry = elffile.header.e_entry
print
(
"entrypoint:
%
x"
%
entry
)
#hexdump(mu.mem_read(entry, 0x10))
mu
.
reg_write
(
UC_MIPS_REG_SP
,
SIZE
-
0x2000
)
mu
.
reg_write
(
UC_MIPS_REG_SP
,
stack_start
-
0x2000
)
# http://articles.manugarg.com/aboutelfauxiliaryvectors.html
_AT_PAGESZ
=
6
mu
.
mem_write
(
SIZE
-
0x2000
,
struct
.
pack
(
">IIIIIIII"
,
mu
.
mem_write
(
stack_start
-
0x2000
,
struct
.
pack
(
">IIIIIIII"
,
1
,
# argc
SIZE
-
0x1000
,
0
,
# argv
SIZE
-
0x400
,
0
,
# envp
stack_start
-
0x1000
,
0
,
# argv
stack_start
-
0x400
,
0
,
# envp
_AT_PAGESZ
,
0x1000
,
0
))
# auxv
# block
#mu.mem_write(SIZE-0x800, b"13284469\x00")
#mu.mem_write(SIZE-0x800, b"13284469\x00")
mu
.
mem_write
(
SIZE
-
0x400
,
b
"GOGC=off
\x00
"
)
#hexdump(mu.mem_read(SIZE-0x2000, 0x100))
# nop osinit
#mu.mem_write(0x44524, b"\x03\xe0\x00\x08\x00\x00\x00\x00")
mu
.
mem_write
(
stack_start
-
0x400
,
b
"GOGC=off
\x00
"
)
r
=
RangeTree
()
for
section
in
elffile
.
iter_sections
():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment