]> andersk Git - udis86.git/blob - tests/example.c
Use the public http URI to docbook.xsl.
[udis86.git] / tests / example.c
1 /*! \file tests/example.c
2  *
3  * \page Example Quick usage example
4  *
5  * The following code is an example of a program that interfaces 
6  * with libudis86 and uses the API to generate assembly language 
7  * output for 64-bit code, input from STDIN.
8  *
9  * \include tests/example.c
10  *
11  * To compile the program (using gcc):
12  * 
13  * \code $ gcc -ludis86 example.c -o example \endcode
14  */
15 #include <stdio.h>
16 #include <udis86.h>
17
18 int main()
19 {
20     ud_t ud_obj;
21
22     ud_init(&ud_obj);
23     ud_set_input_file(&ud_obj, stdin);
24     ud_set_mode(&ud_obj, 64);
25     ud_set_syntax(&ud_obj, UD_SYN_INTEL);
26
27     while (ud_disassemble(&ud_obj)) {
28         printf("\t%s\n", ud_insn_asm(&ud_obj));
29     }
30
31     return 0;
32 }
This page took 0.120243 seconds and 5 git commands to generate.