def __init__(self): super(VMTranslator, self).__init__(Hack()) self.line_breaks = True self.branch_id = 0 self.return_id = 0 self.current_file = '' self.output = []
@window.event def on_close(): cpu_worker.terminate() from_cpu.close() to_cpu.close() if __name__ == '__main__': args = sys.argv[1:] if not args: print('Error: Rom file required') sys.exit(1) global cpu_worker, from_cpu, to_cpu, ram_list ram_list = [0] * 8192 rom_file = args[0] with open(rom_file, 'r+') as rm: data = rm.read() data = data.split('\n') if '' in data: data = [] from_cpu = multiprocessing.Queue() to_cpu = multiprocessing.Queue() cpu = Hack(data, fromq=to_cpu, toq=from_cpu) cpu_worker = multiprocessing.Process( target=worker, args=(cpu,) ) cpu_worker.start() pyglet.clock.schedule_interval(update, 0.01) pyglet.app.run()
# -*- coding: utf-8 -*- import os, sys, time from hack import Hack, print_thread import winapputil from winappdbg import Thread, HexDump, CrashDump, System, Process """ Hack.change_window_title("c:\windows\system32\cmd.exe", "Changed Notepad.exe") time.sleep(1) Hack.change_window_title("Changed Notepad.exe", "c:\windows\system32\cmd.exe") # Winsock sockaddr structure. class sockaddr(ctypes.Structure): _fields_ = [ ("sa_family", ctypes.c_ushort), ("sa_data", ctypes.c_char * 14), ] def sendto(event, ra, s, buf, length, flags, to, tolength): p = event.get_process() data = p.peek(buf, length) to_struct = p.read_structure(to, sockaddr) print "BUFFER DATA: " + repr(data) + "\n" print "ACCESSING SPECIFIC STRUCTURE sa_data field:", repr(to_struct.sa_data) print "PEEKING WHOLE STRUCTURE DATA:", repr(p.peek(to, tolength)) def sendto(event, ra, s, buf, length, flags, to, tolength): p = event.get_process() data = p.peek(buf, length) to_struct = p.read_structure(to, sockaddr) print "BUFFER DATA: " + repr(data) + "\n"
import router from utils import Utils from hack import Hack utils = Utils() a = router.Router(256, utils.keygenFromWord("Blank")) print(a.encrypt("Plaintext")) print(a.decrypt(a.encrypt("Plaintext"))) with open("beemovie.txt") as f: content = f.readlines() content = [x.strip() for x in content] while "" in content: content.remove("") hackIt = Hack(3, 5, 256, "s") for i in range(300): print("iter ", i) for c in content: hackIt.getPacket(a.encrypt(c)) print(hackIt.solveWEP())
from hack import Hack from time import sleep from pynput.mouse import Controller from threading import Thread import sys from pynput import keyboard file = r"C:\Users\Xin\PycharmProjects\osuaim\venv\hitobjects" mouse = Controller() hack = Hack(file) task = Thread(target=hack.start) started = False def on_press(key): global started try: if str(key.char) == 'q': task.start() except: pass listener = keyboard.Listener( on_press=on_press) listener.start()
import sys, time from hack import Hack, print_thread import winapputil from winappdbg import Thread, HexDump, CrashDump, System, Process def pre_suspend(event): process = event.get_process() print "pre_suspend" process.suspend() def pre_resume(event): process = event.get_process() print "pre_resume" process.resume() h = Hack(pid=sys.argv[1]) h.wait(int(sys.argv[2])) #h.add_hook('kernel32', "CreateFileW", func) #h.add_hook('kernel32', 'WriteProcessMemory', func) #h.add_hook('kernel32', 'CreateRemoteThread', pre_CreateRemoteThread) #h.add_hook('kernel32', 'CreateProcessInternalW', pre_createprocess); #h.add_hook('kernel32', 'Sleep', pre_Sleep); #h.add_hook('wininet', 'InternetConnectW', pre_InternetConnectW); #h.add_hook("wininet", "HttpOpenRequest", pre_HttpOpenRequest) h.safe_exit()
else: return str.split("!", seq) #h = Hack(processName="iexplore.exe") #h = Hack(processName="sleep.exe") pid = sys.argv[1] if len(sys.argv) > 1 else None act = sys.argv[2] if len(sys.argv) > 2 else None print "act:", act if pid is None: print print "usage : %s pid [act]" % sys.argv[0] sys.exit(-1) h = Hack(pid=pid) if not act is None and os.path.exists(act): fp = open(act, "r") hook_list = [] for line in fp.readlines(): print line dll, func, callback = _split_dll_func(line, 2) if not dll is None or not func is None or not callback is None: print "1" h.add_hook(dll, func, callback) else: print "2" hook_list = [o for o in getmembers(dll) if isfunction(o[1])]