Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(16)  |  Call(10)  |  Derive(0)  |  Import(6)
Convert an unsigned integer (a CPU word) to a bytes string.

        def word2bytes(word):
    """
    Convert an unsigned integer (a CPU word) to a bytes string.
    """
    return pack("L", word)
        


src/s/e/segvault-HEAD/fusil/ptrace/ptrace/debugger/process.py   segvault(Download)
from ptrace.tools import dumpRegs
from ptrace.cpu_info import CPU_WORD_SIZE, CPU_64BITS
from ptrace.ctypes_tools import bytes2word, word2bytes, bytes2type, bytes2array
from signal import SIGTRAP, SIGSTOP, SIGKILL
from ptrace.ctypes_tools import formatAddress, formatWordHex
            for offset in xrange(nb_words):
                word = ptrace_peekuser(self.pid, offset*CPU_WORD_SIZE)
                bytes = word2bytes(word)
                words.append(bytes)
            bytes = ''.join(words)
            address -= offset
            word = self.readWord(address)
            bytes = word2bytes(word)
 
            # Read some bytes from the word
            # Read word
            word = self.readWord(address)
            bytes = word2bytes(word)
 
            # Read bytes from the word

src/p/y/python-ptrace-0.7/ptrace/debugger/process.py   python-ptrace(Download)
from ptrace.tools import dumpRegs
from ptrace.cpu_info import CPU_WORD_SIZE
from ptrace.ctypes_tools import bytes2word, word2bytes, bytes2type, bytes2array
from signal import SIGTRAP, SIGSTOP, SIGKILL
from ptrace.ctypes_tools import formatAddress, formatWordHex
            for offset in range(nb_words):
                word = ptrace_peekuser(self.pid, offset * CPU_WORD_SIZE)
                bytes = word2bytes(word)
                words.append(bytes)
            bytes = ''.join(words)
            address -= offset
            word = self.readWord(address)
            bytes = word2bytes(word)
 
            # Read some bytes from the word
            # Read word
            word = self.readWord(address)
            bytes = word2bytes(word)
 
            # Read bytes from the word

src/s/e/segvault-HEAD/fusil/ptrace/gdb.py   segvault(Download)
from ptrace.binding import HAS_PTRACE_SINGLESTEP
from ptrace.disasm import HAS_DISASSEMBLER
from ptrace.ctypes_tools import (truncateWord,
    formatWordHex, formatAddress, formatAddressRange, word2bytes)
from ptrace.process_tools import dumpProcessInfo
def getPointers(process, address):
    address = word2bytes(address)
    procmaps = readProcessMappings(process)
    for pm in procmaps:
        for found in pm.search(address):

src/p/y/python-ptrace-0.7/gdb.py   python-ptrace(Download)
from ptrace.binding import HAS_PTRACE_SINGLESTEP
from ptrace.disasm import HAS_DISASSEMBLER
from ptrace.ctypes_tools import (truncateWord,
    formatWordHex, formatAddress, formatAddressRange, word2bytes)
from ptrace.process_tools import dumpProcessInfo
def getPointers(process, address):
    address = word2bytes(address)
    procmaps = readProcessMappings(process)
    for pm in procmaps:
        for found in pm.search(address):

src/s/e/segvault-HEAD/fusil/ptrace/ptrace/debugger/breakpoint.py   segvault(Download)
from weakref import ref
from ptrace.cpu_info import CPU_POWERPC, CPU_WORD_SIZE
from ptrace.ctypes_tools import word2bytes
 
class Breakpoint:
        if CPU_POWERPC:
            # Replace instruction with "TRAP"
            new_bytes = word2bytes(0x0cc00000)
        else:
            # Replace instruction with "INT 3"

src/p/y/python-ptrace-0.7/ptrace/debugger/breakpoint.py   python-ptrace(Download)
from weakref import ref
from ptrace.cpu_info import CPU_POWERPC, CPU_WORD_SIZE
from ptrace.ctypes_tools import word2bytes
from ptrace.six import b
 
        if CPU_POWERPC:
            # Replace instruction with "TRAP"
            new_bytes = word2bytes(0x0cc00000)
        else:
            # Replace instruction with "INT 3"