Is there any way/trick for writing string into binary data with UNICODE Inno version without using external .dll (crypt32.dll)?
Here's my example, when I compile this with ANSI 5.6.1 Inno everything is ok, but when I compile it with UNICODE version I'm getting unicode style writing (letters with 00 between)
In this example I need $48 $69 hex at specified offset, not $48 $00 $69 $00 but, as I said, I can only get this with ANSI. Is there Unicode way without calling external CryptStringToBinary?
Here's my example, when I compile this with ANSI 5.6.1 Inno everything is ok, but when I compile it with UNICODE version I'm getting unicode style writing (letters with 00 between)
In this example I need $48 $69 hex at specified offset, not $48 $00 $69 $00 but, as I said, I can only get this with ANSI. Is there Unicode way without calling external CryptStringToBinary?
Код:
procedure CurStepChanged(CurStep: TSetupStep);
var
Stream: TFileStream;
begin
if CurStep = ssPostInstall then
begin
Stream := TFileStream.Create(ExpandConstant('{app}\test.exe'), fmOpenReadWrite or fmShareDenyNone);
try
Stream.Seek($40000, soFromBeginning);
#ifdef UNICODE
Stream.WriteBuffer('Hi',2);
#else
Stream.WriteBuffer('Hi',2);
#endif
finally
Stream.Free;
end;
end;
end;