def nx(clx, args): proc_base = 0 if proc.is_pie(): proc_base = proc.proc_base() nfu = None addr = None bit_cmd = 'wx' if proc.is_64(): bit_cmd = 'gx' if len(args) >= 2: if '/' not in args[0]: # nx offset length nfu = '/' + length + bit_cmd offset = info.calc(args[0]) else: # nx/nfu offset nfu = args[0] offset = info.calc(args[1]) else: # nx offset 20 nfu = '/20' + bit_cmd offset = info.calc(args[0]) addr = hex(proc_base + offset) exec_cmd.execute_exam(nfu, addr)
def nxc(clx, args): """ nxc offset len, len default is 16 """ proc_base = 0 if proc.is_pie(): proc_base = proc.proc_base() nfu = None if len(args) >= 2: nfu = "/" + args[1] + 'c' else: nfu = '/16c' offset = info.calc(args[0]) proc_base = proc.proc_base() addr = hex(proc_base + offset) exec_cmd.execute_exam(nfu, addr)
def poff(clx, args): proc_base = proc.proc_base() if len(args) == 1: addr = int(args[0], 16) if (addr >= proc_base): print(hex(addr - proc_base)) else: print(hex(addr + proc_base)) else: print('need one argument')
def nb(clx, args): proc_base = 0 if proc.is_pie(): proc_base = proc.proc_base() for line in args: try: bp = info.calc(line) + proc_base brk_cmd = 'b *{}'.format(hex(bp)) gdb.execute(brk_cmd) except: print('error when exec nb') pass
def nxs(clx, args): """ nxs offset len, len default is 4 """ proc_base = 0 if proc.is_pie(): proc_base = proc.proc_base() nfu = None if len(args) >= 2: nfu = '/' + args[1] + 's' else: nfu = '/4s' offset = info.calc(args[0]) addr = hex(proc_base + offset) exec_cmd.execute_exam(nfu, addr)