Skip to content

Commit 91e9e89

Browse files
committed
Oh so shiny
1 parent f52d74a commit 91e9e89

File tree

1 file changed

+50
-16
lines changed

1 file changed

+50
-16
lines changed

start.py

Lines changed: 50 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -195,39 +195,39 @@ def check_update_pups():
195195
try:
196196
with open(os.path.join(CWD, 'updates',
197197
'PS4UPDATE_SYSTEM.PUP'), 'rb') as buf:
198-
print('>> Checking PS4UPDATE_SYSTEM.PUP\'s checksum')
198+
print('>> Checking PS4UPDATE_SYSTEM.PUP\'s checksum', end='\r')
199199
hasher = hashlib.md5()
200200
data = buf.read()
201201
hasher.update(data)
202202
system_hash = hasher.hexdigest().upper()
203203
if system_hash != '203C76C97F7BE5B881DD0C77C8EDF385':
204204
closer('ERROR: PS4UPDATE_SYSTEM.PUP is not version 4.05')
205-
print('>> PS4UPDATE_SYSTEM.PUP checksum matches')
205+
print('>> PS4UPDATE_SYSTEM.PUP checksum matches ')
206206
except IOError:
207207
pass
208208

209209
try:
210210
with open(os.path.join(CWD, 'updates',
211211
'PS4UPDATE_RECOVERY.PUP'), 'rb') as buf:
212-
print('>> Checking PS4UPDATE_RECOVERY.PUP\'s checksum')
212+
print('>> Checking PS4UPDATE_RECOVERY.PUP\'s checksum', end='\r')
213213
hasher = hashlib.md5()
214214
data = buf.read()
215215
hasher.update(data)
216216
recovery_hash = hasher.hexdigest().upper()
217217
if recovery_hash != '741CFE2F0DEC1BB4663571DE78AE31CF':
218218
closer('ERROR: PS4UPDATE_RECOVERY.PUP is not version 4.05')
219-
print('>> PS4UPDATE_RECOVERY.PUP checksum matches')
219+
print('>> PS4UPDATE_RECOVERY.PUP checksum matches ')
220220
except IOError:
221221
pass
222222

223223

224224
def start_servers():
225225
"""Start DNS and HTTP servers on seperate threads"""
226-
print('>> Starting DNS server thread...')
226+
print('>> Starting DNS server thread...', end='\r')
227227
fakedns.main(DNS_LOC, DEBUG)
228228
print('>> DNS server thread is running...')
229229

230-
print('>> Starting HTTP server thread...')
230+
print('>> Starting HTTP server thread...', end='\r')
231231
server = ThreadedHTTPServer(('', 80), MyHandler)
232232
thread = threading.Thread(name='HTTP_Server',
233233
target=server.serve_forever,
@@ -266,12 +266,20 @@ def payload_menu(payloads):
266266
"""Displays a menu with all available payloads in it"""
267267
i = 1
268268
choice = -1
269-
print('{} Payloads {}'.format('-' * 4, '-' * 46))
270-
print('0. Don\'t send a payload')
269+
print('┌────────────────────────────────────────────────────────┐')
270+
print('│ Payloads │')
271+
print('├────────────────────────────────────────────────────────┤')
272+
print('│ 0. Don\'t send a payload │')
271273
for payload in payloads:
272-
print('{}. {}'.format(i, payload))
274+
payload = '│ {}. {}'.format(i, payload)
275+
while len(payload) < 57:
276+
payload += ' '
277+
payload += '│'
278+
if len(payload) > 58:
279+
payload = payload[:57] + '│'
280+
print(payload)
273281
i += 1
274-
print('-' * 60)
282+
print('└────────────────────────────────────────────────────────┘')
275283
while choice < 0 or choice >= i:
276284
choice = input('Choose a payload to send: ')
277285
try:
@@ -317,11 +325,19 @@ def exploit_menu():
317325
exploits = os.listdir(EXPLOIT_LOC)
318326
if not exploits:
319327
closer('ERROR: No exploits found')
320-
print('{} Exploits {}'.format('-' * 4, '-' * 46))
328+
print('┌────────────────────────────────────────────────────────┐')
329+
print('│ Exploits │')
330+
print('├────────────────────────────────────────────────────────┤')
321331
for exploit in exploits:
322-
print('{}. {}'.format(i, exploit))
332+
exploit = '│ {}. {}'.format(i, exploit)
333+
while len(exploit) < 57:
334+
exploit += ' '
335+
exploit += '│'
336+
if len(exploit) > 58:
337+
exploit = exploit[:57] + '│'
338+
print(exploit)
323339
i += 1
324-
print('-' * 60)
340+
print('└────────────────────────────────────────────────────────┘')
325341
while choice < 1 or choice >= i:
326342
choice = input('Choose an exploit to host: ')
327343
try:
@@ -354,7 +370,7 @@ def getch():
354370
def closer(message):
355371
"""Closing method"""
356372
print(message)
357-
if message != '>> Exiting...':
373+
if message != '\r>> Exiting...':
358374
print('Press any key to exit...', end='')
359375
sys.stdout.flush()
360376
if os.name == 'nt':
@@ -366,12 +382,25 @@ def closer(message):
366382
sys.exit()
367383

368384

385+
def menu_header():
386+
"""Very first thing that prints"""
387+
print('┌────────────────────────────────────────────────────────┐')
388+
print('│ PS4 Exploit Host by Al Azif │')
389+
print('└────────────────────────────────────────────────────────┘')
390+
391+
392+
def menu_padding(item, term_char):
393+
pass
394+
395+
369396
def main():
370397
"""The main logic"""
371398
global DEBUG
372399
global AUTOSEND
373400
global EXPLOIT_LOC
374401

402+
menu_header()
403+
375404
if not check_root():
376405
closer('ERROR: This must be run by root as it requires port 53 & 80')
377406

@@ -408,7 +437,12 @@ def main():
408437
lan = get_lan()
409438

410439
if write_conf(lan):
411-
print('>> Your DNS IP is {}'.format(lan))
440+
while len(lan) < 15:
441+
lan += ' '
442+
print('╔════════════════════════════════════════════════════════╗')
443+
print('║ Your DNS IP is {} ║'.format(lan))
444+
print('╚════════════════════════════════════════════════════════╝')
445+
# print('>> Your DNS IP is {}'.format(lan))
412446
else:
413447
closer('ERROR: Unable to write {}'.format(DNS_LOC))
414448

@@ -417,7 +451,7 @@ def main():
417451
while True:
418452
pass
419453
except KeyboardInterrupt:
420-
closer('>> Exiting...')
454+
closer('\r>> Exiting...')
421455

422456

423457
if __name__ == '__main__':

0 commit comments

Comments
 (0)