Log in

View Full Version : Patch file but leave 'modified' flag same


ASMCoder
December 11th, 2000, 08:26
I wrote an asm patcher to update a keymakers
data file and registry settings. However the keymaker detects that the datafile has been
modified and resets the file.

I noticed Hworks32 retains the settings but Ultraedit7 does not. So it must be easy ?

So how do I 'retain' the file settings after patching the file. ASM source example would
be nice.

ASM(wouldbe)coder

ASMcoder
December 12th, 2000, 06:20
Thanks, yes the target does access this. But I want to make a third party 'stealth' patch. NOT to disturb the target.... for several reasons

I also have a need to 'unset' the archive flag in assembler any takers for an example ?

Also in the registry what value is REG_DWORD ? to poke in new value as part of the API input before RegSetValueExa , I only know REG_SZ = 1 the API guide does not elaborate on any of these two topics for 'dwType' or 'archive' flag on WriteFile

Nearly ASMcoder

NicoDE
December 12th, 2000, 11:37
at first the constants you're looking for

REG_NONE = 0; No value type
REG_SZ = 1; Unicode nul terminated string
REG_EXPAND_SZ = 2; Unicode nul terminated string (with environment variable references)
REG_BINARY = 3; Free form binary
REG_DWORD = 4; 32-bit number
REG_DWORD_LITTLE_ENDIAN = 4; 32-bit number (same as REG_DWORD)
REG_DWORD_BIG_ENDIAN = 5; 32-bit number
REG_LINK = 6; Symbolic Link (unicode)
REG_MULTI_SZ = 7; Multiple Unicode strings
REG_RESOURCE_LIST = 8; Resource list in the resource map
REG_FULL_RESOURCE_DESCRIPTOR = 9; Resource list in the hardware description
REG_RESOURCE_REQUIREMENTS_LIST = 10;

as far as i had some minutes of sleep i'll post an asm example
wich assembler you are using ?

Nico_

ASMcoder
December 13th, 2000, 05:42
Thanks,
I am (ab)using TASM5 !
I searched my home pc for 'inc' files and found a nice one in MASM6 (Iczelion updated) that gave the same info re
REG_DWORD etc etc. I use TASM5 because I can directly relate softice screen to coding
BUT I will try and switch to MASM6 as it looks to be more 'higher level' with those nice invoke macros etc. More learning !!!!

I now kill the file and create file with the data I wanted to replace. This leaves the archive flag unset. BUT it would be nice to have control via ASM of this feature without killing/creating

Thanks again .

ASMcoder
December 13th, 2000, 08:13
Thanks,
I am (ab)using TASM5 !
I searched my home pc for 'inc' files and found a nice one in MASM6 (Iczelion updated) that gave the same info re
REG_DWORD etc etc. I use TASM5 because I can directly relate softice screen to coding
BUT I will try and switch to MASM6 as it looks to be more 'higher level' with those nice invoke macros etc. More learning !!!!

I now kill the file and create file with the data I wanted to replace. This leaves the archive flag unset. BUT it would be nice to have control via ASM of this feature without killing/creating

Thanks again .