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 :)
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());
Typedef for the function:
typedef NTSTATUS(__stdcall* tdNtTerminateProcess)(HANDLE ProcessHandle, NTSTATUS ExitStatus);Thanks for the help :)