How do you extract local variable information (address and type) from a Delphi program or the compiler-generated debug info?

Check if any debugging symbols weren’t in binary. Also possible is using GDB (on Windows a port of it). It would be great if you found a .dbg or .dSYM file. They contain source code, eg. gdb> list foo 56 void foo() 57 { 58 bar(); 59 sighandler_t fnc = signal(SIGHUP, SIG_IGN); 60 raise(SIGHUP); 61 … Read more

How do I include a newline character in a string in Delphi?

In the System.pas (which automatically gets used) the following is defined: const sLineBreak = {$IFDEF LINUX} AnsiChar(#10) {$ENDIF} {$IFDEF MSWINDOWS} AnsiString(#13#10) {$ENDIF}; This is from Delphi 2009 (notice the use of AnsiChar and AnsiString). (Line wrap added by me.) So if you want to make your TLabel wrap, make sure AutoSize is set to true, … Read more

Are delphi variables initialized with a value by default?

Yes, this is the documented behaviour: Object fields are always initialized to 0, 0.0, ”, False, nil or whatever applies. Global variables are always initialized to 0 etc as well; Local reference-counted* variables are always initialized to nil or ”; Local non reference-counted* variables are uninitialized so you have to assign a value before you … Read more

Find out what process registered a global hotkey? (Windows API)

One possible way is to use the Visual Studio tool Spy++. Give this a try: Run the tool (for me, it’s at C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\spyxx_amd64.exe or you can download it). Note: there is spyxx.exe (32-bit version) and spyxx_amd64.exe (64-bit version) – if you don’t see anything in 64-bit use the 32-bit version (ie.catches … Read more