Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extended offset accepted range of _EPROCESS from 0x400 to 0x600. #10

Merged
merged 2 commits into from
Apr 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CapcomLoader.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ static std::wstring Cl_GetDriverPath()

static NTSTATUS Cl_RemoveSimilarDrivers( BYTE* Driver )
{
namespace fs = std::experimental::filesystem;
namespace fs = std::filesystem;

std::wstring DriverPath = Cl_GetDriverPath();

Expand Down
4 changes: 2 additions & 2 deletions MemoryController.h
Original file line number Diff line number Diff line change
Expand Up @@ -433,13 +433,13 @@ static MemoryController Mc_InitContext( CapcomContext** CpCtxReuse = 0, KernelCo
uint64_t Pid = k_PsGetProcessId( Controller.CurrentEProcess );

uint32_t PidOffset = *( uint32_t* ) ( ( PUCHAR ) k_PsGetProcessId + 3 );
if ( PidOffset < 0x400 && *( uint64_t* ) ( Controller.CurrentEProcess + PidOffset ) == Pid )
if ( PidOffset < 0x600 && *( uint64_t* ) ( Controller.CurrentEProcess + PidOffset ) == Pid )
{
Controller.UniqueProcessIdOffset = PidOffset;
Controller.ActiveProcessLinksOffset = Controller.UniqueProcessIdOffset + 0x8;
}

for ( int i = 0; i < 0x400; i += 0x8 )
for ( int i = 0; i < 0x600; i += 0x8 )
{
uint64_t* Ptr = (uint64_t*)(Controller.CurrentEProcess + i);
if ( !Controller.UniqueProcessIdOffset && Ptr[ 0 ] & 0xFFFFFFFF == Pid && ( Ptr[ 1 ] > 0xffff800000000000 ) && ( Ptr[ 2 ] > 0xffff800000000000 ) && ( ( Ptr[ 1 ] & 0xF ) == ( Ptr[ 2 ] & 0xF ) ) )
Expand Down