-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAttack2.r2py
More file actions
37 lines (31 loc) · 803 Bytes
/
Attack2.r2py
File metadata and controls
37 lines (31 loc) · 803 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
if "testfile.txt.a" in listfiles():
removefile("testfile.txt.a")
if "testfile.txt.b" in listfiles():
removefile("testfile.txt.b")
try:
myfile = ABopenfile("testfile.txt",True)
myfile.writeat("SwrjajE",0)
myfile.close()
myfile = ABopenfile("testfile.txt",False)
myfile.writeat("1234aE",6)
myfile.close()
myfile = ABopenfile("testfile.txt",False)
myfile.writeat("s1234ae",0)
myfile.close()
myfile = ABopenfile("testfile.txt",False)
s=[]
content = myfile.readat(None,0)
s = list(content)
except:
log("Valid operation cause error\n")
try:
assert(s[0] == 'S')
assert(s[-1] == 'E')
assert(s == list("Swrjaj1234aE"))
myfile.close()
except:
try:
myfile.close()
except:
pass
log("Attack successful\n")