Skip to content

Trying any Function from ntdll.dll crashes without error message. #85

Description

@Hansbald

No matter what function I tried it always crashes without any error message.
It says the DLL got loaded fine, and the function loaded fine too, but when executed it just crashes.

My code for reading DLL into memory:
`HANDLE hFile = CreateFileA("C:\Windows\SysWOW64\ntdll.dll", GENERIC_READ, 0, 0,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
if (hFile == NULL) {
printf("Error opening file: %d", GetLastError());
return 0;
}
DWORD dwSize = GetFileSize(hFile, 0);
printf("Size: %d : %d\n", dwSize, GetLastError());

BYTE* buff = new BYTE[dwSize];
if (ReadFile(hFile, buff, dwSize, 0, 0) == FALSE) {
	printf("Error reading file: %d", GetLastError());
	return 0;
}`

Typedef for the function:
typedef NTSTATUS(__stdcall* tdNtTerminateProcess)(HANDLE ProcessHandle, NTSTATUS ExitStatus);

Thanks for the help :)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions