make all module code static
This commit is contained in:
parent
31baeb570f
commit
abc02059e3
|
@ -8,7 +8,7 @@
|
||||||
#include "AArch64InstPrinter.h"
|
#include "AArch64InstPrinter.h"
|
||||||
#include "mapping.h"
|
#include "mapping.h"
|
||||||
|
|
||||||
void init_arm64(cs_struct *ud)
|
static void init_arm64(cs_struct *ud)
|
||||||
{
|
{
|
||||||
MCRegisterInfo *mri = malloc(sizeof(*mri));
|
MCRegisterInfo *mri = malloc(sizeof(*mri));
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ void init_arm64(cs_struct *ud)
|
||||||
ud->post_printer = AArch64_post_printer;
|
ud->post_printer = AArch64_post_printer;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __attribute__ ((constructor)) __init_arm64__()
|
static void __attribute__ ((constructor)) __init_arm64__()
|
||||||
{
|
{
|
||||||
init_arch[CS_ARCH_ARM64] = init_arm64;
|
init_arch[CS_ARCH_ARM64] = init_arm64;
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include "ARMInstPrinter.h"
|
#include "ARMInstPrinter.h"
|
||||||
#include "mapping.h"
|
#include "mapping.h"
|
||||||
|
|
||||||
void init_arm(cs_struct *ud)
|
static void init_arm(cs_struct *ud)
|
||||||
{
|
{
|
||||||
MCRegisterInfo *mri = malloc(sizeof(*mri));
|
MCRegisterInfo *mri = malloc(sizeof(*mri));
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ void init_arm(cs_struct *ud)
|
||||||
ud->disasm = ARM_getInstruction;
|
ud->disasm = ARM_getInstruction;
|
||||||
}
|
}
|
||||||
|
|
||||||
cs_err option_arm(cs_struct *handle, cs_opt_type type, size_t value)
|
static cs_err option_arm(cs_struct *handle, cs_opt_type type, size_t value)
|
||||||
{
|
{
|
||||||
if (type == CS_OPT_MODE) {
|
if (type == CS_OPT_MODE) {
|
||||||
if (value & CS_MODE_THUMB)
|
if (value & CS_MODE_THUMB)
|
||||||
|
@ -40,7 +40,7 @@ cs_err option_arm(cs_struct *handle, cs_opt_type type, size_t value)
|
||||||
return CS_ERR_OK;
|
return CS_ERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __attribute__ ((constructor)) __init_arm__()
|
static void __attribute__ ((constructor)) __init_arm__()
|
||||||
{
|
{
|
||||||
init_arch[CS_ARCH_ARM] = init_arm;
|
init_arch[CS_ARCH_ARM] = init_arm;
|
||||||
option_arch[CS_ARCH_ARM] = option_arm;
|
option_arch[CS_ARCH_ARM] = option_arm;
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include "MipsInstPrinter.h"
|
#include "MipsInstPrinter.h"
|
||||||
#include "mapping.h"
|
#include "mapping.h"
|
||||||
|
|
||||||
void init_mips(cs_struct *ud)
|
static void init_mips(cs_struct *ud)
|
||||||
{
|
{
|
||||||
MCRegisterInfo *mri = malloc(sizeof(*mri));
|
MCRegisterInfo *mri = malloc(sizeof(*mri));
|
||||||
|
|
||||||
|
@ -26,7 +26,7 @@ void init_mips(cs_struct *ud)
|
||||||
ud->disasm = Mips64_getInstruction;
|
ud->disasm = Mips64_getInstruction;
|
||||||
}
|
}
|
||||||
|
|
||||||
cs_err option_mips(cs_struct *handle, cs_opt_type type, size_t value)
|
static cs_err option_mips(cs_struct *handle, cs_opt_type type, size_t value)
|
||||||
{
|
{
|
||||||
if (type == CS_OPT_MODE) {
|
if (type == CS_OPT_MODE) {
|
||||||
if (value & CS_MODE_32)
|
if (value & CS_MODE_32)
|
||||||
|
@ -39,7 +39,7 @@ cs_err option_mips(cs_struct *handle, cs_opt_type type, size_t value)
|
||||||
return CS_ERR_OK;
|
return CS_ERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __attribute__ ((constructor)) __init_mips__()
|
static void __attribute__ ((constructor)) __init_mips__()
|
||||||
{
|
{
|
||||||
init_arch[CS_ARCH_MIPS] = init_mips;
|
init_arch[CS_ARCH_MIPS] = init_mips;
|
||||||
option_arch[CS_ARCH_MIPS] = option_mips;
|
option_arch[CS_ARCH_MIPS] = option_mips;
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include "X86InstPrinter.h"
|
#include "X86InstPrinter.h"
|
||||||
#include "mapping.h"
|
#include "mapping.h"
|
||||||
|
|
||||||
void init_x86(cs_struct *ud)
|
static void init_x86(cs_struct *ud)
|
||||||
{
|
{
|
||||||
// by default, we use Intel syntax
|
// by default, we use Intel syntax
|
||||||
ud->printer = X86_Intel_printInst;
|
ud->printer = X86_Intel_printInst;
|
||||||
|
@ -20,7 +20,7 @@ void init_x86(cs_struct *ud)
|
||||||
ud->post_printer = X86_post_printer;
|
ud->post_printer = X86_post_printer;
|
||||||
}
|
}
|
||||||
|
|
||||||
cs_err option_x86(cs_struct *handle, cs_opt_type type, size_t value)
|
static cs_err option_x86(cs_struct *handle, cs_opt_type type, size_t value)
|
||||||
{
|
{
|
||||||
if (type == CS_OPT_SYNTAX) {
|
if (type == CS_OPT_SYNTAX) {
|
||||||
switch(value) {
|
switch(value) {
|
||||||
|
@ -41,7 +41,7 @@ cs_err option_x86(cs_struct *handle, cs_opt_type type, size_t value)
|
||||||
return CS_ERR_OK;
|
return CS_ERR_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void __attribute__ ((constructor)) __init_x86__()
|
static void __attribute__ ((constructor)) __init_x86__()
|
||||||
{
|
{
|
||||||
init_arch[CS_ARCH_X86] = init_x86;
|
init_arch[CS_ARCH_X86] = init_x86;
|
||||||
option_arch[CS_ARCH_X86] = option_x86;
|
option_arch[CS_ARCH_X86] = option_x86;
|
||||||
|
|
4
module.h
4
module.h
|
@ -1,8 +1,8 @@
|
||||||
/* Capstone Disassembler Engine */
|
/* Capstone Disassembler Engine */
|
||||||
/* By Dang Hoang Vu <danghvu@gmail.com> 2013 */
|
/* By Dang Hoang Vu <danghvu@gmail.com> 2013 */
|
||||||
|
|
||||||
#ifndef __MODULE_H__
|
#ifndef __CS_MODULE_H__
|
||||||
#define __MODULE_H__
|
#define __CS_MODULE_H__
|
||||||
|
|
||||||
#define MAX_ARCH 32
|
#define MAX_ARCH 32
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue