Kas Ob.
Members-
Content Count
684 -
Joined
-
Last visited
-
Days Won
11
Everything posted by Kas Ob.
-
As mentioned above you can declare it, there is also my emulated version for very old Windows, which is the exact implementation on Windows that do provide GetTickCount64 function GetTickCount64Emu: UInt64; // can be renamed to GetTickCount64 const KUSER_BASE_ADDRESS = $7FFE0000; begin Result := (PUInt64(KUSER_BASE_ADDRESS + $320)^ * PCardinal(KUSER_BASE_ADDRESS + $4)^) shr 24; end; from
- 15 replies
-
- gettickcount64
- tstopwatch
-
(and 2 more)
Tagged with:
-
Right, and the most expensive in drawing is text outputing. Great, now instead of one loop, make 2 loops, one calculate and the next will draw this will relief the CPU cache on L2 (and L3) mainly and L1 secondly a lot ! Delphi code is far from optimized for CPU, after the suggested separation you should enhancement in performance, and yet you will have clear view on the bottleneck being in the calculation and called functions that can be replaced with better shorter versions, or in drawing and it also (i mean the separation) will give you ideas on the combining the drawing steps into lines if needed.
-
POC: Delphi VCL + WebView2 component for OpenAI Realtime (WebRTC, voice & text)
Kas Ob. replied to Maxidonkey's topic in I made this
Hi, I am sorry i can't test the samples as Edge is not there for older Delphi's, and not planning on installing CE as i don't see a real reason (now at least for my self) to do it, anyways.. The code is neat and looks very clean, and most important part the bridge is piece of art, Nice ! and i ( and many here i think) want to hear your finding and experience on 1) using audio with WebRTC and its audio processing, CPU load, does VAD on Delphi with Edge perform as advertised, see, i am very familiar with Jitsi https://en.wikipedia.org/wiki/Jitsi and been a user for years and suggested it for many and many run their own servers, it always astonished me with its performance, like running on old Android even within a browser it was fast and responsive, so what is your experience with it ? how this compare to your EdgeAudio lib. 2) What is the real problem (struggle, may this is not the word but stopped you) with enabling AEC and AGC ? see, Jitsi performed better than native Skype on the same old mobile device with the same connection, on Desktop if you are in middle of conversation and audio is playing then if you change the position of the microphone to close (way closer suddenly) or far from the speakers then a loopback happen ( some distortion and may be echo) for second or fraction of second then it will correct, and to my recall VAD/AEC/AGC are enabled by default, why only VAD ! Thank you for this lib and for sharing! -
I don't know what is LLRP up to 5 minutes ago, yet when searched using duckduckgo with LLRP i got the standard in full which include the TCP transport of the actual protocol, and many other resources https://www.gs1.org/standards/epc-rfid/llrp/1-1-0 https://support.impinj.com/hc/en-us/articles/202756168-Hello-LLRP-Low-Level-Reader-Protocol while i do think you already have these, but let me point you different way to approach this, see.. there is many GitHub repository, these are libraries in different language and flavor, yet this means little to you, but most of them have examples and demos (!) and that what you need to look/hunt for, like this one https://github.com/sllurp/sllurp/tree/develop/examples/fastapi Also if you already have the hardware and may be an application to read/write and perform some operation, then notice that the traffic is unsecure and easily can be captured and watched by WireShark, so ... you know what to do. Hope that helps.
-
ai coding MCP server to catch windows debug messages
Kas Ob. replied to Javier Tarí's topic in General Help
Here is a simple console app that extract exports from a DLL, this is needed to confirm compatibility or if adjustment is needed to make the Compiler/IDE message hook working on newer IDEs than mine. If the function is still there with the same signature (declaration) or similar then it will work, also if it is the same then that means it will work for all IDE newer than XE8. Please, run the following console app, and dump the coreideXXX.bpl exports, and either pack the compress the whole output and attach it here, or just if there is the following or similar procedures @Msglines@TCompilerMsgLine@ @Msglines@TCompilerMsgLine@$bctr$qqr17Compintf@TMsgKindix20System@UnicodeStringiit3t3ox53System@%DelphiInterface$26Msglinesintf@IMessageGroup% @Msglines@TCompilerMsgLine@Draw$qqrp20Vcl@Graphics@TCanvasrx18System@Types@TRecto @Msglines@TCompilerMsgLine@GetLineText$qqrv They are together, and might different after "@Msglines@TCompilerMsgLine@" but that what i need to decode and solve in case there is difference, the above are form coreide220.bpl (XE8) the original code of dumping/getting exports from DLL is by David Heffernan https://stackoverflow.com/questions/31917322/how-to-get-all-the-exported-functions-in-a-dll program DllExportDumper; {$APPTYPE CONSOLE} uses SysUtils, Classes, Windows; // original code by David Heffernan from SO, modified to run in 64bit and support 64bit DLLs // https://stackoverflow.com/questions/31917322/how-to-get-all-the-exported-functions-in-a-dll function ImageNtHeader(Base: Pointer): Pointer; stdcall; external 'dbghelp.dll'; function ImageRvaToVa(NtHeaders: Pointer; Base: Pointer; Rva: ULONG; LastRvaSection: Pointer): Pointer; stdcall; external 'dbghelp.dll'; function EnumerateImageExportedFunctionNames(const ImageName: string; NamesList: TStrings): Boolean; const IMAGE_FILE_MACHINE_AMD64 = $8664; type PIMAGE_NT_HEADERSEX = ^IMAGE_NT_HEADERSEX; IMAGE_NT_HEADERSEX = record Signature: DWORD; FileHeader: IMAGE_FILE_HEADER; {$IFNDEF FPC}{$IF CompilerVersion >= 24.0 } {$LEGACYIFEND ON} {$IFEND}{$ENDIF} {$IF not Declared(IMAGE_OPTIONAL_HEADER64)} OptionalHeader: IMAGE_OPTIONAL_HEADER; {$ELSE} OptionalHeader: IMAGE_OPTIONAL_HEADER32; {$IFEND} end; var i: Integer; FileHandle: THandle; ImageHandle: THandle; ImagePointer: Pointer; NtHeader: Pointer; HeaderEx: PIMAGE_NT_HEADERSEX; // trick to slide by 16 instead of defining record for both 32bit and 64bit, support many compilers ExportTable: ^_IMAGE_EXPORT_DIRECTORY; NamesPtr: PULONG; NamePtr: PAnsiChar; Is64Bit: Boolean; begin Result := False; NamesList.Clear; FileHandle := CreateFile(PChar(ImageName), GENERIC_READ, FILE_SHARE_READ, nil, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0); if FileHandle = INVALID_HANDLE_VALUE then Exit; try ImageHandle := CreateFileMapping(FileHandle, nil, PAGE_READONLY, 0, 0, nil); if ImageHandle = 0 then Exit; try ImagePointer := MapViewOfFile(ImageHandle, FILE_MAP_READ, 0, 0, 0); if not Assigned(ImagePointer) then Exit; try NtHeader := ImageNtHeader(ImagePointer); if not Assigned(NtHeader) or (PIMAGE_NT_HEADERSEX(NtHeader)^.Signature <> $00004550) then Exit; Is64Bit := PIMAGE_NT_HEADERSEX(NtHeader)^.FileHeader.Machine = IMAGE_FILE_MACHINE_AMD64; if Is64Bit then // slide by 16 byte for 64bit HeaderEx := PIMAGE_NT_HEADERSEX(NativeUInt(NtHeader) + 16) else HeaderEx := PIMAGE_NT_HEADERSEX(NtHeader); ExportTable := ImageRvaToVa(NtHeader, ImagePointer, HeaderEx^.OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress, nil); if not Assigned(ExportTable) or (ExportTable^.NumberOfNames = 0) or (ExportTable^.NumberOfNames > 1000000) or (Cardinal(ExportTable^.AddressOfNames) = 0) then Exit; NamesPtr := ImageRvaToVa(NtHeader, ImagePointer, Cardinal(ExportTable^.AddressOfNames), nil); if not Assigned(NamesPtr) then Exit; for i := 0 to ExportTable^.NumberOfNames - 1 do begin if NamesPtr^ = 0 then Exit; NamePtr := ImageRvaToVa(NtHeader, ImagePointer, NamesPtr^, nil); if not Assigned(NamePtr) then Exit; NamesList.Add(string(NamePtr)); inc(NamesPtr); end; Result := True; finally UnmapViewOfFile(ImagePointer); end; finally CloseHandle(ImageHandle); end; finally CloseHandle(FileHandle); end; end; procedure DumpDllExports(const FileName, OutputPath: string); var ExportsList: TStringList; OutputFileName: string; begin ExportsList := TStringList.Create; try if EnumerateImageExportedFunctionNames(FileName, ExportsList) then begin Writeln('Exports API found: ', ExportsList.Count); Writeln('Saving exports for ', FileName); OutputFileName := IncludeTrailingPathDelimiter(OutputPath) + ExtractFileName(FileName) + '.txt'; ExportsList.SaveToFile(OutputFileName); Writeln('File saved -> ', OutputFileName); end else Writeln('No exports found or parsing failed for ', FileName); finally ExportsList.Free; end; end; begin try DumpDllExports('D:\Program Files (x86)\Embarcadero\Studio\16.0\bin\coreide220.bpl', GetCurrentDir); DumpDllExports('C:\Windows\System32\d3dx10_33.dll', GetCurrentDir); except on E: Exception do Writeln(E.ClassName, ': ', E.Message); end; Readln; end. For this exact two dlls on my device the coreide220.bpl return more than 22k exports, while that direct3d library return only 177.- 9 replies
-
- ai
- claude code
-
(and 2 more)
Tagged with:
-
ai coding MCP server to catch windows debug messages
Kas Ob. replied to Javier Tarí's topic in General Help
I did made small package that capture all the output from the IDE at real time compiling/building, it does capture all messages in Output tab and Build tab, but it was tested on few and old IDEs, it works on XE8, Seattle( can't remember which number it was as i don't use it) , Delphi 2010, 2007 and 2009 . If that is needed and can help you then i need a confirm before revisiting it, also it will need your help to make sure it will work on newer IDEs, so do you need it ?- 9 replies
-
- ai
- claude code
-
(and 2 more)
Tagged with:
-
Thinking more and running more twisted tests on the IDE, the thing is the suggestion to delay the question might be not simple and require a lot of modification, so .. If you can access Application.Handle and pass it as owner handle then it should solve this for good, for both M B_APPLMODAL and MB_TASKMODAL, this put all background threads in order and act as the Application should act. And by "can access" i am assuming that message is coming form a DLL and not from the package (PBL), but in both cases i am sure you can find a solution.
-
But thinking more, i think the whole loading setting and blocking for user input, might be a problem, what about dropping the loading of setting in this case and delay the question until the IDE fully loaded, then ask the user his input then ask to fully IDE restart, this should happen rarely but will remove any similar and problematic behavior for good.
-
None as it might cause worse behavior, i am sorry i don't recall testing all the cases with such combination, BUT.. I think MB_APPLMODAL instead of MB_TASKMODAL might the solution with no owner handle, in case that failed then keep using MB_APPLMODAL and use any, like any handle you can access at that stage, on one condition though the handle must be a Delphi form handle.
-
I have a theory on how this might why this happen, which doesn't involve invisible windows. That MessageBox message doesn't have an owner window handle meaning Applicaiton.ProcessMessages might easily cause this halt of messages processing for this very message box as it will prefer the splash screen, all you need is Modal form and MessageBox with MB_TASKMODAL to enforce the conflict while there is no owner, and of course spray a little of back ground thread calling and might be trying to synchronize with the main thread, and if there is Applicaiton.ProcessMessages somewhere from background thread then messages will not be answered.
-
suggestion for 2 new su forum: AI usage and AI coding
Kas Ob. replied to Javier Tarí's topic in Community Management
Such question and its answer is a reason why a sub forum (specified place) is needed. -
Well i tried AI in many cases and wasn't happy with time wasted when the topic about Pascal/Delphi, yet i use Grok with X (Twitter) extensively, it does fantastic job explaining politics and history, In my opinion and for now one sub forum should be sufficient, to prevent a discussion about the place of a topic, the whole idea might yield valuable information and insightful ideas about a technology that is here to stay, should i use it and waste money or not, i voted yes.
-
Yes i was hasty to not consider the generic way to load, nice!
-
Nice ! Not seeing reader or i am missing something ? With reader from JSON, this library will become a must-have tool simplifying JSON debug handling, YAML is human reading friendly, so can be used where JSON usually used also replacing INI and config files.
-
RealThinClient has very powerful TRtcInfo, it is simply put magnificent, capable of many things, but few things in particular are most powerful, namely the ability to read from XML, XML-RPC, JSON and its own binary compacted format also the ability write to any. https://github.com/teppicom/RealThinClient-SDK/blob/develop/src/Lib/rtcInfo.pas#L4073-L4146 YAML is beauty, and having the ability to convert to/from JSON would be fantastic feature, so this might be feature suggestion.
-
Global in RTL for unit communication?
Kas Ob. replied to david berneda's topic in RTL and Delphi Object Pascal
I am not a fan of interfaces, but they have their shining moment, this is one of them, if you introduced C and only used by interfaces then compiler, versioning and implementation should not matter, it will work always. Just take your time to implement it future proof as much as you can think of, don't overengineer it, just keep it simple with multiple interfaces instead of one if possible, also use versioned (numbered) interfaces (in the name) to indicate to yourself and as reminder that these interfaces should not be touched/altered, if in the future need a feature then implement new interface and keep the older. -
debugging an executable started by the one being debugged
Kas Ob. replied to dummzeuch's topic in Delphi IDE and APIs
This is easier i think, But Let the child process check the command line in case of named pipes being passed then child will CreateFile with OPEN_EXISTING then use SetStdHandle to switch, and you are good to go, parent will create them with CreateNamedPipe. In that case parent can switch between standard and named, named can be fixed while you are debugging, parent can be debugged and another debugger will spawn the child on its own with fixed names, This will work, i used this many times, but and unless there is so many other parameters/commandline then it will revert to cumbersome to adjust the child command by hand, yet again these parameter could be temporarily (in debugging mode) to be used form/within a file created by Parent and signaled by specific command to child to process... I think you got the idea, the performance drop between named and standard is negligible. -
Well looking at the log again, i see it differently, and it is madexcept fault, the first log is nice main thread ($24b0): 7a26999b madExcept32.dll madExceptDbg 1773 GetMemCallback 006973f0 Posserver.exe System 4966 @GetMem 0069c5fa Posserver.exe System 26079 @NewUnicodeString 0069c83b Posserver.exe System 26693 @UStrFromPWCharLen 0069d93e Posserver.exe System 32005 @UStrCopy 00ec5dc6 Posserver.exe DEFSa 2399 LOADTRANSLATIONS 00ec5e59 Posserver.exe DEFSa 2408 LOADTRANSLATIONS 00ec5e98 Posserver.exe DEFSa 2413 LOADTRANSLATIONS 00eaa910 Posserver.exe Unitmain 678 TMain.FormCreate 00eaacff Posserver.exe Unitmain 740 TMain.FormCreate 009134d5 Posserver.exe Vcl.Forms 5534 TCustomForm.DoCreate 00912ff4 Posserver.exe Vcl.Forms 5401 TCustomForm.AfterConstruction 0069ae25 Posserver.exe System 19736 @AfterConstruction 00912fb0 Posserver.exe Vcl.Forms 5391 TCustomForm.Create 00920a12 Posserver.exe Vcl.Forms 13527 TApplication.CreateForm 00ee3510 Posserver.exe Posserver 132 initialization 7649fcc7 KERNEL32.DLL BaseThreadInitThunk It end with GetMem as it should, but include GetMemCallBack which is the hook for madexcept, and i am not familiar with madexcept, but i think the reasonable action is to strip the hook. In any case the log is nice, Later it lose control, as all these stack traces should be ended with either GetMem or ReallocMem, and be deleted form record later when FreeMem being called on the same address, Yet in the middle of that log, we see it start to count two or three GetMem before stopping, in the end of the log file ( the most later entries) it looks like it hit hard point to continue and stop This one from the middle 7a26999b madExcept32.dll madExceptDbg 1773 GetMemCallback 006973f0 Posserver.exe System 4966 @GetMem <----------- 0069c5fa Posserver.exe System 26079 @NewUnicodeString 0069c83b Posserver.exe System 26693 @UStrFromPWCharLen 0069c912 Posserver.exe System 26870 InternalUStrFromPCharLen 006973f0 Posserver.exe System 4966 @GetMem <----------- 0069c5fa Posserver.exe System 26079 @NewUnicodeString 0069d6af Posserver.exe System 31391 @UStrSetLength 006f2771 Posserver.exe System.SysUtils 8486 _IntToStr32 006f2aa8 Posserver.exe System.SysUtils 8601 IntToStr 006f52f8 Posserver.exe System.SysUtils 13425 WideFormatBuf 006f584b Posserver.exe System.SysUtils 13565 WideFormatBuf 006a3437 Posserver.exe System 41854 LocaleCharsFromUnicode 006983f7 Posserver.exe System 11904 TextOut 0069c5fa Posserver.exe System 26079 @NewUnicodeString 00ea26a4 Posserver.exe http 3486 TTCPHttpThrd.ProcessHttpRequest 006f49a0 Posserver.exe System.SysUtils 12905 FormatBuf 006f4981 Posserver.exe System.SysUtils 12898 FormatBuf 006f6f9f Posserver.exe System.SysUtils 20007 AppendNumber 006f6f41 Posserver.exe System.SysUtils 19991 AppendChars 006f7b98 Posserver.exe System.SysUtils 20444 AppendFormat 006f7c31 Posserver.exe System.SysUtils 20449 DateTimeToString 006f7d67 Posserver.exe System.SysUtils 20460 DateTimeToString 006973f0 Posserver.exe System 4966 @GetMem <----------- 00e94450 Posserver.exe http 1155 TTCPHttpThrd.ProcessHttpRequest 00e805f0 Posserver.exe http 622 TTCPHttpThrd.Execute 007505a1 Posserver.exe madExcept CallThreadProcSafe 00750606 Posserver.exe madExcept ThreadExceptFrame 006f6943 Posserver.exe System.SysUtils 19661 TryEncodeTime 006f697e Posserver.exe System.SysUtils 19668 EncodeTime 006f6e1b Posserver.exe System.SysUtils 19871 Now 006f7dd3 Posserver.exe System.SysUtils 20518 FormatDateTime 00e945b0 Posserver.exe http 1174 TTCPHttpThrd.ProcessHttpRequest 00e945ef Posserver.exe http 1174 TTCPHttpThrd.ProcessHttpRequest 00ea26a4 Posserver.exe http 3486 TTCPHttpThrd.ProcessHttpRequest 00e805f0 Posserver.exe http 622 TTCPHttpThrd.Execute 00e80a16 Posserver.exe http 673 TTCPHttpThrd.Execute 007506bb Posserver.exe madExcept HookedTThreadExecute 00750726 Posserver.exe madExcept HookedTThreadExecute 007dd4d9 Posserver.exe System.Classes 16396 ThreadProc 007505a1 Posserver.exe madExcept CallThreadProcSafe 00750606 Posserver.exe madExcept ThreadExceptFrame 0075067c Posserver.exe madExcept ThreadExceptFrame 007506bb Posserver.exe madExcept HookedTThreadExecute 00750726 Posserver.exe madExcept HookedTThreadExecute 006973f0 Posserver.exe System 4966 @GetMem <----------- 0069c5fa Posserver.exe System 26079 @NewUnicodeString 0069d6af Posserver.exe System 31391 @UStrSetLength 00701456 Posserver.exe System.SysUtils 30732 TStringHelper.Create 006f7d18 Posserver.exe System.SysUtils 20459 DateTimeToString 006f7d67 Posserver.exe System.SysUtils 20460 DateTimeToString 006973f0 Posserver.exe System 4966 @GetMem <----------- shoudl stopped here 00e94450 Posserver.exe http 1155 TTCPHttpThrd.ProcessHttpRequest 00e805f0 Posserver.exe http 622 TTCPHttpThrd.Execute 007505a1 Posserver.exe madExcept CallThreadProcSafe 00750606 Posserver.exe madExcept ThreadExceptFrame 00eac77b Posserver.exe misc 262 html2sg 00e98c33 Posserver.exe http 1981 TTCPHttpThrd.ProcessHttpRequest 00e805f0 Posserver.exe http 622 TTCPHttpThrd.Execute 007506bb Posserver.exe madExcept HookedTThreadExecute 007dd4d9 Posserver.exe System.Classes 16396 ThreadProc 0069c548 Posserver.exe System 25850 ThreadWrapper 007505a1 Posserver.exe madExcept CallThreadProcSafe 00750606 Posserver.exe madExcept ThreadExceptFrame 7649fcc7 KERNEL32.DLL BaseThreadInitThunk Now that make sense at least from me.
-
Not exactly confused as much it is catching the temporary string, see the common thing between these worrying lines is the temp string, Copy will generate temp string, like the concatenation with "+", to confirm this extract these into their own declared string var then put that var in-place to see if the report change. That is little problem, the problem i am afraid of is the unreadable and none sense stack trace, take as example TryEncodeTime i mentioned earlier, it is low level and has should not raise exception, also it is end point, meaning it should never ever seen at a stack unless it raised an exception or in this very case and because we (madexcept) are tracking memory allocation, it should be ended with the real memory allocation, that is not what reported, as madexcept call trace shows it passed ProcessHttpRequest, this makes no sense, pointing that the call trace (stack) is wrong and not trust worthy, madexcept failed to build clean stack trace. There is also a temp string introduced by compiler every time you use or pass different string type, like concatenation a Ansistring with different string type, so it could be "thisip" is declared an Ansi on newer Delphi while pos will force the compiler to do the temp conversion.. Also TryEncodeTime is allocating temp string to pass it as result (out to be exact and not result), so it really could like the first lines i wrote the cause is failure to handle tempstring that compiler is generating behind the scene. Anyway, these all may be false positive as you asked, but the shuffled stack makes me afraid from sinister behavior coming form madexcept, is this is missed up and broken then what else ?! Didn't mention what Delphi you are using and if madexcept is up to date, and i really think it is miss configuration in madexcept or a bug, but has little to do with Delphi, unless you are using Delphi version that is not supported by your madexcept.
-
Hi, They doesn't look like that, looks innocent. What is really strange and make no sense at all is the log you attached, take an example this one thread $34f0 (TTCPHttpThrd): 7a26999b madExcept32.dll madExceptDbg 1773 GetMemCallback 006973f0 Posserver.exe System 4966 @GetMem 0069c5fa Posserver.exe System 26079 @NewUnicodeString 0069c83b Posserver.exe System 26693 @UStrFromPWCharLen 0069c912 Posserver.exe System 26870 InternalUStrFromPCharLen 006973f0 Posserver.exe System 4966 @GetMem 0069c5fa Posserver.exe System 26079 @NewUnicodeString 0069d6af Posserver.exe System 31391 @UStrSetLength 006f2771 Posserver.exe System.SysUtils 8486 _IntToStr32 006f2aa8 Posserver.exe System.SysUtils 8601 IntToStr 006f52f8 Posserver.exe System.SysUtils 13425 WideFormatBuf 006f584b Posserver.exe System.SysUtils 13565 WideFormatBuf 006a3437 Posserver.exe System 41854 LocaleCharsFromUnicode 006983f7 Posserver.exe System 11904 TextOut 0069c5fa Posserver.exe System 26079 @NewUnicodeString 00ea26a4 Posserver.exe http 3486 TTCPHttpThrd.ProcessHttpRequest 006f49a0 Posserver.exe System.SysUtils 12905 FormatBuf 006f4981 Posserver.exe System.SysUtils 12898 FormatBuf 006f6f9f Posserver.exe System.SysUtils 20007 AppendNumber 006f6f41 Posserver.exe System.SysUtils 19991 AppendChars 006f7b98 Posserver.exe System.SysUtils 20444 AppendFormat 006f7c31 Posserver.exe System.SysUtils 20449 DateTimeToString 006f7d67 Posserver.exe System.SysUtils 20460 DateTimeToString 006973f0 Posserver.exe System 4966 @GetMem 00e94450 Posserver.exe http 1155 TTCPHttpThrd.ProcessHttpRequest 00e805f0 Posserver.exe http 622 TTCPHttpThrd.Execute 007505a1 Posserver.exe madExcept CallThreadProcSafe 00750606 Posserver.exe madExcept ThreadExceptFrame 006f6943 Posserver.exe System.SysUtils 19661 TryEncodeTime <------ 006f697e Posserver.exe System.SysUtils 19668 EncodeTime 006f6e1b Posserver.exe System.SysUtils 19871 Now 006f7dd3 Posserver.exe System.SysUtils 20518 FormatDateTime 00e945b0 Posserver.exe http 1174 TTCPHttpThrd.ProcessHttpRequest 00e945ef Posserver.exe http 1174 TTCPHttpThrd.ProcessHttpRequest 00ea26a4 Posserver.exe http 3486 TTCPHttpThrd.ProcessHttpRequest 00e805f0 Posserver.exe http 622 TTCPHttpThrd.Execute 00e80a16 Posserver.exe http 673 TTCPHttpThrd.Execute 007506bb Posserver.exe madExcept HookedTThreadExecute 00750726 Posserver.exe madExcept HookedTThreadExecute 007dd4d9 Posserver.exe System.Classes 16396 ThreadProc 007505a1 Posserver.exe madExcept CallThreadProcSafe 00750606 Posserver.exe madExcept ThreadExceptFrame 0075067c Posserver.exe madExcept ThreadExceptFrame 007506bb Posserver.exe madExcept HookedTThreadExecute 00750726 Posserver.exe madExcept HookedTThreadExecute 006973f0 Posserver.exe System 4966 @GetMem 0069c5fa Posserver.exe System 26079 @NewUnicodeString 0069d6af Posserver.exe System 31391 @UStrSetLength 00701456 Posserver.exe System.SysUtils 30732 TStringHelper.Create 006f7d18 Posserver.exe System.SysUtils 20459 DateTimeToString 006f7d67 Posserver.exe System.SysUtils 20460 DateTimeToString 006973f0 Posserver.exe System 4966 @GetMem 00e94450 Posserver.exe http 1155 TTCPHttpThrd.ProcessHttpRequest 00e805f0 Posserver.exe http 622 TTCPHttpThrd.Execute 007505a1 Posserver.exe madExcept CallThreadProcSafe 00750606 Posserver.exe madExcept ThreadExceptFrame 00eac77b Posserver.exe misc 262 html2sg <------ 00e98c33 Posserver.exe http 1981 TTCPHttpThrd.ProcessHttpRequest 00e805f0 Posserver.exe http 622 TTCPHttpThrd.Execute 007506bb Posserver.exe madExcept HookedTThreadExecute 007dd4d9 Posserver.exe System.Classes 16396 ThreadProc 0069c548 Posserver.exe System 25850 ThreadWrapper 007505a1 Posserver.exe madExcept CallThreadProcSafe 00750606 Posserver.exe madExcept ThreadExceptFrame 7649fcc7 KERNEL32.DLL BaseThreadInitThunk What do we see ? TTCPHttpThrd.ProcessHttpRequest behave like recursive !! but no it is not recursive, yet walking the call stack is illogical, html2sg does raise an exception ? or it doesn't ?, the exception most likely is handled inside try..except..end clause, yet two calls after that come from madexcept then the stack point to TTCPHttpThrd.Execute, that is unexplainable Also TryEncodeTime is raising an exception !? or not ? No need to answer the above, as the log might be wrong. I am not expert with madexcept, but i want to point that you might be miss configured it and caused this reports, so if you asked it to capture handled exception then it might be the cause, but i am not sure. As suggestion, start with the simplest thing which is make sure to pass strings as const in these two function ProcessHttpRequest(const Request, uri, protocol, params: string; var keepalive: boolean; var nosettype, linkclose: boolean): integer; procedure debug(const s: string); VAR I: integer; begin if (debughook <> 0) OR inparams('Z', I) then begin writeln(F1, s); flush(F1); end; In case your code failed to compile then just add local strings and load the content form the parameters, this easily could be the solution for the above unexplained madexcept log. Suggestion : Fix the declaration to const and try to change/tweak madexcept behavior then capture a new log then share, in case the problem persist. and Good luck!
-
EdgeAudio: real-time audio pipeline for Delphi/VCL with WebView2
Kas Ob. replied to Maxidonkey's topic in I made this
I see it now, NavigateToString doesn't have an origin, hence doesn't have SecurityContext, and no SecurityContext means no media access as these are protected. Thank you and good luck ! -
TSslCertTools for generate CSR
Kas Ob. replied to Eric Winfly's topic in ICS - Internet Component Suite
May i ask what is the problem with using RSA_public_encrypt directly instead of this unknown EncryptPublicRSA, which might be wrong in its parameters. Try to use RSA_private_encrypt directly, just check the return value, as it is not a Boolean, and the size/length is per documentation is RSA_size(rsa), and don't forget to trim, as these functions be called with extra length and the result is the exact length. From OverbyteIcsLIBEAY.pas RSA_private_decrypt : function(flen: Integer; from: PAnsiChar; to_: PAnsiChar; rsa: PRSA; padding: Integer): Integer; cdecl = nil; RSA_public_encrypt : function(flen: Integer; from: PAnsiChar; to_: PAnsiChar; rsa: PRSA; padding: Integer): Integer; cdecl = nil; @Angus Robertson While the above two functions should be what OP is asking for, this unit misses the other pair RSA_private_encrypt : function(flen: Integer; from: PAnsiChar; to_: PAnsiChar; rsa: PRSA; padding: Integer): Integer; cdecl = nil; RSA_public_decrypt : function(flen: Integer; from: PAnsiChar; to_: PAnsiChar; rsa: PRSA; padding: Integer): Integer; cdecl = nil; Sources https://docs.openssl.org/1.0.2/man3/RSA_public_encrypt/ https://docs.openssl.org/1.0.2/man3/RSA_private_encrypt/ -
This is strange ! The lack of Server Name explain some of it but not all, so 1) Your server is configure to not accept default web server or redirect from HTTP to HTTPS (it might be though but in this case it was HTTPS), the connection came with connecting to an IP and a redirect is due to host name (default one) that can server, but in this case Amazon was performing some sort of IP scanning to reverse IP to host lookup (collecting data), like hit in the dark to get the real WebServer. 2) Did the client provided client certificate and the log missed handling or missed logging it ? there is no mention for such certificate in these log lines, and the question is "why?" and "what?" did the server tried to validate and didn't find a CA for it, was it an IP ? Just my thoughts on this two logged lines.
-
EdgeAudio: real-time audio pipeline for Delphi/VCL with WebView2
Kas Ob. replied to Maxidonkey's topic in I made this
Hi, Thank you for sharing, though can't compile this project or test as don't have Delphi 12 and never used Edge, but seeing this in the readme Trigger me to ask and may be point you to a path you didn't know of, or you tried, in case you already tried or researched, then please share with us your result, i myself very interested in your findings. 1) Edge does support WebRTC, WebRTC has Acoustic Echo Cancellation (AEC), and it does work fine, removing the the need to block capture when playing, though switching media from EdgeAudio to WebRTC might not be a small adjustment and not by any mean a trivial task, yet small part is feasible, like Audio Capture and Playback, what is your experience on that? have you tried it ? in case of yes then why ditched it ? What issues did you face with WebRTC audio capture and play? 2) CORS is pain in the back, that we know, but what about injecting/loading the app directly without the need to navigate after the navigation to empty page, or... there is other means like there is "NavigateToString" https://learn.microsoft.com/en-us/microsoft-edge/webview2/reference/win32/icorewebview2?view=webview2-1.0.2210.55#navigatetostring At these lines https://github.com/MaxiDonkey/EdgeAudio/blob/main/source/Edge.Audio.pas#L596-L602 i see virtualhostfolder is set yet it followed by Navigate, i expected to be followed by NavigateToString This one allow to load the content from memory removing the virtual host need, have you tried it ? ( i mean feed all the content from memory, even if they are files on disk) can JSBridge (the really nice and impressive bridge you made) be used with it ? will it simplify the structure in whole? in case of it didn't work then please share with us the "Why?" (your finding about feeding the data/content from memory) What issues did you face ? -
For me that looks tightly coupled and hard to maintain in the long run, and i am always against such approach "REPLACE CONTROLLER...", if you need to replace then it is too late either get the correct one form the beginning or create new one and dispose them both later, swapping/replacing only will lead to complex design with high error/malfunctioning probability (if not now then modifying the code later). Lars gave a great example, but i would do it a little different, by slicing things into pieces. Look at Lars example, 1) a Factory will be perfect to return an IDeviceController from TSignature (the HardwareID) 2) Devices could have their own units and will register them self if the Unit is included in the project, (Initialization clause) 3) Factory will parse and return from what available (runtime registered) IDevices/IDeviceController ... 4) the Verbs (command/capabilities) could be an interface, each one is an interface, so a device could have 10 interfaces (more or less), each represent small functionality, like IDeviceCapName which will handle the device.. well ..name, IDeviceCapWrite, IDeviceCapRead.... so the the returned Interface cab tested/checked against a specific command/verb by simply call Supports() or with "is" or "as" ... , so when it comes to execute command a simple call like Supports to check if the device can return IDeviceCapOnlineTime then perform the required call on that .. 5) With separated and isolated commands/verbs like that, it is easier to accompany them with extra attached interface that will bring what type of hardware steps or code should be performed, in other words you can have script like (even it is code) in default interfaces specific for each device, so i device like IDeviceDoorController can have IDeviceDoorControllerCloseAndLock and IDeviceDoorControllerUnLock ...IDeviceDoorControllerOpenFroAll.. which are returned by it own smaller factory from the DoorController unit which is also registered and returned by IDeviceDoorController. I am sure i missed many steps here, but i hope the idea is clear to at least entertain, this will be expandable easy to read and maintain, and most importantly (importanter) it is testable, in fact it is the easiest way to develop for such hardware design, were each can have their own commands.
![Delphi-PRAXiS [en]](https://en.delphipraxis.net/uploads/monthly_2018_12/logo.png.be76d93fcd709295cb24de51900e5888.png)