function TConfigForm.CheckAppliedOrPatch(Path:AnsiString; Key:AnsiString; Check:Boolean):Boolean;
var i,j,l:Integer; TempIni:TIniFile; bufaddr,bufval:AnsiString; aadr64:Int64;
label Ret;
begin
if not FileExists('.\Arcanum.exe') then Exit;
Result:=True;
TempIni:=TIniFile.Create(Path);

i:=0;
while TempIni.ValueExists(Key,IntToStr(i)) do begin
bufaddr:=StringReplace(TempIni.ReadString(Key,IntToStr(i),''),#32,'',[rfReplaceAll]);
bufaddr:=StringReplace(bufaddr,#9,'',[rfReplaceAll]);
j:=Pos('/',bufaddr);
if j>0 then bufaddr:=Copy(bufaddr,1,j-1);
SplitString(bufaddr,bufval);
if not TryStrToInt64('$'+bufaddr,aadr64) then begin Inc(i); Continue; end;
if Length(bufval) mod 2>0 then begin Inc(i); Continue; end;
if not TestHex(bufval) then begin Inc(i); Continue; end;
l:=Length(bufval) div 2;
for j:=0 to l-1 do begin
if ArcanumMem.Size<aadr64+l then if Check then GoTo Ret else begin Inc(i); Continue; end;
if not Check then PByte(DWORD(ArcanumMem.Memory)+aadr64+j)^:=Byte(StrToInt('$'+bufval[j*2+1]+bufval[j*2+2]))
else if PByte(DWORD(ArcanumMem.Memory)+aadr64+j)^<>Byte(StrToInt('$'+bufval[j*2+1]+bufval[j*2+2])) then GoTo Ret;
end;
Inc(i); end;

if not Check then begin ArcanumFileStream.Position:=0; ArcanumMem.Position:=0; ArcanumFileStream.Write(ArcanumMem.Memory^,ArcanumMem.Size); end;

Result:=False;
Ret:
TempIni.Free;
end;