<commit_before>import ctypes
from .. import _x64dbg


MAX_ERROR_SIZE = 60


def Assemble(addr, instruction):
    byte_array = bytearray()
    result, size = _x64dbg.Assemble(addr, byte_array, instruction)
    if result:
        return byte_array[:size]

def AssembleEx(addr, instruction):
    error = ctypes.create_string_buffer(MAX_ERROR_SIZE)
    byte_array = bytearray()
    result, size = _x64dbg.AssembleEx(addr, byte_array, instruction, error)
    if not result:
        raise Exception(error[:size])
    return byte_array[:size]

def AssembleMem(addr, instruction):
    return _x64dbg.AssembleMem(addr, instruction)

def AssembleMemEx(addr, instruction, fillnop):
    error = ctypes.create_string_buffer(MAX_ERROR_SIZE)
    result, size = _x64dbg.AssembleMemEx(addr, instruction, error, fillnop)
    if not result:
        raise Exception(error[:size])
    return result<commit_msg>Fixed Assembly<commit_after>import ctypes
from .. import _x64dbg


MAX_ERROR_SIZE = 512


def Assemble(addr, instruction):
    byte_array = bytearray()
    result, size = _x64dbg.Assemble(addr, byte_array, instruction)
    if result:
        return byte_array[:size]

def AssembleEx(addr, instruction):
    error = ctypes.create_string_buffer(MAX_ERROR_SIZE)
    byte_array = bytearray()
    result, size = _x64dbg.AssembleEx(addr, byte_array, instruction, error)
    if not result:
        raise Exception(error)
    return byte_array[:size]

def AssembleMem(addr, instruction):
    return _x64dbg.AssembleMem(addr, instruction)

def AssembleMemEx(addr, instruction, fillnop):
    error = ctypes.create_string_buffer(MAX_ERROR_SIZE)
    result, size = _x64dbg.AssembleMemEx(addr, instruction, error, fillnop)
    if not result:
        raise Exception(error)
    return result[:size]
{'fraction_non_alphanumeric': 0.09193457416807671, 'fraction_numerical': 0.01410039481105471, 'mean_word_length': 4.343373493975903, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2270182', 'n_tokens_mistral': 576, 'n_tokens_neox': 552, 'n_words': 132}