Exemplo n.º 1
0
    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)
Exemplo n.º 2
0
    def sps(clx, args):
        nfu = None
        bit_cmd = 'wx'
        sp = info.reg('esp')
        if proc.is_64():
            bit_cmd = 'gx'
            sp = info.reg('rsp')

        if len(args) >= 2:  # bpc offset len
            nfu = '/' + args[1] + 's'
        else:
            nfu = '/4s'
        offset = info.calc(args[0])
        addr = sp - offset
        exec_cmd.execute_exam(nfu, addr)
Exemplo n.º 3
0
    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)
Exemplo n.º 4
0
    def bpc(clx, args):
        """
            bpc offset len
        """
        nfu = None
        bit_cmd = 'wx'
        bp = info.reg('ebp')
        if proc.is_64():
            bit_cmd = 'gx'
            bp = info.reg('rbp')

        if len(args) >= 2:  # bpc offset len
            nfu = '/' + args[1] + 'c'
        else:
            nfu = '/16c'
        offset = info.calc(args[0])
        addr = bp - offset
        exec_cmd.execute_exam(nfu, addr)
Exemplo n.º 5
0
    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)
Exemplo n.º 6
0
    def sp(clx, args):
        nfu = None
        bit_cmd = 'wx'
        sp = info.reg('esp')
        if proc.is_64():
            bit_cmd = 'gx'
            sp = info.reg('rsp')
        if len(args) >= 2:
            if '/' not in args[0]:  # bp offset len
                nfu = '/' + args[1] + bit_cmd
                offset = info.calc(args[0])

            else:  # bp/nfu offset
                nfu = args[0]
                offset = info.calc(args[1])
        else:
            nfu = '/20' + bit_cmd
            offset = info.calc(args[0])

        addr = hex(sp + offset)
        exec_cmd.execute_exam(nfu, addr)