Skip to content

Commit ba0316a

Browse files
authored
Add files via upload
1 parent fa22441 commit ba0316a

File tree

4 files changed

+89
-0
lines changed

4 files changed

+89
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import r2pipe, sys
2+
3+
r2=r2pipe.open("iof.elf")
4+
s=r2.cmd("p8 4 @ "+sys.argv[1])
5+
s=s[6:8]+s[4:6]+s[2:4]+s[0:2]
6+
print s
7+
print r2.cmd("xr 4 @ "+sys.argv[1]+"")
8+
r=open("esp32.rom").readlines()
9+
for l in r:
10+
if s in l:
11+
print l
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
0x4008091c - main
2+
0x400d0dcb - maintask
3+
0x400836ec - vtaskcreate
4+
0x400837c4 - vtaskdelete
5+
0x4010414c - appmain
6+
0x40104100 - http_server
7+
0x40104048 - serve
8+
0x40103fe8 - check_pass
9+
10+
Check functions: [0x4010....]
11+
0x400d0a94 - pass
12+
0x400d0aa0 - MAC bytes
13+
0x400d0a98 - state
14+
state = 0
15+
! 3b40 - s[0]=='G' => state ^= 0x8001
16+
! 3b90 - s[14]-M[0]==9 => state ^= 0x4000
17+
. 3bbc - s[1]==153 => state ^= 0x12
18+
3bdc - state ^= 0x102
19+
3c00 - s[13]^s[1]==4 => state ^= 0x2002
20+
! 3c24 - s[12]=='s' => state ^= 0x1008
21+
. 3c44 - ((s[2]+72) & 0xFF) >>4 & 0xF == 108 => state ^= 0x804
22+
. 3c98 - s[3]&17 - 104 == 0 => state ^= 0x4008
23+
! 3ce0 - s[5]=='o' => state ^= 0x20
24+
!! 3d60 - s[8]-s[11]==10 => state ^= 0x900
25+
3d88 - s[8]&120 == s[8] => state ^= 0x100
26+
3dac - sext(ror(s[13], 4))==20 => state ^= 0x2040
27+
! 3dd8 - sext(ror(s[3], 4))==-11 => state ^= 0x8
28+
3e04 - ((M[4]&16)|32)^s[1]==0 => state ^= 0x2
29+
3e64 - [impossible] => state ^= 0x80
30+
! 3ec0 - s[3]==s[7] => state ^= 0x88
31+
! 3ee0 - s[9]=='t' => state^=0x200
32+
. 3f00 - sum(MAC)^s[10]==84 => state ^= 0x420
33+
! 3f3c - s[2]=='t' => state ^= 0x4
34+
! 3f5c - s[10]==M[2]-1 => state ^= 0x400
35+
! 3f84 - s[6]=='U' => state ^= 0x40
36+
! 3fb4 - s[4]==ror(M[4], 4) => state ^= 0x10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
import r2pipe, sys
2+
3+
r2=r2pipe.open("iof.elf")
4+
fn=[
5+
0x40103b40,
6+
0x40103b90,
7+
0x40103bbc,
8+
0x40103bdc,
9+
0x40103c00,
10+
0x40103c24,
11+
0x40103c44,
12+
0x40103c98,
13+
0x40103ce0,
14+
0x40103d60,
15+
0x40103d88,
16+
0x40103dac,
17+
0x40103dd8,
18+
0x40103e04,
19+
0x40103e64,
20+
0x40103ec0,
21+
0x40103ee0,
22+
0x40103f00,
23+
0x40103f3c,
24+
0x40103f5c,
25+
0x40103f84,
26+
0x40103fb4
27+
]
28+
for f in fn:
29+
print hex(f)
30+
r2.cmd("s "+hex(f))
31+
r2.cmd("af")
32+
r2.cmd("afn f"+hex(f))
33+
j=r2.cmdj("pdfj")["ops"]
34+
for c in j:
35+
op=c["opcode"]
36+
op=op.replace("0x400d0a94", "$pass")
37+
op=op.replace("0x400d0aa0", "$MAC")
38+
op=op.replace("0x400d0a98", "$state")
39+
print " "+op
40+
if "bne" in op:
41+
print "{-}"
42+
print "-----------------"

0 commit comments

Comments
 (0)