ÚÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ¿ º °±²ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ²±2 º º ±²ßÜÜßÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ²± º º ²ÛÜßßÜÛÛÛÛÛÛÛÛßßßßÛÛÛÛÛÛßßßßÛÛÛÛ² º º ÛÛÛßßÜÜßÛßÜÜßÜÛÛÛÛÜßÛßÜÜÛÛÛÛÜßÛÛÛ º º ÛÛݲÛÛÛÝÛݲÛÛÛßßÛÛÛÝݲÛÛÛßÛÛßÜÛÛÛ º º ÛÛÛ ²ÛÛÝÛÞ²ÛÛ ÛݲÛÛÞÞÛÛÛÞÛÜÜÜÛÛÛÛ º º ÛÛÛ ²ÛÛÞݲÛÛÝÛݲÛÛÝÛݲÛÛÜßßßÜÜßÛÛ º º ²Û ßßÜÜÛÜßßßÜÛݲÛÛÜßÛÜßßÛÛÛÛÛßÜÛ² º º ±²ÛÛÛÛÛÛÛÛÛÛÛÛÛÜßßÜÛÛÛÛÛÜÜÜÜÜÛÛ²± º º °±²ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ²±° º ÀÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÙ INC-Pro II, Copyright (C) Andrew Cameron (KeLewAN) 1995 ÚÄÄÄÄÄÄÄ¿ ³ Files ³ ÀÄÄÄÄÄÄÄÙ INCPRO .COM 2671 Command-line utility INCPRO2 .DOC 7852 Document FILE_ID .DIZ 703 BBS description ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Requirements ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ - MSDOS compatible system - 386+ PC INCp2 is 100% Windows95 compatible. ÚÄÄÄÄÄÄÄ¿ ³ Intro ³ ÀÄÄÄÄÄÄÄÙ INC-Pro II is a coder's utility to convert a binary file to an ASM, C/C++, GEMA, or QuickBasic include file. The point of this being that you can include data inside an executable instead of reading from external files. Example uses of INC are for including: - Tables (ie. Sine tables, Hex tables) - Music for a demo/intro, adlib or tracker - Graphics files (fast decoding from memory) - Encrypted strings ÚÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Performance ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÙ - 1 disk read produces 100 rows of output @ 12 bytes per row. - 1 row of output occupies one disk write. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ INC-Pro Version History ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ INC-Pro 1.0 - Written in Microsoft Quick-C 2.5 - Used 64kb read buffering which increased speed up to 5x faster than the original versions of INC - Optional bit rotation added for security - Neat column layout in output files - Specify label and array names from the command line INC-Pro 1.0a - Fixed a few minor document errors INC-Pro 2.0 - Now re-written in 100% turbo assembler! - Much smaller (lost about 8k) - MUCH faster - New GEMA support - Smarter cache system - Smartdrive & compatible support - Presented as a DOS utility - Removed the annoying DIZ file writing - Removed that stoopid error beep - 386 requirement (sorry!) ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Command line ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ This help text can be viewed by executing Inc-Pro with the '/?' option... INCPRO [/A | /G | /C | /Q] [/R:x] /A Output Assembler include file. /G Output GEMA include file. /C Output C/C++ header file. /Q Output QuickBasic include file. /R Rotate each byte by [x] positions (x = 1 to 7). Notes: - INC-Pro goes by the last mode given on the command line (ie. /A) - INC-Pro will use ASM output if no mode option is specified ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Assembler Notes ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ INC-Pro will output an "*.INC" include file that can be included using the INCLUDE directive which is found in TASM and MASM. The data is labelled "mydata" and a constant giving the data length is added called "mydatalength". ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Assembler Example ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ; ; This example will display a string, ; possibly converted from a text file. ; I used this method to write up the ; help text in INC-Pro II... ; .model tiny ; 64kb for code & data code segment para public 'CODE' assume cs:code org 100h ; .COM file start: jmp main ; Jump over data area text_string: include MYDATA.INC ; Include data main proc near mov ah, 9 ; Display string lea dx, [text_string] int 21h mov ax, 4C00h ; Exit and return 0 int 21h main endp code ends end start ÚÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ C/C++ Notes ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÙ INC-Pro will output a "*.H" include file. By default INC-Pro will give the name "MYDATA" to the array. INC-Pro also defines something called "mydatalength" which holds the length of the original binary file. ÚÄÄÄÄÄÄÄÄÄÄÄ¿ ³ C Example ³ ÀÄÄÄÄÄÄÄÄÄÄÄÙ /* This example will display a string, possibly converted from a text file. */ #include #include "MYDATA.H" void main(void) { printf("%s", (unsigned char *)mydata) } ÚÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ GEMA Notes ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ GenPC Elite Assembler is a new non-standard assembler by Sector One. It has quite a few advantages including opcodes for anything up to P6! I've added GEMA support to INC-Pro II because I think it deserves some support, and this could be useful to anyone who wants to give it a try. Basically this output mode is alot like ASM so the example you see below is a conversion... ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ GEMA Example ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ ; ; This example will display a string, ; possibly converted from a text file. ; code segment org $100 ; .COM file start: bra main ; Jump over data area text_string: INCLUDE 'MYDATA.INC' ; Include data main move.b #9,ah ; Display string lea text_string,dx trap #$21 move #$4C00,ax ; Exit and return 0 trap #$21 ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ QuickBasic Notes ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ INC-Pro will create a 'BI' include file. To include this in your program just add the line "rem $include: 'MYDATA.BI' ". The quickbasic is in DATA format, so you'll need to use READ to access it (refer to quick-help). A variable called 'mydatalength' is also added and contains the length of the original binary file. Note that QB shits itself over long source code so an idea might be to use the CHAIN function. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ QuickBasic Example ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ 'This example will write back the original binary file to MYDATA.BIN '$include: 'mydata.bi' open "mydata.bin" for binary as #1 for byte=1 to MYDATALENGTH read byteval% put #1, byte, byteval% next byte close #1 ÚÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Known Bugs ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÙ - You'll get a 'divide overflow' error if you use the same filename for both source and destination. (Your own fault if you do something stupid like that!) Please report any bugs to me, big or small. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Future Versions ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ I plan to release at least one more version of INC-Pro. It will have the following new features: - User-definable encryption code Imagine this... you're writing a major piece of software and bit rotation just won't cut it. So what do you do? You load debug and write a small piece of code to do what you will to AL, the register containing the byte to be modified. You specify the new encryption script on the INC-Pro command line, then INC patches it over an area of NOPs in it's own code. The file is converted and each byte encrypted with your own method. - Pascal output? I've never even touched Pascal and I don't plan to, but I've heard that it's hard for coders to give preset values to arrays in Pascal. This should have been added before GEMA but I still need my own copy of PAS to experiment with. ÚÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ ³ Other stuff ³ ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÙ You can contact me on: kelewan@adam.com.au or try my homepage on: http://www.adam.com.au/~kelewan