From 95140e4da4d0da2db2e12788ba4ac9800208cd93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nicolas=20Hord=C3=A9?= Date: Wed, 28 Mar 2007 21:54:53 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20logiciels=20permettant=20la=20compressi?= =?UTF-8?q?on=20et=20d=C3=A9compression=20au=20format=20RIP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- outils/compression/rip.asm | 108 +++++++++++++++++++++++++++++++++++ outils/compression/unrip.asm | 88 ++++++++++++++++++++++++++++ 2 files changed, 196 insertions(+) create mode 100644 outils/compression/rip.asm create mode 100644 outils/compression/unrip.asm diff --git a/outils/compression/rip.asm b/outils/compression/rip.asm new file mode 100644 index 0000000..acefad7 --- /dev/null +++ b/outils/compression/rip.asm @@ -0,0 +1,108 @@ +net segment + +org 0100h +assume cs:net,ds:net + +start: +jmp deb +taille dw 0 +signe db 'rip' +signe2 db 64 dup (0) +p1 db '@' +p2 db '@' +min db 4 +deb: +mov BL,DS:[0080h] +xor BH,BH +or BX,BX +mov byte ptr [0081h+BX],00h +mov AX,3D02h +mov DX,0082H +int 21h +mov bx,ax +mov ah,3fh +mov cx,0ffffh +mov dx,offset data +int 21h +mov taille,ax +mov ah,3eh +int 21h +mov si,82h +mov di,offset signe2 +mov cx,64 +rep movsb +mov di,offset signe2 +mov cx,64 +mov al,2eh +repne scasb +push di +mov si,di +mov di,offset data +add di,taille +mov cx,3 +rep movsb +mov ax,di +pop di +mov cx,3 +mov si,offset signe +rep movsb +mov di,ax +mov cx,taille +mov si,offset data +mov dx,1 +boucle: +lodsb +cmp al,[si] +jne pas +inc dl +loop boucle +jmp fin +pas: +cmp dl,min +jb suite +cmp dl,1 +jne go +suite: +mov bx,cx +mov cx,dx +rep stosb +mov cx,bx +mov dl,1 +loop boucle +jmp fin +go: +mov ah,al +mov al,p1 +stosb +mov al,dl +stosb +mov al,ah +stosb +mov al,p2 +stosb +mov dl,1 +loop boucle +fin: +mov ah,3ch +mov cx,0 +mov dx,offset signe2 +int 21h +mov bx,ax +mov ah,40h +mov cx,di +sub cx,offset data +sub cx,taille +mov dx,offset data +add dx,taille +int 21h +mov ah,3eh +int 21h +mov ah,41h +mov dx,82h +int 21h +ret +data db 0 +net ends +end start + +net \ No newline at end of file diff --git a/outils/compression/unrip.asm b/outils/compression/unrip.asm new file mode 100644 index 0000000..02d1f64 --- /dev/null +++ b/outils/compression/unrip.asm @@ -0,0 +1,88 @@ +net segment + +org 0100h +assume cs:net,ds:net + +start: +jmp deb +taille dw 0 +signe2 db 64 dup (0) +p1 db '@' +p2 db '@' +deb: +mov BL,DS:[0080h] +xor BH,BH +or BX,BX +mov byte ptr [0081h+BX],00h +mov AX,3D02h +mov DX,0082H +int 21h +mov bx,ax +mov ah,3fh +mov cx,0ffffh +mov dx,offset data +int 21h +mov taille,ax +mov ah,3eh +int 21h +mov si,82h +mov di,offset signe2 +mov cx,64 +rep movsb +mov di,offset signe2 +mov cx,64 +mov al,2eh +repne scasb +mov si,offset data +mov cx,3 +rep movsb +mov cx,taille +mov di,offset data +add di,taille +mov dx,1 +boucle: +lodsb +cmp al,p1 +je pas +suite: +stosb +loop boucle +jmp fin +pas: +mov al,p2 +cmp [si+2],al +jne suite +lodsb +mov bx,cx +mov cl,al +xor ch,ch +lodsb +rep stosb +mov cx,bx +sub cx,3 +inc si +loop boucle +fin: +mov ah,3ch +mov cx,0 +mov dx,offset signe2 +int 21h +mov bx,ax +mov ah,40h +mov cx,di +sub cx,offset data +sub cx,taille +mov dx,offset data +add dx,taille +int 21h +mov ah,3eh +int 21h +mov ah,41h +mov dx,82h +int 21h +ret +data db 0 +net ends +end start + +net \ No newline at end of file