Mercurial > projects > ddbg_continued
comparison udis86-1.4/tests/gen.c @ 1:4a9dcbd9e54f
-files of 0.13 beta
-fixes so that it now compiles with the current dmd version
author | marton@basel.hu |
---|---|
date | Tue, 05 Apr 2011 20:44:01 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
0:586e4a649642 | 1:4a9dcbd9e54f |
---|---|
1 #include <stdio.h> | |
2 #include <udis86.h> | |
3 | |
4 #ifdef _WIN32 | |
5 # include <io.h> | |
6 # include <fcntl.h> | |
7 #endif | |
8 | |
9 /* help string */ | |
10 int main(int argc, char **argv) | |
11 { | |
12 ud_t ud_obj; | |
13 | |
14 #ifdef _WIN32 | |
15 _setmode(_fileno(stdin), _O_BINARY); | |
16 #endif | |
17 | |
18 ud_init(&ud_obj); | |
19 ud_set_input_file(&ud_obj, stdin); | |
20 | |
21 if (strcmp(argv[1],"-16") == 0) | |
22 ud_set_mode(&ud_obj, 16); | |
23 else if (strcmp(argv[1],"-32") == 0) | |
24 ud_set_mode(&ud_obj, 32); | |
25 else if (strcmp(argv[1],"-64") == 0) | |
26 ud_set_mode(&ud_obj, 64); | |
27 | |
28 ud_set_syntax(&ud_obj, UD_SYN_INTEL); | |
29 | |
30 while (ud_disassemble(&ud_obj)) | |
31 printf("\t%s\n", ud_insn_asm(&ud_obj)); | |
32 } |