Assembly routine to use a crack on any file, as %1 in a batch file 
Author Message
 Assembly routine to use a crack on any file, as %1 in a batch file

For my patches i use Byte Hunter v1.3 from THE_q and Nop (Phrozen Crew).
With this program it's only possible to patch a file which is named in the
.asm file, because the .asm file use "lea dx,FileName1".

I want to use it as a real general patch, to patch more files of different
programs, which has the same string to patch. Is it possible to change the
.asm to work on every file, eg. "patch.com [filename]", like %1 in a batch
file?



Sun, 13 Jan 2002 03:00:00 GMT  
 Assembly routine to use a crack on any file, as %1 in a batch file

Quote:

> For my patches i use Byte Hunter v1.3 from THE_q and Nop (Phrozen Crew).
> With this program it's only possible to patch a file which is named in the
> .asm file, because the .asm file use "lea dx,FileName1".

> I want to use it as a real general patch, to patch more files of different
> programs, which has the same string to patch. Is it possible to change the
> .asm to work on every file, eg. "patch.com [filename]", like %1 in a batch
> file?

The command line appears at offset 80h of the PSP (program segment
prefix) block (first a byte telling the command line length, then the
actual command line).

        AriL
--
Whom computers would destroy, they must first drive insane.
Homepaged at http://www.angelfire.com/or/lukumies



Sun, 13 Jan 2002 03:00:00 GMT  
 Assembly routine to use a crack on any file, as %1 in a batch file


Quote:
> For my patches i use Byte Hunter v1.3 from THE_q and Nop (Phrozen Crew).
> With this program it's only possible to patch a file which is named in
the
> .asm file, because the .asm file use "lea dx,FileName1".

> I want to use it as a real general patch, to patch more files of
different
> programs, which has the same string to patch. Is it possible to change
the
> .asm to work on every file, eg. "patch.com [filename]", like %1 in a
batch
> file?

Ofcourse !  Look at offset 0080h in the PSP.  That's where the arguments
provided with the program are stored.  The only thing you have to do is to
isolate the argument, and add a 00h-byte to it to n\make it readable for
the INT 21h file-functions.

By the way: the technique of extracting single arguments from a
command-line is called "parsing"

Greetz,
  Rudy Wieser



Sun, 13 Jan 2002 03:00:00 GMT  
 Assembly routine to use a crack on any file, as %1 in a batch file

Quote:
> I want to use it as a real general patch, to patch more files of different
> programs, which has the same string to patch. Is it possible to change the
> .asm to work on every file, eg. "patch.com [filename]", like %1 in a batch
> file?

As you suggested, use the command line pararmeter (the [filename]).
You can find it in the PSP at offset 80h. Note that the first byte
in the command line indicates how long the string is.

mov si,cs   ;Get code segemnt
sub si,10h  ;Make PSP segment
mov ds,si
mov di,80h ;ds:di points to start of command tail.

Leon.



Sun, 13 Jan 2002 03:00:00 GMT  
 Assembly routine to use a crack on any file, as %1 in a batch file

Quote:

> As you suggested, use the command line pararmeter (the [filename]).
> You can find it in the PSP at offset 80h. Note that the first byte
> in the command line indicates how long the string is.

> mov si,cs   ;Get code segemnt
> sub si,10h  ;Make PSP segment
> mov ds,si
> mov di,80h ;ds:di points to start of command tail.

That will work for com programs. However, exe programs may have more
than one code segment, so your method is not reliable there. To get the
PSP segment, the preferred method is:

        mov     ah,62h
        int     21h
        ; returns PSP segment in BX

Later,
        AriL
--
Whom computers would destroy, they must first drive insane.
Homepaged at http://www.angelfire.com/or/lukumies



Mon, 14 Jan 2002 03:00:00 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Using a batch file under win95

2. call a batch file using rexx

3. Using a Module in CICS and Batch with File I/O

4. Assembly Standard Libraries - File routines

5. Assembly Standard Libraries - File routines

6. How to pass the argv variables from batch file to .tcl file

7. How to pass the argv variables from batch file to .tcl file

8. WANTED: FORTRAN ROUTINE TO COVERT RAW FILES INTO GIF FILES

9. Regular Expressions in Rexx to crack a comma delimited file

10. HELP -- Cracking Image Files

11. (VA 4.02b) using long file names for Envy file attachments

12. searching one file using the contents of another file

 

 
Powered by phpBB® Forum Software