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
1f3eba66
Commit
1f3eba66
authored
Sep 24, 2021
by
George Hotz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
go is using openat
parent
6e902641
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
main.go
minigeth/main.go
+2
-0
run.py
risc/run.py
+11
-4
No files found.
minigeth/main.go
View file @
1f3eba66
...
...
@@ -24,6 +24,7 @@ func main() {
defer
f
.
Close
()
rlpheader
:=
rlp
.
NewStream
(
f
,
0
)
rlpheader
.
Decode
(
&
header
)
fmt
.
Println
(
"read old block"
)
}
// read header
...
...
@@ -33,6 +34,7 @@ func main() {
defer
f
.
Close
()
rlpheader
:=
rlp
.
NewStream
(
f
,
0
)
rlpheader
.
Decode
(
&
newheader
)
fmt
.
Println
(
"read new block"
)
}
bc
:=
core
.
NewBlockChain
()
...
...
risc/run.py
View file @
1f3eba66
...
...
@@ -44,6 +44,10 @@ def hook_interrupt(uc, intno, user_data):
print
(
'open("
%
s")'
%
uc
.
mem_read
(
filename
,
0x100
)
.
split
(
b
"
\x00
"
)[
0
]
.
decode
(
'utf-8'
))
# open fd=4
uc
.
reg_write
(
UC_MIPS_REG_V0
,
4
)
elif
syscall_no
==
4288
:
dfd
=
uc
.
reg_read
(
UC_MIPS_REG_A0
)
filename
=
uc
.
reg_read
(
UC_MIPS_REG_A1
)
print
(
'openat(
%
d, "
%
s")'
%
(
dfd
,
uc
.
mem_read
(
filename
,
0x100
)
.
split
(
b
"
\x00
"
)[
0
]
.
decode
(
'utf-8'
)))
elif
syscall_no
==
4238
:
addr
=
uc
.
reg_read
(
UC_MIPS_REG_A0
)
print
(
"futex"
,
hex
(
addr
))
...
...
@@ -134,8 +138,8 @@ def hook_code(uc, address, size, user_data):
except
:
raise
Exception
(
"ctrl-c"
)
elf
=
open
(
"test"
,
"rb"
)
#
elf = open("go-ethereum", "rb")
#
elf = open("test", "rb")
elf
=
open
(
"go-ethereum"
,
"rb"
)
data
=
elf
.
read
()
elf
.
seek
(
0
)
...
...
@@ -160,9 +164,12 @@ mu.reg_write(UC_MIPS_REG_SP, SIZE-0x2000)
# http://articles.manugarg.com/aboutelfauxiliaryvectors.html
_AT_PAGESZ
=
6
mu
.
mem_write
(
SIZE
-
0x2000
,
struct
.
pack
(
">IIIIIIII
"
,
1
,
SIZE
-
0x10
00
,
0
,
SIZE
-
0x1000
,
0
,
mu
.
mem_write
(
SIZE
-
0x2000
,
struct
.
pack
(
">IIIIIIII
I"
,
2
,
SIZE
-
0x1000
,
SIZE
-
0x8
00
,
0
,
SIZE
-
0x1000
,
0
,
_AT_PAGESZ
,
0x1000
,
0
))
#mu.mem_write(SIZE-0x1000, b"GOMAXPROCS=1\x00")
# block
mu
.
mem_write
(
SIZE
-
0x800
,
b
"13284469
\x00
"
)
#hexdump(mu.mem_read(SIZE-0x2000, 0x100))
# nop osinit
...
...
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