Generador De Archivos Corruptos Word Verified [RECOMMENDED]

def generar_archivo_corrupto(file_path): # Crear un documento de Word vacío document = Document()

def main(): file_path = 'documento_corrupto.docx' generar_archivo_corrupto(file_path) if verificar_archivo_corrupto(file_path): print("Archivo corrupto generado correctamente") else: print("Error: el archivo no está corrupto") generador de archivos corruptos word verified

Este código es solo para fines educativos y de prueba. No se recomienda utilizar archivos corruptos para dañar documentos o sistemas. 255) f.seek(0) f.write(data) f.truncate()

def verificar_archivo_corrupto(file_path): try: # Intentar abrir el archivo con python-docx document = Document(file_path) print("El archivo no está corrupto") return False except Exception as e: print(f"El archivo está corrupto: {e}") return True generador de archivos corruptos word verified

# Corromper el archivo modificando bytes aleatorios with open(file_path, 'rb+') as f: data = f.read() # Seleccionar una posición aleatoria en el archivo pos = random.randint(0, len(data) - 1) # Modificar el byte en esa posición data[pos] = random.randint(0, 255) f.seek(0) f.write(data) f.truncate()

We use cookies to make your browsing experience smoother, help us understand how our site is used, and show you ads that match your interests. You’re in control—just select your cookie preferences. Want to know more? Check out our Privacy Policy.