Jump to content

DelphiUdIT

Members
  • Content Count

    662
  • Joined

  • Last visited

  • Days Won

    14

Everything posted by DelphiUdIT

  1. I used two standalone Indy web server (https): one in a Linux server and one in a Windows 11 system. The web servers (Linux and Windows are the same, simple compiled for different OS) use a TLSv1_2 secure connection and were tested in one year with direct public connection without any filter. SSLLabs (SSL Labs - Test SSL web server) give a valuation of "A" grade to the web server. Tipically every day the application registered 1 thousand of attack, some are simple scanners like others are trying to violate the server. The web servers never went down. With new processors and systems, the number of the Threads is not a problem. I think that Indy is more than mature to use in a production enviroment. Bye
  2. DelphiUdIT

    OpenSSL fails to Load

    This is the version of the arm 64 (arm64-V8a). The others should be the same. Fips means that are compiling with some cryptography function ? I thought fips modules could only be compiled with OPENSSL 3.
  3. DelphiUdIT

    OpenSSL fails to Load

    I have the *.so OpenSSL 1.02 library for all Android SO (x86, x86_64, V7a, V8a) ... they are all date 14/06/2022 and may be the version is 1.02s I really don't know where i found them, and since I also use Indy SSL I researched all libraries for all supported systems. Like i told, I don't know who "create" the library but I used them and no problems were found. Bye openssl-1.02_Android.zip
  4. DelphiUdIT

    How can I programmatically connect to a VPN?

    Using the the Jedi (JVCL) unit JvRas32 you can connect to a any VPN created in Windows (i used it lot of years ago only with Microsft VPN), i don't know if it is actual working:
  5. MQTT is a standard protocol, define define by IETF RFC2119 and whose communication resources are reserved by IANA (TCP V4 Port 1883 and 8883). Oasis organization has take care to introduce some "working" improvement (marking them as "non-normative") to really be used in operative production environment (eg. IoT), and is the "the facto standard". P.S.: most of industrial electronic companies make some products compatible to MQTT, like OPC SERVER (often used to communicate with sensors). Often they do that in "modbus" products with which MQTT has vague similarities. Bye
  6. If one publish a "retain" message, this message will remain "online" until it will be clean or override (eg. publish another message, retain or not). While the message is retain every one can subscribe and receive it. If the message it's clear or override, it's lost for ALL. MQTT is designed to maintain only the last message. Of course I talk about one "topic", one can publish as many topic as he wants. Bye
  7. This may be, but to enable 64 bit ASLR you must enable "HIGH ENTROPY". Enable only ASLR and disable HE should not produce pointer with 64 bit data ..... or i misunderstand ASLR ? With my test i try the two combination (ASLR or ASLR + HE) and i had some problems anyway.
  8. I don't understand very well what you are thinking to do. But remember that MQTT is not a database, it doesn't present you a storytime of alerts, it works on time basis and is totally asynchronous. If i publish a message (thinking that is a retain), until this message "stay" there all can view that, but when the message will clear (or change) .... who read the message its ok, the workstations that were offline and cannot read that "lost that message". Of course you can publish a message like a storyboard shifting all every time, but this is not the scope of the MQTT. If you made a broker or can control a broker, of course you can know how many clients are online and you can decide what to do. Bye
  9. In Delphi 11.2 ASLR (and High Entropy too) may be used and is working. But when i tested it in a real running environment, there were some glitches (AV, memory leak, ....) that don't show up if I simply turn off ASLR. I've noticed that the use of 3rd party dlls (SDK or whatever) even if recent plays a role in this. All of course in a 64-bit environment. I didn't go into depth because I'm busy on several fronts, but in the near future I'd like to go into it further. For now I don't use ASLR and High Entropy. Bye
  10. I'm implementing a new feature to the software I've produced that used e-mail as an alert. Now I'm also testing mosquitto as a server and I'm rebuilding a new MQTT client starting from an old repository on github https://github.com/wizinfantry/delphi-mqtt-client (that version is not working with new enviroment and needs some refresh). The current version of mosquitto supports up to the latest version of MQTT (MQTT 5.0 https://docs.oasis-open.org/mqtt/mqtt/v5.0/os/mqtt-v5.0-os.pdf), SSL (up to TLS 1.3), TCP or websockets. Also you can connect to other brokers. And with retains, there's no problem at all losing alerts, especially using mobile devices as clients. In my opinion, since the server (broker) is already ready, implementing MQTT having a good Delphi "component" allows you to easily manage alerts. Bye P.S.: in this Embarcadero article there is more info and link to a client and broker MQTT write in Delphi: https://blogs.embarcadero.com/learn-how-to-use-the-mqtt-protocol-in-delphi-with-this-library/
  11. DelphiUdIT

    Turn display Off/On

    PostMessage(HWND_BROADCAST , WM_SYSCOMMAND, SC_MONITORPOWER, 2); This should works, it always works in every version of Windows. If it not works, it's possible that you have some drivers, services or others that prevents you from turning it off. Any movements of the mouse and key pressing turn on the monitor. Bye
  12. DelphiUdIT

    Turn display Off/On

    To turn monitor on simply simulate a keypressed: //Simulate the pression of SHIFT key ... keybd_event(VK_SHIFT, 0, 0, 0); keybd_event(VK_SHIFT, 0, KEYEVENTF_KEYUP, 0); Bye
  13. DelphiUdIT

    Zeos on Delphi 11.2

    Download from the official GH repository. Unzip to a folder of your liking. In the Packages\DelphiXE10.4 directory open the group project ZeosDbo.groupproj For each single project present, go under options and change, UNDER THE ITEM DESCRIPTION, libsuffix with the value 280 BUILD ALL, after that INSTALL "ZComponentDesign280.bpl". All should be done as Windows 32 as target platform. After that close all. Restart IDE, go to TOOL/OPTIONS/Language/Delphi/Library. Select the Platform and in the Library path you must add the path to the SRC subfolders (includes SRC) ... core, component, dbc, parsesql, plain. You must add in the Library Path of every Platforms that you want to use (Windows 32 and WIndows 64 for example). Now you are ready to use Zeos, but ... in the repository (lib) there are only drivers for 32 bit DB. You must install the runtime DB (FireBird x64 for example) to use it in the 64 bit application. Bye
  14. In the JVCL exist that component: TJvDialButton. You can use it or start study that component. Bye
  15. DelphiUdIT

    Web-fonts v Desktop-fonts

    I'll give you the answer in Delphi as indicated in this link Pascal load font form resource (embedded in exe). Converting it to C shouldn't be a problem. Make a text file and rename it 'resource.rc'; Put inside a line like this (you can insert how many fonts do you need): LCDN RCDATA ".\LCDN.TTF" The meaning of the data is: "Name of the resource" "Resource Type" "Font FIle Name" Insert the file "resource.rc" in you project; By doing so, you insert the font into your executable and you don't have to extract it or anything else. This is a simple code in pascal to use it: function LoadResourceFontByName( const ResourceName : string; ResType: PChar ) : Boolean; var ResStream : TResourceStream; FontsCount : DWORD; begin ResStream := TResourceStream.Create(hInstance, ResourceName, ResType); try Result := (AddFontMemResourceEx(ResStream.Memory, ResStream.Size, nil, @FontsCount) <> 0); finally ResStream.Free; end; end; procedure TForm1.FormCreate(Sender: TObject); begin if LoadResourceFontByName('LCDN', RT_RCDATA) then //THIS 'LCDN' IS THE NAME OF THE RESOURCE Label1.Font.Name := 'LCDN'; //THIS 'LCDN' IS THE INTERNAL NAME OF THE FONT AND SHOULD BE KNOW (CAUSE THE FONT FILE MAY CONTAIN MORE TYPE LIKE BOLD, OR OTHERS) end; end.
  16. Some time ago I had a similar problem with RESOURCESTRING, both in overwriting (with the VirtualProtect function) and with LOADRESSTRING in multithreading. Since that time I have created a unit in which I perform all the functions of loading the resources and their eventual overwriting by calling it at the end of the initialization of all the other modules, and since then I have not had more problems. I mainly use the function for translation purposes.
  17. DelphiUdIT

    IDE it's not working anymore

    I don't know if this will help, but in the "KNOW ISSUE OF THIS UPDATE" (link to Microsoft KB of the last Update: Win 10 last update ). They talk about problems with applications that use "certain" audio devices. Bye
  18. My mistake. This is the correct code: function cntCaseTbl(Z: Int64): Int64; begin Result := 0; //This should be, otherwise the result will be random value if z > 0 then Result := Trunc(Log10(z))+1; else if z = 0 then Result := 1; end;
  19. I have tried all limit values 1, 10, 100, 1000, 10000, ....., 9, 99, 999, 9999, 99999, ...... And all the returned values are correct.
  20. May be you can write the function in this way ? function cntCaseTbl(Z: Int64): Int64; begin if z >= 0 then Result := Trunc(Log10(z))+1; else Result := 0; //This should be, otherwise the result will be random value end;
  21. DelphiUdIT

    Windows XP App

    If you are FTDI chips in use you have only one way to work on XP: you must use the VCP drivers of FTDI (Virtual Com Port) that simulates the standard Windows com serial port. The drivers should be signed with version prior 2.12.24 !!! You'll find the drivers for XP in this page: All VCP FTDI drivers version for all version of SO Of course you can use the driver on XP if the FT4232 chip is supported ..... In your TCOMPort component use COMx, I mean the COM port listed in the device manager of windows. Hope this help. Bye
  22. DelphiUdIT

    Windows XP App

    Of course, he MUST have "grep" ... he has Delphi 10.4
  23. DelphiUdIT

    Windows XP App

    That function is called for example by the library used with FTDI USB to RS232 / RS485 peripherals. If someone has integrated FTDI peripheral functionality as a COM (serial) component that function may be called. But from what I know, the drivers for those devices no longer load in XP. The serial devices of the FTDI are in very common use.
  24. Remember that in the new Intel hybrid architectures (such as Alder Lake) not all cores are usable, or rather not all cores have the same processing "power" (eg. P-Core and E-Core).
  25. Look at this code and run it (VCL Applicaton with a Form, a Button with OnClick Event and a custom class) unit Unit1; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics, Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls; type TDoSomething = class Danger: string; constructor create; function Ghost: boolean; end; type { TForm1 } TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private public end; var Form1: TForm1; DoSomething: TDoSomething; implementation {$R *.dfm} constructor TDoSomething.create; begin //FROM HERE I NEVER GO THERE .... AND IF I GO THERE BY WRONG, CLOSE THE PROGRAM !!! ExitProcess(0); end; function TDoSomething.Ghost: boolean; begin try result := true; ShowMessage('Here I am, I am a ghost'); except result := false; end; end; procedure TForm1.Button1Click(Sender: TObject); begin if DoSomething.Ghost then //<------- DoSomething is NIL !! ShowMessage('OK, executed') else ShowMessage('KO, some errors append'); end; end. The class is not instantiated, but the GHOST function is executed. Am I missing something? I trust in my abysmal ignorance, because otherwise much more than a certainty collapses ... In tens of years of programming I have never dared to write anything like this, taking some concepts for granted. Aside from the fact that the program doesn't make much sense (good programming rules would also like a "if Assigned(DoSomething) then" before using it), such code cannot run ... at runtime I would expect an error. Hope someone can explain this. Bye
×