Example #1
0
def getArchModules(default=ARCH_DEFAULT):
    '''
    Retrieve a default array of arch modules ( where index 0 is
    also the "named" or "default" arch module.
    '''
    import envi.archs.h8 as e_h8
    import envi.archs.arm as e_arm
    import envi.archs.i386 as e_i386
    import envi.archs.amd64 as e_amd64
    import envi.archs.thumb16 as e_thumb16
    import envi.archs.msp430 as e_msp430

    archs = [None]

    # These must be in ARCH_FOO order
    archs.append(e_i386.i386Module())
    archs.append(e_amd64.Amd64Module())
    archs.append(e_arm.ArmModule())
    archs.append(e_thumb16.Thumb16Module())
    archs.append(e_thumb16.ThumbModule())
    archs.append(e_msp430.Msp430Module())
    archs.append(e_h8.H8Module())

    # Set the default module ( or None )
    archs[ARCH_DEFAULT] = archs[default >> 16]

    return archs
Example #2
0
    def __init__(self, regarray=None):
        self.archmod = e_msp430.Msp430Module()

        envi.Emulator.__init__(self, self.archmod)
        e_msp430regs.Msp430RegisterContext.__init__(self)

        self._emu_segments = [
            (0, 0xffff),
        ]
        self.addCallingConvention('msp430call', msp430call)
Example #3
0
def getArchModule(name=None):
    """
    return an Envi architecture module instance for the following
    architecture name.

    Current architectures include:

    i386 - Intel i386
    amd64 - The new 64bit AMD spec.
    """
    if name is None:
        name = getCurrentArch()

    # Some builds have x86 (py2.6) and some have other stuff...
    if name in ['i386', 'i486', 'i586', 'i686', 'x86']:
        import envi.archs.i386 as e_i386
        return e_i386.i386Module()

    elif name in ('amd64', 'x86_64'):
        import envi.archs.amd64 as e_amd64
        return e_amd64.Amd64Module()

    elif name in ('arm', 'armv6l', 'armv7l'):
        import envi.archs.arm as e_arm
        return e_arm.ArmModule()

    elif name in ('thumb', 'thumb16', 'thumb2'):
        import envi.archs.thumb16 as e_thumb
        return e_thumb.Thumb16Module()

    elif name in ('msp430', ):
        import envi.archs.msp430 as e_msp430
        return e_msp430.Msp430Module()

    elif name in ('h8', ):
        import envi.archs.h8 as e_h8
        return e_h8.H8Module()

    else:
        raise ArchNotImplemented(name)