11 Mar
Posted by: Christian Wimmer in: JEDI Windows API Headers, JEDI Windows Security Code Lib
This article is about how to retrieve the owner of a file. If you are experienced with some of the WinAPI security function this can be pretty easy. There are some problems that needs to be addressed though. The first one is the size of the security items like the SID name of the owner. [...]
There is a lot of talking about the usage of FreeAndNil in destructors. I’ve never thought about it before so I used it quite often even in destructors. Although I don’t use it as a universal remedy function, it still seems to be a bad design: a thought shared by many leading Delphi experts. Thus [...]
I had some trouble with this rather complicated COM structure called ACTRL_ACCESS. So I post a diagram to show its design. Otherwise it would be a pity to leave it on my private hard drive.
20 Jul
Posted by: Christian Wimmer in: Common, JEDI Windows Security Code Lib
Some time ago, I was in the situation to set up a new computer with a Windows XP 64 CD. Well it doesn’t matter that it was 64bit. However, I always create a separate partitions for Windows XP. And because user profiles tend to get big, I moved a new user to a second partition. [...]
The following code is really simple. It restricts access to the current process. In this way no other process can open the process handle and for example terminate this process.
uses
JwaWindows,
JwsclSecureObjects,
JwsclDescriptor,
JwsclToken,
JwsclTypes,
JwsclAcl,
JwsclKnownSid;
var
SD : TJwSecurityDescriptor;
hProcess : TJwProcessHandle;
begin
JwInitWellKnownSIDs;
hProcess := OpenProcess(READ_CONTROL or WRITE_DAC, false, GetCurrentProcessId());
if hProcess <> 0 [...]
17 Jun
Posted by: NeutralGeneral in: JEDI Windows Security Code Lib, JWSCL Downloads
Calculating Binary Hashes using TJwFileStreamEx
Why should I use TJwFileStreamEx instead of any other common stream class from the VCL?
Well this question is quite easily answered.
The first thing is that TJwFileStreamEx is based on Memory Mapped Files (MMF). MMF might be the fastest way to access files on your hard disk. Another good reason for using [...]
25 May
Posted by: Christian Wimmer in: Downloads, JEDI Windows Security Code Lib
JWSCL provides access to auto pointers or objects. It means that allocated space or objects are automtically destroyed/freed as soon as the auto object runs out of scope. What is a scope? A scope exists as long as the (I say) parent object exists. Parent objects can be:
The process. The auto pointer and thus the [...]
23 May
Posted by: Christian Wimmer in: JEDI Windows Security Code Lib
This simple example shows how you can change the target session of a new process.
You cannot impersonate a pipe until you have read from it. Even a write call doesn’t work. So a service has to wait for a dummy client write call until it can check the client’s token.
The following codes shows how multi instance pipe server could look like. Be aware that I wrote this to show [...]
Creating a binary file that consists of a service and a normal application can be done very simple without using the service manager. Just check for SYSTEM account. It is very unlikely that your app is run as SYSTEM (only RunAsSys does ).
uses …, JwsclToken;
begin
if JwIsSystem then
begin
try
Application.Initialize;
Application.CreateForm(TMyService, [...]