As we know, if you start MzBot before you start your UCE, the UCE will screw up. However, there’s a fix to this. I am actually surprised that no body came up with it.
Look for the handler of IOCTL_CE_INITIALIZE in DBKDrv.c, looks like this: (I formatted it a bit so it looks nice)
i=-25;//takes some longer to load now....
while (i=pinp->AddressOfWin32K) &&
((UINT_PTR)PossibleKeServiceDescriptorTableShow[i].ServiceTableAddressOfWin32K+pinp->SizeOfWin32K)) &&
((UINT_PTR)PossibleKeServiceDescriptorTableShow[i].ArgumentTable>=pinp->AddressOfWin32K) &&
((UINT_PTR)PossibleKeServiceDescriptorTableShow[i].ArgumentTableAddressOfWin32K+pinp->SizeOfWin32K)) &&
(PossibleKeServiceDescriptorTableShow[i].TableSizeAssociatedIrp.SystemBuffer=(UINT_PTR)KeServiceDescriptorTableShadow;
DbgPrint("KeServiceDescriptorTableShadow[0]=%p",&KeServiceDescriptorTableShadow[0]);
DbgPrint("KeServiceDescriptorTableShadow[1]=%p",&KeServiceDescriptorTableShadow[1]);
DbgPrint("KeServiceDescriptorTableShadow[2]=%p",&KeServiceDescriptorTableShadow[2]);
DbgPrint("KeServiceDescriptorTableShadow[3]=%p",&KeServiceDescriptorTableShadow[3]);
AddSystemServices();
break;
}
}
i++;
}
Then you replace it with:
if ( (ULONG) ((PSERVICE_DESCRIPTOR_TABLE) (((ULONG)KeServiceDescriptorTable)+0x40))->ServiceTable == (ULONG) KeServiceDescriptorTable->ServiceTable ) {
KeServiceDescriptorTableShadow = (PSERVICE_DESCRIPTOR_TABLE) (((ULONG)KeServiceDescriptorTable)+0x50);
ntStatus=STATUS_SUCCESS;
} else if ( (ULONG) ((PSERVICE_DESCRIPTOR_TABLE) (((ULONG)KeServiceDescriptorTable)+0x140))->ServiceTable == (ULONG) KeServiceDescriptorTable->ServiceTable ) {
KeServiceDescriptorTableShadow = (PSERVICE_DESCRIPTOR_TABLE) (((ULONG)KeServiceDescriptorTable)+0x150);
ntStatus=STATUS_SUCCESS;
} else if ( (ULONG) ((PSERVICE_DESCRIPTOR_TABLE) (((ULONG)KeServiceDescriptorTable)-0x40))->ServiceTable == (ULONG) KeServiceDescriptorTable->ServiceTable ) {
KeServiceDescriptorTableShadow = (PSERVICE_DESCRIPTOR_TABLE) (((ULONG)KeServiceDescriptorTable)-0x30);
ntStatus=STATUS_SUCCESS;
} else if ( (ULONG) ((PSERVICE_DESCRIPTOR_TABLE) (((ULONG)KeServiceDescriptorTable)-0x20))->ServiceTable == (ULONG) KeServiceDescriptorTable->ServiceTable ) {
KeServiceDescriptorTableShadow = (PSERVICE_DESCRIPTOR_TABLE) (((ULONG)KeServiceDescriptorTable)-0x10);
ntStatus=STATUS_SUCCESS;
}
if ( ntStatus == STATUS_SUCCESS ) {
*(UINT_PTR*)Irp->AssociatedIrp.SystemBuffer = (UINT_PTR)KeServiceDescriptorTableShadow;
AddSystemServices();
}
NOTE: I never tried this code before, but I am certain that it will work, if you met any problem, do reply to this post.
Posted by john0312
Posted by john0312
Posted by john0312 









