Jump to content

A.M. Hoornweg

Members
  • Content Count

    505
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by A.M. Hoornweg

  1. Hello all, I'm currently using Turbopower Lockbox 2 for AES encryption and I'd like to move on to something that's newer & active. The caveat is that I need to stay compatible with existing encrypted binary files. Lockbox2 converts a password into a 128 bit hash (a 16 byte array called tKey128) using a proprietary algorithm. Subsequently, its AES cipher uses this hash for encrypting or decrypting the data. I have the old Lockbox2 password hashes ready-made. Is it possible to use them in a newer library (such as lockbox 3) to decode files that were previously AES encoded using Lockbox 2?
  2. Hello all, Our company uses several Delphi versions and I want my code to compile without warnings on all these versions. When I compile one of my units with Delphi Rio, the compiler emits a warning that "sysutils.searchbuf" is deprecated and has moved to the "ansistrings" unit. No problem, but how do I find out in which Delphi version this transition was made? I'd like to write an appropriate {$IF compilerversion} around my code block to suppress the warning and keep it functional across all Delphi versions. Kind regards, Arthur
  3. I use a freeware tool called "agent ransack" which is brilliant for quickly finding strings in whole directory trees. It also has a regular expressions option and it is lightning fast. What's especially nice about Agent Ransack is that you can drag&drop the search results onto an editor like Notepad++ and then perform a bulk search&replace inside all opened files.
  4. That's cool! I really need to take a closer look at these event functions. Thanks for teaching me something new!
  5. I use Finalbuilder too, but as far as I can see you can't parametrize the Delphi version in the compile action. Do you create a separate compile action for each Delphi version?
  6. Never mind, I've found an easier way to find it out. Look at this page : http://docwiki.embarcadero.com/Libraries/Rio/en/Help_of_Previous_Versions This page lets me browse the help file wiki for older Delphi versions (starting with 2010). I simply navigated to the unit of interest for a specific Delphi version, such as this one: http://docwiki.embarcadero.com/Libraries/XE7/en/System.AnsiStrings ... and by simply replacing the "XE7" in the link for older versions, I was able to ascertain that function "searchbuf" first appeared in the Ansistrings unit in Delphi XE4. Problem solved!
  7. Well, "plain text files" are a terrible data interchange format anyway, because it doesn't say anything about the syntax or even the character set. Guessing the character set is hard enough!
  8. function GuessDecimalSeparator(const Value: string): Char; var i,commacount,dotcount,lastsep:integer; c:char; Const DefaultDecimalSeparator='.'; begin commacount:=0; dotcount:=0; lastsep:=0; for i:=1 to length(value) do begin c:=value[i]; if c = '.' then begin inc(dotcount); lastsep:=i; end; if c = ',' then begin inc(commacount); lastsep:=i; end; end; Case (dotcount + commacount) of 0: result:=DefaultDecimalSeparator; //Default 1: Result:=Value[lastsep]; //accept the one separator ELSE //If a separator occurs more than once, it must be the thousand separator Begin if (commacount > dotcount) then result:='.' //multiple commas else if (dotcount > commacount) then result:=',' //multiple dots else //equal amounts, take last separator result:= Value[lastsep]; End; end; end; This function uses the simple assumption that a decimal separator should occur at most one time in the string, but thousand separators may occur multiple times.
  9. Hello all, I would like to re-build Delphi's RTL/VCL without RTTI for a certain project in which the compiled size of the DLL's and executables is important. I'd be very grateful if someone could supply some insight or maybe a script to accomplish it. I have no problem doing so using Delphi XE but Delphi Rio is giving me a hard time.
  10. A.M. Hoornweg

    Recompile Delphi RIO RTL/VCL?

    Hello, that's pretty much how I do it using Delphi XE. I copy all RTL/VCL units into a temporary subdirectory, then reference all these units in a small dummy console program (having the RTTI directives mentioned in the link above) and then perform a full build of this dummy project. The resulting bunch of DCUS can then be used instead of the regular RTL/VCL (just set a project's search path to the directory containing the dcus) and it will produce vastly smaller executables. Unfortunately, in newer Delphi versions these RTTI settings can no longer be specified per-project, they must be set per-unit, requiring a manual change of every unit and that's many hundreds of them. I was hoping there would be a way around that.
  11. A.M. Hoornweg

    Shellexecute cmd.exe with spaces

    ... unless you need to use pipes, environment variables or want to capture the output of a command line program into a file. Then cmd.exe is a real life saver for which there is no real alternative as far as I'm aware. I had precisely that case last week. In an installation routine (inno Setup) I needed to figure out if a set of Microsoft IIS components was installed correctly before allowing the user to continue the installation of my ISAPI webservice. The following one-liner gives that information sorted in a text file. cmd.exe /s /c dism /online /Get-Features /Format:table /English | sort >%tmp%\dismfeatures.txt (Note that on 64-bit systems, this particular example requires calling the 64-bit version of cmd.exe; The 32-bit version of cmd.exe will call the 32-bit version of dism.exe which is totally non-functional on 64-bit operating systems. Google "Wow64DisableWow64FsRedirection" for more info).
×