-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
56 lines (37 loc) · 1.16 KB
/
Copy pathmain.py
File metadata and controls
56 lines (37 loc) · 1.16 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import pygame
from ip_scanner import IPscanner
from monitor import IPscannerMonitor
# 파이게임 설정
pygame.init()
screen = pygame.display.set_mode((500, 500), pygame.RESIZABLE)
clk = pygame.Clock()
fps = 60
dt = 10
on = True
# 기본 설정
threadCount = 24
ipPerThread = 64
divisionUnit = 256^3 # 파일 하나당 주소 몇게 저장할지를 설정
resultPath = 'result'
saveWhether = True
# 헥톡ㅌ탄 설정
ipScanner = IPscanner(0, 0x1_00_00_00_00, threadCount, ipPerThread)
ipScannerMonitor = IPscannerMonitor(screen, ipScanner)
ipScanner.loadResult(resultPath)
while on:
dt = clk.tick(fps)
ipScanner.update()
for event in pygame.event.get():
if event.type == pygame.QUIT:
on = False
ipScanner.stopAllThread()
isExit = input("결과를 저장하시겠습니까? (Y y / N n) :")
if isExit == 'N' or isExit == 'n':
saveWhether = False
ipScannerMonitor.event(event)
ipScannerMonitor.update(dt)
if ipScanner.isDone: on = False
ipScannerMonitor.draw()
pygame.display.flip()
pygame.quit()
if saveWhether: ipScanner.saveResult('result', 256**3)