one thing prerecord:
when it comes to scripting I am a totally noob! so I am asking for your patience. But of course I am trying to be as precise as possible.
the setting:
I have a program running under DOS-Box. This program is called by a batch file. After quitting this program in DOS-Box I want the batch-script to look after a certain file (which is written in hex). This file is located in the same folder as the batch-file itself. after doing so, the batch routine should dig into it and search for a concrete value. finally if that value is present, the value should be reset to "0" and another executable should be called. All these steps may happen silently (in background / no echos).
folder structure:
BATCH.bat (batch-file)
CK4PATCH.EXE (executable running in DOS-Box)
CONFIG.CK4 (hex-file containing a certain value eg. 27 10 or 4E 20)
KMOD1.pat (essential patch-file)
KMOD2.pat (variable patch-file which is called depending on the CONFIG.CK4 value)
KMOD3.pat (variable patch-file which is called depending on the CONFIG.CK4 value)
current batch-script:
here is what I came up with so far. the comments should show things which needs to be done.
Code: Select all
@echo off
CK4PATCH.EXE KMOD1.pat
goto CONFIG
:CONFIG
if exist \CONFIG.CK4 goto CHECKCONFIG
goto END
:CHECKCONFIG
:: check the CONFIG.CK4 file for the hex value 27 10
:: if found goto MOD2
:: else check CONFIG.CK4 file for the hex value 4E 20
:: if found goto MOD3
:: else goto ERROR
:MOD2
:: set the CONFIG.CK4 hex value 27 10 to 00 00
CK4PATCH.EXE KMOD2.pat
goto CONFIG
:MOD3
:: set the CONFIG.CK4 hex value 4E 20 to 00 00
CK4PATCH.EXE KMOD3.pat
goto CONFIG
:END
exit
:ERROR
echo no values found
pause
goto :END
can somebody help me with this please?
do not hesitate to ask for information I forgot to add.
thanx in advance
Kylie Blaze
ps.: the CONFIG.CK4 file looks something like this (of course without the line breaks):
Code: Select all
43 4b 34 20 04 20 20 03 49 1f b0 20 30 20 83 54 52 ff 54 ff 14 06 49
1f 76 ff 20 30 78 2d 76 ff 20 20 20 20 bc 35 bc 35 f3 01 35 1b 86 72
20 20 76 ff 5a 0f 35 1b 01 20 20 20 82 ff ad 0f 35 1b c0 4E 20 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 10 27 20 20 07
20 02 20 01 20 20 20 1d 38 47 48 49 4b 4d 4f 50 51 01 20 20 20 20 20
01 20 01 20 20 20 39 20 20 20 20 20 20 20 20 20 20