-
Notifications
You must be signed in to change notification settings - Fork 20
/
x86defs.h
680 lines (550 loc) · 15.8 KB
/
x86defs.h
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
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
/*
Headers for x86 emulator
Copyright (c) 2003-2022, Chris Eagle
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the Free
Software Foundation; either version 2 of the License, or (at your option)
any later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
more details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 59 Temple
Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef __X86DEFS_H
#define __X86DEFS_H
#ifndef __IDP__
#ifndef WIN32
#include <sys/types.h>
#else //WIN32
typedef unsigned char u_int8_t;
typedef unsigned short u_int16_t;
typedef unsigned int u_int32_t;
typedef int int32_t;
#endif //WIN32
// Use printf instead of msg when not using Ida
#define msg printf
#else //#ifdef __IDP__
#ifndef NO_OBSOLETE_FUNCS
#define NO_OBSOLETE_FUNCS
#endif
#ifndef USE_DANGEROUS_FUNCTIONS
#define USE_DANGEROUS_FUNCTIONS
#endif // USE_DANGEROUS_FUNCTIONS
#ifndef USE_STANDARD_FILE_FUNCTIONS
#define USE_STANDARD_FILE_FUNCTIONS
#endif
#ifndef __NT__
#define _strdup strdup
#endif
#define PLUGIN_NAME "x86emu"
#ifdef __QT__
#ifndef QT_NAMESPACE
#define QT_NAMESPACE QT
#endif
#endif
/*
#ifndef _MSC_VER
#ifndef USE_DANGEROUS_FUNCTIONS
#define USE_DANGEROUS_FUNCTIONS 1
#endif // USE_DANGEROUS_FUNCTIONS
#endif //_MSC_VER
#ifndef _MSC_VER
#ifndef USE_STANDARD_FILE_FUNCTIONS
#define USE_STANDARD_FILE_FUNCTIONS 1
#endif
#endif
*/
#include <pro.h>
#include <ida.hpp>
#include <idp.hpp>
#include <bytes.hpp>
#include <netnode.hpp>
typedef unsigned char u_int8_t;
typedef unsigned short u_int16_t;
typedef unsigned int u_int32_t;
typedef int int32_t;
#include "sdk_versions.h"
#ifdef __EA64__
#define EA_FMT "0x%016lx"
#else
#define EA_FMT "0x%08x"
#endif
//Some idasdk70 transition macros
#if IDA_SDK_VERSION >= 700
#define startEA start_ea
#define endEA end_ea
#define minEA min_ea
#define maxEA max_ea
#define ominEA omin_ea
#define omaxEA omax_ea
#define procName procname
#define get_flags_novalue(ea) get_flags(ea)
#define isEnum0(f) is_enum0(f)
#define isEnum1(f) is_enum1(f)
#define isStroff0(f) is_stroff0(f)
#define isStroff1(f) is_stroff1(f)
#define isOff0(f) is_off0(f)
#define isOff1(f) is_off1(f)
#define isOff(f, n) is_off(f, n)
#define isEnum(f, n) is_enum(f, n)
#define isStroff(f, n) is_stroff(f, n)
#define isUnknown(f) is_unknown(f)
#define getFlags(f) get_flags(f)
#define isStruct(f) is_struct(f)
#define isASCII(f) is_strlit(f)
#define do_unknown(a, f) del_items(a, f)
#define do_unknown_range(a, s, f) del_items(a, f, s)
#define isCode(f) is_code(f)
#define get_member_name2 get_member_name
#define put_many_bytes(a, b, s) put_bytes(a, b, s)
#define patch_many_bytes(a, b, s) patch_bytes(a, b, s)
#define get_many_bytes(a, b, s) get_bytes(b, s, a)
#define do_data_ex(a, d, s, t) create_data(a, d, s, t)
#define doDwrd(a, l) create_dword(a, l)
#define doStruct(a, l, t) create_struct(a, l, t)
#define dwrdflag dword_flag
#define isEnabled(a) is_mapped(a)
#define isLoaded(a) is_loaded(a)
#define switchto_tform(w, f) activate_widget(w, f)
#define find_tform(c) find_widget(c)
#define get_long(a) get_dword(a)
#define patch_long(a, v) patch_dword(a, v)
#define put_long(a, v) put_dword(a, v)
#define get_segreg(a, r) get_sreg(a, r)
#define set_default_segreg_value(s, r, v) set_default_sreg_value(s, r, v)
#define AskUsingForm_c ask_form
#define askbuttons_c ask_buttons
#define alt1st altfirst
#define altnxt altnext
#define sup1st supfirst
#define supnxt supnext
#else
#define start_ea startEA
#define end_ea endEA
#define min_ea minEA
#define max_ea maxEA
#define omin_ea ominEA
#define omax_ea omaxEA
#define procname procName
#define ev_add_cref add_cref
#define ev_add_dref add_dref
#define ev_del_cref del_cref
#define ev_del_dref del_dref
#define ev_oldfile oldfile
#define ev_newfile newfile
#define ev_auto_queue_empty auto_queue_empty
#define set_func_start func_setstart
#define set_func_end func_setend
#define get_dword(a) get_long(a)
#define patch_dword(a, v) patch_long(a, v)
#define put_dword(a, v) put_long(a, v)
#define get_sreg(a, r) get_segreg(a, r)
#define set_default_sreg_value(s, r, v) set_default_segreg_value(s, r, v)
#define altfirst alt1st
#define altnext altnxt
#define supfirst sup1st
#define supnext supnxt
#define get_bytes(b, s, a) get_many_bytes(a, b, s)
#define ask_form AskUsingForm_c
#define ask_buttons askbuttons_c
#endif
extern netnode x86emu_node;
extern netnode kernel_node;
#endif
union ll_union {
unsigned long long ll;
struct {
unsigned int low;
unsigned int high;
};
};
#define xCARRY 0x1
#define xPARITY 0x4
#define xAUX_CARRY 0x10
#define xZERO 0x40
#define xSIGN 0x80
#define xTRAP 0x100
#define xINTERRUPT 0x200
#define xDIRECTION 0x400
#define xOVERFLOW 0x800
#define xCF xCARRY
#define xPF xPARITY
#define xAF xAUX_CARRY
#define xZF xZERO
#define xSF xSIGN
#define xTF xTRAP
#define xIF xINTERRUPT
#define xDF xDIRECTION
#define xOF xOVERFLOW
#define RESERVED_FLAGS 0xFFC0802A
#define RING_3_FLAGS (xCF | xPF | xAF | xZF | xSF | xOF | xDF | xTF)
#define RING_0_FLAGS (0xFFFFFFFF & ~RESERVED_FLAGS)
#define xD (cpu.eflags & xDF)
#define SET(x) (cpu.eflags |= (x))
#define CLEAR(x) (cpu.eflags &= (~x))
#define xO (cpu.eflags & xOF)
#define xNO (!(cpu.eflags & xOF))
#define xB (cpu.eflags & xCF)
#define xC xB
#define xNAE xB
#define xNB (!(cpu.eflags & xCF))
#define xAE xNB
#define xNC xNB
#define xE (cpu.eflags & xZF)
#define xZ xE
#define xNE (!(cpu.eflags & xZF))
#define xNZ xNE
#define xBE (cpu.eflags & (xZF | xCF))
#define xNA xBE
#define xNBE (!(cpu.eflags & (xZF | xCF)))
#define xA xNBE
#define xS (cpu.eflags & xSF)
#define xNS (!(cpu.eflags & xSF))
#define xP (cpu.eflags & xPF)
#define xPE xP
#define xNP (!(cpu.eflags & xPF))
#define xPO xNP
#define xL (((cpu.eflags & (xSF | xOF)) == xSF) || \
((cpu.eflags & (xSF | xOF)) == xOF))
#define xNGE xL
#define xNL (((cpu.eflags & (xSF | xOF)) == 0) || \
((cpu.eflags & (xSF | xOF)) == (xSF | xOF)))
#define xGE xNL
#define xLE (((cpu.eflags & (xSF | xOF)) == xSF) || \
((cpu.eflags & (xSF | xOF)) == xOF) || xZ)
#define xNG xLE
#define xNLE ((((cpu.eflags & (xSF | xOF)) == 0) || \
((cpu.eflags & (xSF | xOF)) == (xSF | xOF))) && xNZ)
#define xG xNLE
#define H_MASK 0x0000FF00
#define EAX 0
#define ECX 1
#define EDX 2
#define EBX 3
#define ESP 4
#define EBP 5
#define ESI 6
#define EDI 7
#define EIP 8
#define EFLAGS 9
#define MIN_REG 0
#define MAX_REG 9
#define eax (cpu.general[EAX])
#define ecx (cpu.general[ECX])
#define edx (cpu.general[EDX])
#define ebx (cpu.general[EBX])
#define esp (cpu.general[ESP])
#define ebp (cpu.general[EBP])
#define esi (cpu.general[ESI])
#define edi (cpu.general[EDI])
#define CS 0
#define SS 1
#define DS 2
#define ES 3
#define FS 4
#define GS 5
#define _cs (cpu.segReg[CS])
#define _ss (cpu.segReg[SS])
#define _ds (cpu.segReg[DS])
#define _es (cpu.segReg[ES])
#define _fs (cpu.segReg[FS])
#define _gs (cpu.segReg[GS])
#define csBase (cpu.segBase[CS])
#define ssBase (cpu.segBase[SS])
#define dsBase (cpu.segBase[DS])
#define esBase (cpu.segBase[ES])
#define fsBase (cpu.segBase[FS]) //FS:[0] -> SEH for Win32
#define gsBase (cpu.segBase[GS])
#define CR0 0
#define CR1 1
#define CR2 2
#define CR3 3
#define CR4 4
#define cr0 (cpu.control[CR0])
#define cr1 (cpu.control[CR1])
#define cr2 (cpu.control[CR2])
#define cr3 (cpu.control[CR3])
#define cr4 (cpu.control[CR4])
#define DR0 0
#define DR1 1
#define DR2 2
#define DR3 3
#define DR4 4
#define DR5 5
#define DR6 6
#define DR7 7
#define dr0 (cpu.debug_regs[DR0])
#define dr1 (cpu.debug_regs[DR1])
#define dr2 (cpu.debug_regs[DR2])
#define dr3 (cpu.debug_regs[DR3])
#define dr4 (cpu.debug_regs[DR4])
#define dr5 (cpu.debug_regs[DR5])
#define dr6 (cpu.debug_regs[DR6])
#define dr7 (cpu.debug_regs[DR7])
#define MOD_0 0
#define MOD_1 0x40
#define MOD_2 0x80
#define MOD_3 0xC0
#define RM(x) ((x) & 0x07)
#define MOD(x) ((x) & 0xC0)
#define REG(x) (((x) >> 3) & 0x07)
#define HAS_SIB(x) (RM(x) == 4)
#define SCALE(x) (1 << ((x) >> 6))
#define INDEX(x) (((x) >> 3) & 0x07)
#define BASE(x) ((x) & 0x07)
#define PREFIX_LOCK 0x01
#define PREFIX_REPNE 0x02
#define PREFIX_REP 0x04
#define PREFIX_CS 0x08
#define PREFIX_SS 0x10
#define PREFIX_DS 0x20
#define PREFIX_ES 0x40
#define PREFIX_FS 0x80
#define PREFIX_GS 0x100
#define PREFIX_SIZE 0x200
#define PREFIX_ADDR 0x400
#define PREFIX_SIMD 0x800
#define SEG_MASK 0x1F8
//operand types
#define TYPE_REG 1
#define TYPE_IMM 2
#define TYPE_MEM 4
//operand sizes
#define SIZE_BYTE 1
#define SIZE_WORD 2
#define SIZE_DWORD 4
//FPU Flags
#define FPU_INVALID 0x1
#define FPU_DENORMALIZED 0x2
#define FPU_ZERODIVIDE 0x4
#define FPU_OVERFLOW 0x8
#define FPU_UNDERFLOW 0x10
#define FPU_PRECISION 0x20
#define FPU_STACKFAULT 0x40
#define FPU_ERRORSUMMARY 0x80
#define FPU_CONDITIONS 0x4700
#define FPU_C0 0x100
#define FPU_C1 0x200
#define FPU_C2 0x400
#define FPU_C3 0x4000
#define FPU_TOS 0x3800
#define FPU_BUSY 0x8000
#define FPU_SET(x) (fpu.status |= (x))
#define FPU_GET(x) (fpu.status & (x))
#define FPU_MASK_GET(x) (fpu.control & (x))
#define FPU_CLEAR(x) (fpu.status &= (~x))
#define FPU_TAG0 0x3
#define FPU_TAG1 0xC
#define FPU_TAG2 0x30
#define FPU_TAG3 0xC0
#define FPU_TAG4 0x300
#define FPU_TAG5 0xC00
#define FPU_TAG6 0x3000
#define FPU_TAG7 0xC000
#define FPU_ZERO_TAG 0
#define FPU_VALID_TAG 1
#define FPU_SPECIAL_TAG 2
#define FPU_EMPTY_TAG 3
/*
#define R0 0
#define R1 1
#define R2 2
#define R3 3
#define R4 4
#define R5 5
#define R6 6
#define R7 7
#define r0 (fpu.r[0])
#define r1 (fpu.r[1])
#define r2 (fpu.r[2])
#define r3 (fpu.r[3])
#define r4 (fpu.r[4])
#define r5 (fpu.r[5])
#define r6 (fpu.r[6])
#define r7 (fpu.r[7])
#define r(n) (fpu.r[n])
*/
#define fpuStackTop ((fpu.status >> 11) & 7)
void getSystemBaseTime(unsigned int *timeLow, unsigned int *timeHigh);
void getRandomBytes(void *buf, unsigned int len);
extern bool doTrace;
extern bool doTrack;
extern bool doLogLib;
extern bool doBreakOnSyscall;
extern bool doLogSyscalls;
extern unsigned int randVal;
#define INTx80_MAGIC 0xBABEF00D
#ifdef __IDP__
//if building an IDA plugin, then here are some defines
//OS kernel altvals
#define OS_MAX_FILES 1
#define OS_PAGE_SIZE 2
#define OS_STACK_TOP 10
#define OS_STACK_SIZE 11
#define OS_MIN_ADDR 12
#define OS_MAX_ADDR 13
#define OS_VMA_HIGH 14
#define OS_VMA_LOW 15
#define OS_VMA_GROWTH 16
#define OS_IDT_BASE 20
#define OS_IDT_LIMIT 21
#define OS_GDT_BASE 22
#define OS_GDT_LIMIT 23
#define OS_VMA_GROWS_UP 500
#define OS_VMA_GROWS_DOWN 501
#define OS_CUSTOM 2000
//Windows related values
#define WIN_MAX_FILES 256
#define WIN_PAGE_OFFSET 0x80000000
#define WIN_TASK_SIZE WIN_PAGE_OFFSET
#define WIN_TASK_SIZE_MAX WIN_TASK_SIZE
#define WIN_STACK_TOP 0x230000
#define WIN_STACK_TOP_MAX WIN_STACK_TOP
#define WIN_STACK_SIZE 0x200000
#define WIN_ALLOC_MIN WIN_STACK_TOP
#define WIN_PAGE_SIZE 0x1000
#define WIN_PAGE_MASK (WIN_PAGE_SIZE - 1)
#define WIN_IDT_BASE 0x80b95400
#define WIN_IDT_LIMIT 0x800 //actual is 0x7ff ??
#define WIN_GDT_BASE (WIN_IDT_BASE-0x400)
#define WIN_GDT_LIMIT 0x400 //actual is 0x3ff ??
//some windows specific altvals
#define OS_WINDOWS_PEB_BASE OS_CUSTOM
#define OS_WINDOWS_TEB_BASE (OS_CUSTOM+1)
//Linux related values
#define LINUX_MAX_FILES 256
#define LINUX_ALLOC_MIN 0x110000
#define LINUX_PAGE_OFFSET 0xC0000000
#define LINUX_VMA_TOP 0xb8000000
#define LINUX_TASK_SIZE LINUX_PAGE_OFFSET
#define LINUX_TASK_SIZE_MAX LINUX_TASK_SIZE
#define LINUX_STACK_TOP LINUX_TASK_SIZE
#define LINUX_STACK_TOP_MAX LINUX_STACK_TOP
#define LINUX_STACK_SIZE 0x8000000
#define LINUX_PAGE_SIZE 0x1000
#define LINUX_PAGE_MASK (LINUX_PAGE_SIZE - 1)
#define LINUX_IDT_BASE 0xC0951000
#define LINUX_IDT_LIMIT 0x800 //actual is 0x7ff ??
#define LINUX_GDT_BASE 0xC1800000
#define LINUX_GDT_LIMIT 0x100 //actual is 0xff ??
#define LINUX_PAGE_ALIGN(x) (((x) + LINUX_PAGE_MASK) & ~LINUX_PAGE_MASK)
#define LINUX_TASK_UNMAPPED_BASE (LINUX_PAGE_ALIGN(LINUX_TASK_SIZE / 3))
//some linux specific altvals
#define OS_LINUX_BRK OS_CUSTOM
#define CGC_ALLOC_MIN 0x110000
#define CGC_PAGE_OFFSET 0xC0000000
#define CGC_VMA_TOP 0xb8000000
#define CGC_TASK_SIZE CGC_PAGE_OFFSET
#define CGC_TASK_SIZE_MAX CGC_TASK_SIZE
#define CGC_STACK_TOP 0xBAAAB000
#define CGC_STACK_TOP_MAX CGC_STACK_TOP
#define CGC_STACK_SIZE 0x800000
#define CGC_MAGIC_PAGE 0x4347C000
#define CGC_PAGE_SIZE 0x1000
#define CGC_PAGE_MASK (CGC_PAGE_SIZE - 1)
#define CGC_IDT_BASE 0xC0951000
#define CGC_IDT_LIMIT 0x800 //actual is 0x7ff ??
#define CGC_GDT_BASE 0xC1800000
#define CGC_GDT_LIMIT 0x100 //actual is 0xff ??
#define CGC_PAGE_ALIGN(x) (((x) + CGC_PAGE_MASK) & ~CGC_PAGE_MASK)
#define CGC_TASK_UNMAPPED_BASE (CGC_PAGE_ALIGN(CGC_TASK_SIZE / 3))
//heap personality type values
#define LEGACY_HEAP 100
#define DLMALLOC_2_7_2_HEAP 101
#define JEMALLOC_HEAP 102
#define PHKMALLOC_HEAP 103
#define RTL_HEAP 104
#define PERS_NONE 0
#define PERS_WINDOWS_2k 1
#define PERS_WINDOWS_XP 5
#define PERS_WINDOWS_VISTA 10
#define PERS_WINDOWS_7 15
#define PERS_LINUX_26 100
#define PERS_FREEBSD_80 200
#define PERS_CGC_DECREE 300
extern unsigned int os_personality;
//various emulator related altval indicies
#define X86_EMU_INIT 1
#define HEAP_PERSONALITY 5
#define OS_PERSONALITY 6
#define CPU_PERSONALITY 7
#define X86_ORIG_MINEA 9
#define X86_MINEA 10
#define X86_MAXEA 11
#define X86_RANDVAL 12
#define SYSTEM_TIME_LOW 13
#define SYSTEM_TIME_HIGH 14
//this would be a kernel32 variable pointing into the heap
#define EMU_COMMAND_LINE 15
//various supvals
#define SYS_DLL_DIR 100
#define LAST_DIR 101
#endif
//callback type for function argument list generator
typedef void (*argcallback_t)(const char *func, const char *arg, int idx, void *user);
void getRandomBytes(void *buf, unsigned int len);
void traceLog(const char *format, ...);
void closeTrace();
void openTraceFile(const char *trace_file = NULL);
void setTitle();
void updateRegister(int r, unsigned int val);
void forceCode();
void codeCheck(void);
unsigned int parseNumber(char *numb);
void dumpRange();
bool isStringPointer(const char *type_str);
void skip();
void grabStackBlock();
void grabHeapBlock();
void grabMmapBlock();
void stepOne();
void syncDisplay();
void emuSyncDisplay();
void traceOne();
void run();
unsigned int *getRegisterPointer(int reg);
unsigned int getRegisterValue(int reg);
void setRegisterValue(int reg, unsigned int val);
void pushData();
void dumpRange(ea_t low, ea_t hi);
void dumpEmbededPE();
void switchThread(int tidx);
void destroyThread(int tidx);
void memLoadFile(unsigned int start);
void dumpHeap();
void doReset();
void jumpToCursor();
void runToCursor();
void setTracking(bool track);
bool getTracking();
void setTracing(bool trace);
bool getTracing();
void setLogLibrary(bool log);
bool logLibrary();
bool breakOnSyscall();
void setBreakOnSyscall(bool do_break);
bool logSyscalls();
void setLogSyscalls(bool log);
void tagImportAddressSavePoint();
void setBreakpoint();
void clearBreakpoint();
void generateMemoryException();
void doExportLookup();
void generateArgList(const char *func, argcallback_t cb, void *user);
void buildMainArgs();
void buildWinMainArgs();
void buildDllMainArgs();
void formatStack(unsigned int begin, unsigned int end);
void setBreakOnExceptions(bool doBreak);
bool loadLibrary();
#ifdef __NT__
#define DIR_SEP '\\'
#define aDIR_SEP "\\"
#else
#define DIR_SEP '/'
#define aDIR_SEP "/"
#endif
#endif