forked from JP-kazne/workspace
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsolver.py
More file actions
37 lines (31 loc) · 884 Bytes
/
Copy pathsolver.py
File metadata and controls
37 lines (31 loc) · 884 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
from pwn import *
def main(uVar2:int):
process(uVar2)
def process(param_1:int):
local_24 = 1
while local_24 <= param_1:
lVar3 = triangle(param_1, local_24)
print(lVar3)
io.sendline(str(lVar3))
local_24 += 1
def triangle(param_1:int, param_2:int):
if param_1 < param_2:
ret = 0
else:
if param_1 == 1 and param_2 == 1:
ret = 1
else:
if param_2 == 1:
ret = triangle(param_1 -1, param_1 -1)
else:
ret2 = triangle(param_1, param_2 -1)
ret1 = triangle(param_1 -1, param_2 -1)
ret = ret1 + ret2
return ret
if __name__ == "__main__":
io = remote('dctf-chall-bell.westeurope.azurecontainer.io','5311')
var = int(io.recvline())
print(var)
main(var)
print(io.recvall())
io.close()