Skip to content

Error 87 in WriteProcessMemory - Windows XP 32 bit #1

Description

@ah-jar

Running the injection on Windows 10 64-bit worked without problem, but running it on a Windows XP 32-bit the line:
WriteProcessMemory(process, (PVOID)((loaderdata*)LoaderMemory + 1), LibraryLoader, LoaderCodeSize, NULL);
returned error 87 (ERROR_INVALID_PARAMETER).

The error was solved by changing the LoaderCodeSize parameter of the above mentioned line to:
ntHeaders->OptionalHeader.SizeOfHeapCommit - sizeof(loaderdata)
Now it works as expected on both systems.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions