"""
Author: <nmweizi@gmail.com>, 2007.1.6
crack xxxxx 11.0.2
xxxxx must install at C:\\Program Files\\SlickEdit\win\\vs.exe
(bp_address,mem_address,s_value,d_value,times,delay,begintime)
Usage:
python loader.py
"""
import pydbg, time
import os,sys
def busca_pid(dbg, nombre):
for pid,proc in dbg.enumerate_processes():
if proc.lower() == nombre.lower(): return pid
return -1
def modificaDados(dbg):
global bp_address,mem_address,s_value,d_value,times,delay,begintime
if dbg.read_process_memory(mem_address,length=1) == s_value and \
(time.clock()-begintime) >= delay:
times = times -1
if times == 0:
dbg.write_process_memory(mem_address,d_value,length=1)
print 'Patched!'
#TODO if use bp_set(bp_address) int 3 then del # at this line
#dbg.bp_del(bp_address)
dbg.bp_del_hw(bp_address)
print "Remove breakpoint %s ok!" % hex(bp_address).upper()
return pydbg.DBG_CONTINUE
def handler_breakpoint (dbg):
if dbg.first_breakpoint:
dbg.hide_debugger()
#print "first_breakpoint"
if dbg.exception_handler_single_step:
modificaDados(dbg)
return pydbg.DBG_CONTINUE