PINO 1.2 - Patch IN /Out		Copyright (C) 1994 IT-HE Software
========================		=================================


Legal things
============


*	PINO is a freeware program that can be distributed and used freely.

*	It may not be sold, modified, or distributed without this file.

*	There is no warranty, none, nothing, zilch, zippo.  Use at your peril.

*	Any trademarks mentioned here belong to those who own them.



What be PINO?
=============

PINO (PEE-no) is a small program which can overwrite parts of an EXE (or 
anything else) with the text or data of your choice, while preserving a slice
of the original so that it can be patched back in later.

For example,
		If you've got DOOM, and you're writing a patch wad and you want
		to change the messages in the DOOM.EXE file, you can!

		You can write a batch file that will bung the changes in, and
		another batch file which will sling 'em out again.

PINO is not limited to patching the DOOM.EXE, or indeed any EXE at all.
Any file can be patched (I did the first tests on a text file), and restored
later.

I have checked that this works by copying the victim file, patching something
in and out, and running a binary comparison.  It does work.


How do you use it, then?
========================

Starting it
-----------

PINO is pretty powerful, and has it's own simple language.
What you do is write a little script file, and run PINO like this:

		PINO doom.exe names.pin
		|    |	      |
		|    |	      the script file (the patches)
		|    |	      
		|    the target file (to be patched)
		|
	   	PINO (the program!)


PINO will then modify the doom.exe file, and create another file called 
'names.old'.  Running PINO with this..

		PINO doom.exe names.old

will restore the doom.exe file to it's original state.		

Script files
------------

A script file consists of a series of commands, which are executed in sequence.

Each command is two letters long, and is preceded by an @ symbol.
Anything which is preceded by an @ is executed, everything else is not.
All commands should be lower case.

Each script file should by ended by the command @nd.

That's about it for the basic theory, I think!  Let's look at the commands.


The PINO command summary
------------------------

COMMAND			FUNCTION			EXAMPLE

@hx [hh hh hh]		Patch a string of HEX pairs	@hx[434d4f53]
@nd			End the script file		@nd
@pa [ttttt]		Patch a string of text		@pa[CMOS Anomaly]
@sk			Skip a byte			@sk
@st [nnnnn]		Set start address		@st468268
@ (nn)			Patch a single byte		@00


In Detail
---------

@hx


This will patch a string of bytes into the target file, starting at the address
specified by the @st command.

If the start position has not been specified, PINO will stop processing the 
script file, and warn you.

For @hx, the string of bytes is a string of hexadecimal digits.
The string must start with a bracket '[' and end with another bracket ']'.
The digits should be lower case (for letters 'a'-'f').
There should be no spaces, no carriage returns, no nothing EXCEPT for the
digits.
As the digits are the two halves of an 8-bit number, there must be an even 
number of them.

GOOD example

@st456789
@hx[4465696d6f7320416e6f6d616c79]
@nd

will patch 'Deimos Anomaly' to position 456789.


BAD example

@st456789
@hx	[44 65 69 6d 6f 73 20
	 6e 6f 6d 61 6c 79]
@nd

This is WRONG, WRONG, WRONG!
PINO will not take kindly to the little spaces, the tabs or the carriage
returns.  Don't do it.

Oh yes, and don't forget the other bracket!
	    -------------------------------


@nd


This is the End-Of-File terminator which will tell PINO to stop processing
the script file.  Not much can go wrong with that!

Try not to forget it: PINO won't thank you for it if you do.


@pa


This will patch a string of bytes into the target file, starting at the address
specified by the @st command.

If the start position has not been specified, PINO will stop processing the 
script file, and warn you.

For @pa, the string of bytes is a text string.
The string must start with a bracket '[' and end with another bracket ']'.

example

@st456789
@pa[Deimos Anomaly]
@nd

will patch 'Deimos Anomaly' to position 456789.


This is easier to use than the @hx Hex command, but it will ONLY work with
normal ascii characters! (i.e. values from 32-126)


Again, don't forget the other bracket!
       -------------------------------



@sk


This will just skip a byte.  Not an awful lot of use anymore.
It skips one byte, moving the start pointer on bye one.

example

@st456789
@sk
@nd

now the start pointer points to 456790.


@st


This will set the start pointer.  That is, it will tell PINO whereabouts in the
target file you want to patch over.
The number is in DECIMAL, not HEX.
There is no space between @st and the number.

example

@st456789
@pa[Hello]
@nd

sets the start pointer to 456789 and patches 'Hello' into the target, starting
from that point.


@(nn)


This will patch a single decimal number into the target file, at the current
address specified by the start pointer.
There are no brackets, and no space between the @ and the number.
The number can be two or three digits long: no more, no less.

If the start pointer has not been set beforehand, PINO will stop processing
the script file and warn you.

example

@st456789
@pa[Hello]
@00
@pa[World]
@123
@00
@nd

That will patch in 'Hello', followed by ascii code 0, then 'World' and finally
an ascii code 123 (a '{').



A DOOMSTICK utility?
====================

Yea, DOOMSTICK was to be the ultimate DOOM utility, combining fully-working
graphic, sound and level editors in one neat package.

BUT..
=====

We ran into problems while reverse-engineering the graphics formats, and went
up a blind alley.  By the time we realised, DEU was better and more complex
than DOOMSTICK could ever be, so we dropped it.
Nice name, though.

Finally
=======

Think I covered everything.

Look out for the ITG (IT-HE Graphics Library) - The best and fastest FREE
VGA graphics toolkit we know of!	(Availible from QUANTUM LEAP BBS)
					(+44-908-211805)

Urr, have fun.