/usr/share/vala/vapi/r_asm.vapi is in radare2-vala 0.9.6-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 | namespace Radare {
/**
* Radare2 Assembler module
*/
[Compact]
[CCode (cheader_filename="r_asm.h", cname="RAsm", free_function="r_asm_free", cprefix="r_asm_")]
public class RAsm {
/**
* Architectures supported.
*/
[CCode (cprefix="R_ASM_ARCH_", cname="int")]
public enum Arch {
NONE,
X86,
ARM,
PPC,
M68K,
JAVA,
MIPS,
SPARC,
CSR,
MSIL,
OBJD,
BF,
SH,
Z80,
I8080,
ARC
}
/**
* The supported assembler syntax variations.
*/
[CCode (cprefix="R_ASM_SYNTAX_", cname="int")]
public enum Syntax {
NONE,
INTEL,
ATT
}
/**
* The different types of fields in opcodes.
*/
[CCode (cprefix="R_ASM_MOD_", cname="int")]
public enum Mod {
/**
* A raw value, like 6DEF20h in {{{ mov eax, 6DEF20h }}}
*/
RAWVALUE,
/**
* A literal value, as in {{{ push -1 }}}
*/
VALUE,
/**
* The destination register. EBP in {{{ MOV EBP, ESP }}}
*/
DSTREG,
/**
* The first source register. EBX in {{{ SUB EDX, EBX }}}
*/
SRCREG0,
/**
* The second source register, for example in {{{ PUSHA AX, CX, DX }}}
*/
SRCREG1,
/**
* The third source register.
*/
SRCREG2
}
/**
* Represents assembly opcodes.
*/
[CCode (cname="RAsmOp", destroy_function="", unref_function="")]
public struct Op {
/**
* The instruction length.
*/
public int inst_len;
/**
* The instruction payload.
*/
public int payload;
public uint8 buf[1024]; // FIXME proper static buffers w/o hardcoded size
/**
* The assembly representation.
*/
public char buf_asm[1024]; // FIXME proper static strings w/o hardcoded size
/**
* The hexadecimal representation.
*/
public char buf_hex[1024]; // FIXME proper static strings w/o hardcoded size
public char buf_err[1024]; // FIXME proper static strings w/o hardcoded size
// accessors for bindings
/**
* Retrieves the hexadecimal representation of the instruction.
* @return the actual opcode, in hexadecimal.
*/
public string get_hex();
/**
* Retrieves the assembly representation of the instruction.
* @return such representation.
*/
public string get_asm();
}
/**
* Models decompiled assembly code.
*/
[CCode (cname="RAsmCode", cprefix="r_asm_code_", free_function="r_asm_code_free", unref_function="r_asm_code_free")]
public class Code {
/**
* The code length.
*/
public int len;
public uint8* buf;
/**
* The hexadecimal representation of the dissasembled code.
*/
public string buf_hex;
/**
* The assembly representation of the dissasembled code.
*/
public string buf_asm;
/**
* Replaces all occurrences of a code fragment with another text, usually
* to enhance readability.
* @param key the code to replace.
* @param val the replacement value.
* @return the number of replacements made.
*/
// public int set_equ (<RAsmCode> code, string key, string val);
//public int equ_replace (string key);
//public void* free();
}
/**
* The bit size.
*/
public int bits;
/**
* Whether it's assuming big endian or little endian.
* See [[http://en.wikipedia.org/wiki/Endianness]]
*/
public bool big_endian;
/**
* The syntax.
*/
public int syntax;
public uint64 pc;
/**
* The list of active plugins.
*/
public RList<RAsm.Plugin> plugins;
public RAsm();
public bool use(string name);
public bool set_bits(int bits);
public bool set_syntax(Syntax syntax);
public bool set_pc(uint64 addr);
public bool set_big_endian(bool big);
// TODO: Use Code? instead of op??
public int disassemble(out Op op, uint8* buf, int length);
public int assemble(out Op op, string buf);
public Code? mdisassemble(uint8 *buf, int length);
public Code? mdisassemble_hexstr(string hexstr);
public Code? massemble(string buf);
public Code? assemble_file(string file);
public bool filter_input(string filter);
public bool filter_output(string filter);
/* TODO: not directy defined here */
public void free();
/**
* Represents Radare2 assembly plugins.
*/
[Compact]
[CCode (cname="RAsmPlugin", destroy_function="", free_function="")]
public class Plugin {
/**
* The plugin name.
*/
public string name;
/**
* The architecture the plugin supports.
*/
public string arch;
/**
* The plugin description.
*/
public string desc;
/**
* Supported bit sizes.
* Warning, future releases will probably use a bitmask approach instead.
*/
[CCode (array_length = false)]
public int[] bits;
/**
* The callback to be notified when the code is modified.
*/
// public RAsmModifyCallback modify;
}
}
}
|