Jump to content

TurboMagic

Members
  • Content Count

    233
  • Joined

  • Last visited

  • Days Won

    9

Everything posted by TurboMagic

  1. Which subkeys are you talking about? About the thing with -r: that one I can understand. And: I'm open for pull requests...
  2. Ok, upon request I reworked the description of that project completely now.
  3. While further working on Delphi Encryption Compendium I stumbled over the freeing mechanism for the class registration mechanism. Digging into the history I read something about AddModuleUnloadProc being used in context of packages, which I didn't use yet, but I'm not sure why a simple TDECHash.ClassList.Free; should not be sufficient. So any ideas why this is in? I'm asking, because in that ModuleUnload procedure C++ Builder crashes with "List item not found". So if removing that ModuleUnload completely without causing any negative side effects, it might improve C++ Builder compatibility. nit DECHashBase; [..] procedure ModuleUnload(Instance: NativeInt); var // automaticaly deregistration/releasing i: Integer; begin if TDECHash.ClassList <> nil then begin for i := TDECHash.ClassList.Count - 1 downto 0 do begin if NativeInt(FindClassHInstance(TClass(TDECHash.ClassList[i]))) = Instance then TDECHash.ClassList.Remove(TDECHash.ClassList[i].Identity); end; end; end; initialization AddModuleUnloadProc(ModuleUnload); TDECHash.ClassList := TDECClassList.Create; finalization RemoveModuleUnloadProc(ModuleUnload); TDECHash.ClassList.Free; end.
  4. TurboMagic

    DEC V6.3 released

    Good news, I just released version 6.3 of the Delphi Encryption Compendium cryptography library. You can fin it here: https://github.com/MHumm/DelphiEncryptionCompendium/releases/tag/V6.3"]https://github.com/MHumm/DelphiEncryptionCompendium/releases/tag/V6.3 What's new? Implemented some bugfixes Added Shake128/256 extensible output hash algorithm implementations Made the 32 bit asm implementations of the MD2, SHA384, Tiger, Snefru128 and Snefru256 hash algorithms compile again and they are used now as default for Win32 Delphi projects. In some cases this might double the speed of the hash calculation. Further details about the changes are found in the VersionHistory.pdf file in Docs subfolder. The GetIt Lite version should be released within the next few days. Enjoy TurboMagic
  5. In order to test something, I'd need to have the Hash_Console Demo console application from https://github.com/MHumm/DelphiEncryptionCompendium (DEC) translated to C++ Builder. Why do I need this? In DECOptions.inc there are some switches which would enable 32 bit asm optimized variants of some hash algorithms. The previous developers left a comment there that those are commented out due to some C++ Builder issue. Now if I could check whether this issue still persists and if yes, whether I can selectively disable them via some define, I could improve the library's performance at least for Delphi users and if the issue no longer persists maybe even for C++ Builder users.
  6. I just tried. I got the .hpp files and copied those two referenced over into the directory of that project, but compilation gives a [ilink32 failure] Fatal: file 'SYSTEM.CLASSES.OBJ' cannot get opened. I tried to find the file in my VM, but I failed.
  7. If you want complier dependent enablement of Audits you can file a feature request. Question for me would be what in audits is not CLang compatible... But I'm no C++ developer.
  8. Thanks! I'll try to find the required time in the next few days.
  9. Sorry, David, but I do not speak "C" much and as the DEC library I'm working on seems to be mostly C++ Builder compatible I didn't want to ruin that compatibility just to have some speed gains on Delphi side. The simple solution would have been to remove the uncommenting and don't care about C++ Builder.
  10. Ok, thanks for this rough translation Remy! Now I simply need to get some DECFormat.hpp and DECHash.hpp. Is there a way to get them generated or do I need to craft/create them manually?
  11. TurboMagic

    Class tree utility released

    Hello, I just released a new little utility on GitHub: https://github.com/MHumm/ClassTree It can be used to generate class tree representations for documentation purposes. I hope you like it and don't mind that it's a first version which might still be a bit raw. It fullfiled at least my purposes. Cheers TurboMagic
  12. TurboMagic

    Class tree utility released

    If you like you can contribute this as option via pull request... 😉
  13. TurboMagic

    Class tree utility released

    Yes, it needs the classes to be compiled in, which was ok for my purpose and didn't require to download another library (AST). It is self contained that way but requires source code distribution.
  14. TurboMagic

    Class tree utility released

    My variant generates the hierarchy via RTTI (I don't know how DelphiAST works) and it only considers classes and it can render the tree into textual form (if you use a font containing the needed glyphs). See the GitHub project page, I added two screenshots now.
  15. TurboMagic

    Class tree utility released

    Thanks! I fixed the link. I also had thought I had removed the DEC units...! Grr! I wrote this tool because I needed it for generating some tree for DEC's documentation. If you like to have a search facility you may add this and either create a pull request or contact me otherwise to submit your improvement... 😉
  16. Hello, good news is, that I just released a new version of DEC (Delphi Encryption Compendium): https://github.com/MHumm/DelphiEncry...eases/tag/V6.2 What's new? Fixed some regressions, among them some which hindered compilation with older Delphi versions (support for older compilers might be reduced in future versions!) Fixed bugs in the SCOP and SHARK cipher algorithms The unit test for the hash classes got improved by adding original test vectors to those algorithms which didn't already use original test vectors and where we could find those (for most we could) The SHA3 hash algorithm has been added for 224, 256, 384 and 512 bit including support for message lengths not being a multiple of whole bytes. Our implementation uses Eric Grange's optimizes permutation kernel ASM implementation on WIn32 and WIn64 (with his friendly permission of course!) A new demo got added: Hash Benchmark FMX Now have fun with this. The GetIt provided Lite version should follow within the next few days. TurboMagic
  17. TurboMagic

    Good news! DEC 6.2 just released!

    This is the info that I just released a bugfix version 6.2.1 here: https://github.com/MHumm/DelphiEncryptionCompendium/releases/tag/V6.2.1 What was fixed? fixes bugs preventing use of the demos on older versions, demos have been tested with XE8 Win32 and newer. fixes a bug introduced by Git in a deployproj file of a demo making it non-loadable completely. GetIt submission has already been sent...
  18. TurboMagic

    Good news! DEC 6.2 just released!

    Just to let you know that I just turned in the submission of the Lite version for GetIt publication. So hopefully it should appear there soon...
  19. TurboMagic

    Calling a Delphi DLL from LabView

    I'm writing a DLL which shall be called by LabView (among other environments). Calling a simple function which gets 2 numbers, adds them and returns the result works. That one uses calling convention cdecl, as specified by the "client". But strings are a problem. For getting this tested I developed the following simple function, which shall be called by a LabView test application but this always crashes inside the DLL. Currently it crashes here: "Exception beim Stringrückliefern", if I make a var parameter out of CalcRes it immediately crashes here: "Exception in Berechnung". What might cause this? The caller shall pass a string which a number of chars allocated for and the number of chars he allocated the string for + the #0 terminator in CalcResSize. If the result fits in that, it is returned in the string. CalcResSize will represent the number of bytes needed for the string including the #0 after the call so if the caller didn't pass a long enough string he can call the function again using a longer string. Here's the code: uses System.SysUtils, System.AnsiStrings; function Add(Number1, Number2: UInt8; CalcRes: PAnsiChar; var CalcResSize: UInt8): UInt16; cdecl; var Res : UInt16; ResStr : AnsiString; begin try Res := Number1 + Number2; ResStr := AnsiString(Res.ToString); except On E:Exception do begin OutputDebugString(PWideChar('Exception in Berechnung: ' + E.Message)); Result := 2; Exit; end; end; try if Assigned(CalcRes) and ((Length(ResStr) {* SizeOf(Char)} + 1) <= CalcResSize) then begin System.AnsiStrings.StrPLCopy(CalcRes, ResStr, CalcResSize); Result := 0; end else Result := 1; except On E:Exception do begin OutputDebugString(PWideChar('Exception beim Stringrückliefern: ' + E.Message + ' / ' + madExcept.GetCrashStackTrace)); Result := 2; Exit; end; end; try CalcResSize := (Length(ResStr) {* SizeOf(Char)} + 1); except On E:Exception do begin OutputDebugString(PWideChar('Exception in CalcResSize Berechnung: ' + E.Message + ' / ' + madExcept.GetCrashStackTrace)); Result := 2; Exit; end; end; end; Cheers TurboMagic
  20. TurboMagic

    Calling a Delphi DLL from LabView

    It works now, last failure was to not declare the last function parameter as pointer in the header file they use as this is a var param on my side.
  21. TurboMagic

    Calling a Delphi DLL from LabView

    Thanks for the answer. I changed it to use Move now like this: Move(ResStr[1], CalcRes[0], Length(ResStr)); In my Delphi test application it works flawlessly, but the LabView application calling the DLL still crashes it. Access violation at address 184E140E ... Read of address 00000003 I will try to log the address of the PChar passed in now and if possible it's contents at that time, but I don't know how to read raw RAM for getting a bit more loginfo...
  22. I'm using D10.4.2 and current ICS from GetIt. I'd like to do the following thing but struggle and the demos I have found so far show only one part of the thing each but not how to combine both. I want to send something to an UDP device with unknown address, so I need to send as broadcast. Port is know. Any device listening on that port will send something defined back to me which I want to receive. Sending part already works but OverbyteIcsUdpSend1 example only shows how to send and OverbyteIcsUdpLstn only shows how to listen. Calling Listen anywhere in my code raises an exception ... an Exception of class ESocketException with message 'Address not available (#10049 in listen: Bind)' occurred. FWuTSocket := TWSocket.Create(nil); FWuTSocket.SocketFamily := sfIPv4; FWuTSocket.Addr := '255.255.255.255'; FWuTSocket.MultiCast := FALSE; FWuTSocket.MultiCastAddrStr := ''; FWuTSocket.Proto := 'udp'; FWuTSocket.Port := 1234; FWuTSocket.LocalAddr := '0.0.0.0'; FWuTSocket.LocalPort := '0'; FWuTSocket.LineMode := false; FWuTSocket.OnSessionConnected := OnWuTSearchSessionConnected; FWuTSocket.OnDataAvailable := OnWuTSearchDataAvailable; FWuTSocket.OnSessionClosed := OnWuTSearchSessionClosed; FWuTSocket.Connect; Where to put listen? Or do I need a 2nd socket? If yes, how to set that up so it actually receives the answer(s) of the device(s)? Set the other one in the OnWuTSearchSessionConnected event up and use FWuTSocket.LocalPort as local port? Since I do not have the right device at hand right now I modified OverbyteIcsUdpLstn example to send something back. When that one receives a message it does this: procedure TMainForm.WSocketDataAvailable(Sender: TObject; Error: Word); var Buffer : array [0..1023] of AnsiChar; Len : Integer; Src : TSockAddrIn6; SrcLen : Integer; begin if FSenderAddr.sin6_family = AF_INET then begin SrcLen := SizeOf(TSockAddrIn); Len := WSocket.ReceiveFrom(@Buffer, SizeOf(Buffer), PSockAddr(@Src)^, SrcLen); if Len >= 0 then begin if (PSockAddr(@FSenderAddr).sin_addr.S_addr = INADDR_ANY) or (PSockAddr(@FSenderAddr).sin_addr.S_addr = PSockAddr(@Src).Sin_addr.S_addr) then begin Buffer[Len] := #0; DataAvailableLabel.Caption := IntToStr(atoi(DataAvailableLabel.caption) + 1) + ' ' + String(WSocket_inet_ntoa(PSockAddr(@Src).sin_addr)) + ':' + IntToStr(WSocket_ntohs(PSockAddr(@Src).sin_port)) + '--> ' + String(Buffer); end; WSocket.Close; WSocket.SocketFamily := sfIPv4; WSocket.Addr := String(WSocket_inet_ntoa(PSockAddr(@Src).sin_addr)); WSocket.Port := IntToStr(WSocket_ntohs(PSockAddr(@Src).sin_port)); WSocket.OnSessionConnected := WSocketSessionConnectedAfterReceive; WSocket.Connect; And in the OnSessionConnected event is sends the contents of a packed record like this: WSocket.Send(@FWuT, SizeOf(FWuT)); It is sure that it reads the sending code, but on the other end (that first application which sends a message to the modified OverbyteIcsUdpLstn example) nothing is ever received.
  23. TurboMagic

    Watermark in a FastReports report

    I'm using the Embarcadero FR 6 version in D10.4.2 and want to add a watermark. Which way looks properly? I already tried to place a image on top. It contained the text in semi transparent. Image format was PNG. It looked ok in designer but at runtime in preview an PDF output everything else was put in front of it! Even when I had put these other items into the background in designer! The other solution found was adding a frxMemo in EndDoc event. It sourt of works but doesn't cut it either. I could neither find any way to put it the background as all (but then most likely the TCharts would be placed on top in such a fashion that they'd cover my watermark) nor did I see any way to make the text semi transparent. I read about using an OverlayBand, but no description of how to properly use that. Drop in on the page in designer and add a memo with my text to it? Where does it render when? How to make it covering the other things but in a semi transparent way?
  24. TurboMagic

    Watermark in a FastReports report

    Setting UsePNGAlpha and transparency in the PDF settings do the trick for PDF output, but for preview and print output this (this = using a PNG image with partial transparent contents) still fails. The watermark image is put into the background and then overlapped with everything else.
  25. TurboMagic

    Watermark in a FastReports report

    Thanks in the first place. 1. I do think that image transparent was set to false as I used a PNG. It looked good in designer but not in preview or PDF. I need to check where I can set transparency to true in PDF exportfilter. In my case it had simply put the image behind everything else in preview and PDF. 2. About the OverlayBand: I see references to that and find it in designer, but I don't know how it works. I didn't manage to get it working and I didn't find any documentation for this. Can you give me more information about what to do with this?
×