EasyPatch V1.1 (C)1992 by Adrian Studer (Chicken/ECR) Home of EPatch: The Lycaeum ++41 41-762-989 v32b/v42b Registered to you! ------------------------------------------------------ WHAT IS EPATCH GOOD FOR ? Isn't it ugly ? You've made a silly tool/game/demo and it fills a directory with tons of unpacked RAW-Files. Wasting a lot of rare diskspace, easy to rip for every lamer, and worst: it looks unprofessional. Up to now, there were three solutions: a) you created an overlay. But what's an overlay, how to create it, how to load it ? It's mostly not compressable with a normal EXE-packer like PKLite or LZEXE. b) you converted the data-files into ASCII (db ....). But the include-files need a lot of diskspace, include is quite slow, and it's not possible to include more than 64K at once. c) you converted the data-files into OBJ. But compiler/linker put it where they want, with more than 64K only God, Microsoft and Borland know, how to set up the segments to get a correct linking! (You're right, I'm just too stupid for (the usual?) solution c... ) EPatch is completly different: * You know/say where the datas are * Include binary files without any converting * Don't care about the 64K boundary anymore * It's faster than light ------------------------------------------------------ AND NOW THE DOCS ! Imagine, you want to show everyone out there your selfdrawn picture (bleech)! It's converted into a rawfile (or do you want to code a GIF-decoder?), the first 768 bytes are colours, the next 64000 bytes are bitmap. This file we call TEST.PIC. First the Source of TEST.ASM: .MODEL SMALL .STACK 100h .DATA Colors db "MyPiccy" ;the label epatch is looking for db 768 - 7 dup (0) ;"-7" is the lenght of the label Bitmap db 64000 dup (0) VidMode db 0 .CODE START: mov dx,@DATA ;just a little silly example mov ds,dx mov ah,0fh ;save Video-Mode int 10h mov VidMode,al mov ax,0013h ;set video-mode = 13h int 10h ;320x200 256 colors mov ax,1012h ;turn on colors mov bx,00h mov cx,100h mov dx,ds mov es,dx mov dx,OFFSET Colors int 10h mov si,OFFSET Bitmap ;copy bitmap to screen mov di,00h mov dx,0A000h mov es,dx mov cx,64000 rep movsb mov ah,08h ;wait for a key int 21h mov ah,00h ;restore video-mode mov al,VidMode int 10h mov ax,4c00h ;return to DOS int 21h END START You have to compile and link it with TASM/TLINK as usual. And now the trick: EPATCH TEST.EXE TEST.PIC MyPiccy This will place the TEST.PIC in TEST.EXE, starting at the label "MyPiccy". As label you should take a name, you're sure that it's not used somewhere else in your program... it isn't that usefull when the picture is linked into a textscreen! The only thing to take care of is, that the label is case-sensitif. ------------------------------------------------------ HOW TO INCLUDE MORE THAN 64 KILOBYTES ? To include more than the magic 64K, you simply have to create some segments that are linked in a row. e.g.: .FARDATA Sound1 MyMuzax db "ForSound" db 0FFF0h dup (0) .FARDATA Sound2 db 0FFF0h dup (0) ... Compiling, linking and patching keeps the same, the only thing to check out is, that your linker sorts segments of the same type by name. ------------------------------------------------------ REVISION HISTORY 05/92 first Beta-Release of EPatch 06/92 Final-Release V1.0 07/92 Version 1.1 fixed a bug that destroyed the destination-file when the lenght of data-file is a multiple of 16K (cool thing eh?!?). ------------------------------------------------------ CONTACT THE AUTHOR You won't believe it, but I've a question to EPatch: How to use EPatch in languages like Turbo Pascal or Basic? If you've written a little doc 'bout this question, or if you got an idea for some switches, or some donations for a poor coder (dreamin'?), then write to: Adrian Studer Vormhle CH-6170 Schpfheim Switzerland or call The Lycaeum ++41 41-762-989 and write a message to Chicken or via InterNet chicken@ezinfo.vmsmail.ethz.ch