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

BlackBone copy memory #489

Open
WareaVenGeFul opened this issue May 6, 2022 · 1 comment
Open

BlackBone copy memory #489

WareaVenGeFul opened this issue May 6, 2022 · 1 comment

Comments

@WareaVenGeFul
Copy link

Is copy memory important for blackbone to do kernel mmap? `NTSTATUS VGCopyMemory( IN PCOPY_MEMORY pCopy )
{
NTSTATUS status = STATUS_SUCCESS;
PEPROCESS pProcess = NULL, pSourceProc = NULL, pTargetProc = NULL;
PVOID pSource = NULL, pTarget = NULL;

status = PsLookupProcessByProcessId( (HANDLE)pCopy->pid, &pProcess );

if (NT_SUCCESS( status ))
{
    SIZE_T bytes = 0;

    // Write
    if (pCopy->write != FALSE)
    {
        pSourceProc = PsGetCurrentProcess();
        pTargetProc = pProcess;
        pSource = (PVOID)pCopy->localbuf;
        pTarget = (PVOID)pCopy->targetPtr;
    }
    // Read
    else
    {
        pSourceProc = pProcess;
        pTargetProc = PsGetCurrentProcess();
        pSource = (PVOID)pCopy->targetPtr;
        pTarget = (PVOID)pCopy->localbuf;
    }

    status = MmCopyVirtualMemory( pSourceProc, pSource, pTargetProc, pTarget, pCopy->size, KernelMode, &bytes );
}
else
    DPRINT( "BlackBone: %s: PsLookupProcessByProcessId failed with status 0x%X\n", __FUNCTION__, status );

if (pProcess)
    ObDereferenceObject( pProcess );

return status;

}`

@coderstar1234
Copy link

some issue in the last condition in then the solve at a problem in pProcess in not accessed variable to solve in out the code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants