mirror of
https://github.com/zodiacon/NativeApps
synced 2026-06-08 18:38:28 +00:00
27 lines
839 B
C++
27 lines
839 B
C++
|
|
#include <Windows.h>
|
|
#include <winternl.h>
|
|
|
|
extern "C" {
|
|
NTSTATUS NTAPI NtTerminateProcess(
|
|
_In_opt_ HANDLE ProcessHandle,
|
|
_In_ NTSTATUS ExitStatus);
|
|
NTSTATUS NTAPI NtDelayExecution(_In_ BOOLEAN Alertable, _In_opt_ PLARGE_INTEGER DelayInterval);
|
|
NTSTATUS NTAPI NtDrawText(_In_ PUNICODE_STRING Text);
|
|
}
|
|
|
|
#define NtCurrentProcess() ((HANDLE)(LONG_PTR)-1)
|
|
|
|
extern "C" void NTAPI NtProcessStartup(PPEB peb) {
|
|
PROCESS_BASIC_INFORMATION info;
|
|
NtQueryInformationProcess(NtCurrentProcess(), ProcessBasicInformation, &info, sizeof(info), nullptr);
|
|
UNICODE_STRING text;
|
|
RtlInitUnicodeString(&text, L"Hello, Native World!");
|
|
NtDrawText(&text);
|
|
|
|
LARGE_INTEGER interval;
|
|
interval.QuadPart = -10000 * 5000;
|
|
NtDelayExecution(FALSE, &interval);
|
|
NtTerminateProcess(NtCurrentProcess(), 0);
|
|
}
|