14-12-2010, 06:34 PM
(14-12-2010, 08:01 AM)latch Wrote: Indecently, I have some c code I wrote that I'd like you to look at because it acting wonky and I have not yet been able to find a solution. I got irritated and stepped back from it for a while. It is simple enough for me not to suffer that thing that we do where we can't, for the life of us, understand our own code after being away from it for too long. Heh, do you know what I'm typing about?Send it on over and give me a brief synopsis on what you are trying to accomplish and what your problem is. I would be more than happy to take a look at it. As far as the scratching your head at code that you have stepped away from....indeed. I have about 30 half written programs that on a few of them I forget what I was trying to accomplish at all. An example of one I remember but the method I was using is a little cloudy
Code:
void InstallRegistryHooks (void)
{
__asm
{
push eax
mov eax, CR0
and eax, 0FFFEFFFFh
mov CR0, eax
pop eax
}
Real_ZwCreateKey = (T_ZwCreateKey) InterlockedExchange((PLONG) &SYSTEMSERVICE(ZwCreateKey),
(LONG)Hook_ZwCreateKey);
Real_ZwOpenKey = (T_ZwOpenKey) InterlockedExchange((PLONG) &SYSTEMSERVICE(ZwOpenKey),
(LONG)Hook_ZwOpenKey);
Real_ZwEnumerateKey = (T_ZwEnumerateKey) InterlockedExchange((PLONG) &SYSTEMSERVICE(ZwEnumerateKey),
(LONG)Hook_ZwEnumerateKey);
__asm
{
push eax
mov eax, CR0
or eax, NOT 0FFFEFFFFh
mov CR0, eax
pop eax
}
return ;
}
/*
* Remove the hook
*/
void RemoveRegistryHooks (void)
{
__asm
{
push eax
mov eax, CR0
and eax, 0FFFEFFFFh
mov CR0, eax
pop eax
}
InterlockedExchange( (PLONG) &SYSTEMSERVICE(ZwCreateKey), (LONG) Real_ZwCreateKey);
InterlockedExchange( (PLONG) &SYSTEMSERVICE(ZwOpenKey), (LONG) Real_ZwOpenKey);
InterlockedExchange( (PLONG) &SYSTEMSERVICE(ZwEnumerateKey), (LONG) Real_ZwEnumerateKey);
__asm
{
push eax
mov eax, CR0
or eax, NOT 0FFFEFFFFh
mov CR0, eax
pop eax
}
}
Trolls are the last thing you need to be concerned with.
VCD Wrote:// Forever more, count and reply, bitch.