Re: Replace a byte



Am Tue, 8 Apr 2008 01:48:12 +0200 schrieb almas:

Hi every body.

I can replace any byte by Space, or others particulars bytes. ( alt 168 for
example )
Then, i can destroy all the "alt 168" found in the file
I use SREP.EXE, but it exist anothers usefull tools.

I try to do it my self
Sure i must open the file, read it then find the byte value... i must
resize the file before saving it an close
.. but it do not works !

Where is the problem?

If some body can find an useful code, i will appréciate

My part of code remove all carriage return(CR), but the file must be
lesser than 64KB.

SEARCH: cmp si, cx ; Ende of File?
ja short ZMA
cmp BYTE PTR es:[si], 0Dh
jz short SCHR
inc si
jmp short SEARCH
;--------
SCHR: dec WORD PTR[FILEN]
sub cx, si
mov di, si
inc si
mov ds, FILSEG
dec cx
mov dx, si
rep movsb
mov ax, DATEN
mov ds, ax
mov si, dx
mov cx, FILEN
jmp short SEARCH
;------------------------------------
ZMA:

Dirk
.



Relevant Pages

  • Re: Replace a byte
    ... i can destroy all the "alt 168" found in the file ... jmp short SEARCH ... SCHR: dec WORD PTR ... mov ds, FILSEG ...
    (alt.lang.asm)
  • [2] Lock-free questions ...
    ... {$IFDEF FreePascal} ... MOV EDI, sNum32 ... JMP @@EXIT; ... JMP @@EXIT ...
    (comp.programming.threads)
  • Re: 8031 question
    ... AUXBUF EQU 0; TRICK - BAFER ... BUFFER EQU 100H; PREPARE FOR OUTPUT ... MOV R0,#TEMPDIV; TEMPERATURU CITA SAMO U KRUGU 1 ... JMP EQSEC; ...
    (sci.electronics.design)
  • Skybucks CircleV1
    ... A fun bot/warrior which literally circles around on a circle of jumps ... ;author Skybuck Flying ... mov 50, 2879 ... jmp 255 ...
    (rec.games.corewar)
  • Skybucks DiagVert Line Jumper V1
    ... ;strategy Jumps to Jumps on a diagonal and vertical line to try and stay ... alive and execute others code ... mov 50, 128 ... jmp 129 ...
    (rec.games.corewar)