diff --git a/Bindings/C/VXDisassemblerUtilsC.h b/Bindings/C/VXDisassemblerUtilsC.h index ffc1210..9ab74ca 100644 --- a/Bindings/C/VXDisassemblerUtilsC.h +++ b/Bindings/C/VXDisassemblerUtilsC.h @@ -33,8 +33,11 @@ #ifndef _VDE_VXDISASSEMBLERUTILSC_H_ #define _VDE_VXDISASSEMBLERUTILSC_H_ -#include #include "VXDisassemblerTypesC.h" +#include "VXInternalConfig.h" + +#include + #ifdef __cplusplus extern "C" @@ -53,7 +56,9 @@ typedef struct _VXContextDescriptor * @param operand The operand. * @return The absolute target address. */ -uint64_t VXCalcAbsoluteTarget(const VXInstructionInfo *info, const VXOperandInfo *operand); +VX_EXPORT uint64_t VXCalcAbsoluteTarget( + const VXInstructionInfo *info, + const VXOperandInfo *operand); #ifdef __cplusplus } diff --git a/Bindings/C/VXInstructionDecoderC.h b/Bindings/C/VXInstructionDecoderC.h index b3a6607..bf3058c 100644 --- a/Bindings/C/VXInstructionDecoderC.h +++ b/Bindings/C/VXInstructionDecoderC.h @@ -53,7 +53,7 @@ typedef struct _VXBaseDataSourceContext { VXContextDescriptor d; } VXBaseDataSou * @param ctx The context to release. * The context may no longer be used after it was released. */ -void VXBaseDataSource_Release( +VX_EXPORT void VXBaseDataSource_Release( VXBaseDataSourceContext *ctx); /** @@ -65,7 +65,7 @@ void VXBaseDataSource_Release( * field of the @c info parameter for error flags. Possible error values are * @c IF_ERROR_END_OF_INPUT or @c IF_ERROR_LENGTH. */ -uint8_t VXBaseDataSource_InputPeek( +VX_EXPORT uint8_t VXBaseDataSource_InputPeek( VXBaseDataSourceContext *ctx, VXInstructionInfo *info); @@ -80,28 +80,28 @@ uint8_t VXBaseDataSource_InputPeek( * parameter. This function also appends the new byte to to @c data field of the @c info * parameter. */ -uint8_t VXBaseDataSource_InputNext8( +VX_EXPORT uint8_t VXBaseDataSource_InputNext8( VXBaseDataSourceContext *ctx, VXInstructionInfo *info); /** * @copydoc VXBaseDataSource_InputNext8 */ -uint16_t VXBaseDataSource_InputNext16( +VX_EXPORT uint16_t VXBaseDataSource_InputNext16( VXBaseDataSourceContext *ctx, VXInstructionInfo *info); /** * @copydoc VXBaseDataSource_InputNext8 */ -uint32_t VXBaseDataSource_InputNext32( +VX_EXPORT uint32_t VXBaseDataSource_InputNext32( VXBaseDataSourceContext *ctx, VXInstructionInfo *info); /** * @copydoc VXBaseDataSource_InputNext8 */ -uint64_t VXBaseDataSource_InputNext64( +VX_EXPORT uint64_t VXBaseDataSource_InputNext64( VXBaseDataSourceContext *ctx, VXInstructionInfo *info); @@ -112,7 +112,7 @@ uint64_t VXBaseDataSource_InputNext64( * The current input byte is set everytime the @c inputPeek or @c inputNext method is called. */ // TODO: check long descr -uint8_t VXBaseDataSource_InputCurrent( +VX_EXPORT uint8_t VXBaseDataSource_InputCurrent( const VXBaseDataSourceContext *ctx); /** @@ -120,7 +120,7 @@ uint8_t VXBaseDataSource_InputCurrent( * @param ctx The data soruce context. * @return @c true if end of input, @c false if not. */ -bool VXBaseDataSource_IsEndOfInput( +VX_EXPORT bool VXBaseDataSource_IsEndOfInput( const VXBaseDataSourceContext *ctx); /** @@ -128,7 +128,7 @@ bool VXBaseDataSource_IsEndOfInput( * @param ctx The data soruce context. * @return The current input position. */ -uint64_t VXBaseDataSource_GetPosition( +VX_EXPORT uint64_t VXBaseDataSource_GetPosition( const VXBaseDataSourceContext *ctx); /** @@ -137,7 +137,7 @@ uint64_t VXBaseDataSource_GetPosition( * @param position The new input position. * @return @c false if the new position exceeds the maximum input length. */ -bool VXBaseDataSource_SetPosition( +VX_EXPORT bool VXBaseDataSource_SetPosition( VXBaseDataSourceContext *ctx, uint64_t position); @@ -151,7 +151,7 @@ bool VXBaseDataSource_SetPosition( * @see VXBaseDataSource_Release */ // TODO: verify return value -VXBaseDataSourceContext* VXMemoryDataSource_Create( +VX_EXPORT VXBaseDataSourceContext* VXMemoryDataSource_Create( const void* buffer, size_t bufferLen); @@ -190,7 +190,7 @@ typedef struct _VXInstructionDecoderContext * @see VXInstructionDecoder_Release */ // TODO: verify return value -VXInstructionDecoderContext* VXInstructionDecoder_Create(void); +VX_EXPORT VXInstructionDecoderContext* VXInstructionDecoder_Create(void); /** * @brief Creates an instruction decoder. @@ -201,7 +201,7 @@ VXInstructionDecoderContext* VXInstructionDecoder_Create(void); * @return @c NULL if it fails, else an instruction decoder context. * @see VXInstructionDecoder_Release */ -VXInstructionDecoderContext* VXInstructionDecoder_CreateEx( +VX_EXPORT VXInstructionDecoderContext* VXInstructionDecoder_CreateEx( VXBaseDataSourceContext *input, VXDisassemblerMode disassemblerMode, VXInstructionSetVendor preferredVendor, @@ -211,7 +211,7 @@ VXInstructionDecoderContext* VXInstructionDecoder_CreateEx( * @brief Releases an instruction decoder. * @param ctx The context of the instruction decoder to release. */ -void VXInstructionDecoder_Release( +VX_EXPORT void VXInstructionDecoder_Release( VXInstructionDecoderContext *ctx); /** @@ -223,7 +223,7 @@ void VXInstructionDecoder_Release( * length. In all other cases (valid and invalid instructions) the return value is * @c true. */ -bool VXInstructionDecoder_DecodeInstruction( +VX_EXPORT bool VXInstructionDecoder_DecodeInstruction( VXInstructionDecoderContext *ctx, VXInstructionInfo *info); @@ -232,7 +232,7 @@ bool VXInstructionDecoder_DecodeInstruction( * @param ctx The instruction decoder context. * @return The context of the data source. */ -VXBaseDataSourceContext* VXInstructionDecoder_GetDataSource( +VX_EXPORT VXBaseDataSourceContext* VXInstructionDecoder_GetDataSource( const VXInstructionDecoderContext *ctx); /** @@ -240,7 +240,7 @@ VXBaseDataSourceContext* VXInstructionDecoder_GetDataSource( * @param ctx The instruction decoder context. * @param input The context of the new input data source. */ -void VXInstructionDecoder_SetDataSource( +VX_EXPORT void VXInstructionDecoder_SetDataSource( VXInstructionDecoderContext *ctx, VXBaseDataSourceContext *input); @@ -249,7 +249,7 @@ void VXInstructionDecoder_SetDataSource( * @param ctx The instruction decoder context. * @return The current disassembler mode. */ -VXDisassemblerMode VXInstructionDecoder_GetDisassemblerMode( +VX_EXPORT VXDisassemblerMode VXInstructionDecoder_GetDisassemblerMode( const VXInstructionDecoderContext *ctx); /** @@ -257,7 +257,7 @@ VXDisassemblerMode VXInstructionDecoder_GetDisassemblerMode( * @param ctx The instruction decoder context. * @param disassemblerMode The new disassembler mode. */ -void VXInstructionDecoder_SetDisassemblerMode( +VX_EXPORT void VXInstructionDecoder_SetDisassemblerMode( VXInstructionDecoderContext *ctx, VXDisassemblerMode disassemblerMode); @@ -266,7 +266,7 @@ void VXInstructionDecoder_SetDisassemblerMode( * @param ctx The instruction decoder context. * @return The preferred instruction-set vendor. */ -VXInstructionSetVendor VXInstructionDecoder_GetPreferredVendor( +VX_EXPORT VXInstructionSetVendor VXInstructionDecoder_GetPreferredVendor( const VXInstructionDecoderContext *ctx); /** @@ -274,7 +274,7 @@ VXInstructionSetVendor VXInstructionDecoder_GetPreferredVendor( * @param ctx The instruction decoder context. * @param preferredVendor The new preferred instruction-set vendor. */ -void VXInstructionDecoder_SetPreferredVendor( +VX_EXPORT void VXInstructionDecoder_SetPreferredVendor( VXInstructionDecoderContext *ctx, VXInstructionSetVendor preferredVendor); @@ -283,7 +283,7 @@ void VXInstructionDecoder_SetPreferredVendor( * @param ctx The instruction decoder context. * @return The current instruction pointer. */ -uint64_t VXInstructionDecoder_GetInstructionPointer( +VX_EXPORT uint64_t VXInstructionDecoder_GetInstructionPointer( const VXInstructionDecoderContext *ctx); /** @@ -291,7 +291,7 @@ uint64_t VXInstructionDecoder_GetInstructionPointer( * @param ctx The instruction decoder context. * @param instructionPointer The new instruction pointer. */ -void VXInstructionDecoder_SetInstructionPointer( +VX_EXPORT void VXInstructionDecoder_SetInstructionPointer( VXInstructionDecoderContext *ctx, uint64_t instructionPointer); diff --git a/Bindings/C/VXInstructionFormatterC.h b/Bindings/C/VXInstructionFormatterC.h index d38b66b..0507ec8 100644 --- a/Bindings/C/VXInstructionFormatterC.h +++ b/Bindings/C/VXInstructionFormatterC.h @@ -53,7 +53,7 @@ typedef struct _VXBaseSymbolResolverContext * @param ctx The context of the symbol resolver to free. * The context may no longer used after it was released. */ -void VXBaseSymbolResolver_Release( +VX_EXPORT void VXBaseSymbolResolver_Release( VXBaseSymbolResolverContext *ctx); /** @@ -65,7 +65,7 @@ void VXBaseSymbolResolver_Release( * the base address of the symbol. * @return The name of the symbol if the symbol was found, else @c NULL. */ -const char* VXBaseSymbolResolver_ResolveSymbol( +VX_EXPORT const char* VXBaseSymbolResolver_ResolveSymbol( VXBaseSymbolResolverContext *ctx, const VXInstructionInfo *info, uint64_t address, @@ -86,7 +86,7 @@ typedef const char* (*VXCustomSymbolResolver_ResolveSymbolCallback)( * May also be @c NULL. * @return @c NULL if it fails, else a symbol resolver context. */ -VXBaseSymbolResolverContext* VXCustomSymbolResolver_Create( +VX_EXPORT VXBaseSymbolResolverContext* VXCustomSymbolResolver_Create( VXCustomSymbolResolver_ResolveSymbolCallback resolverCb, void *userData); @@ -104,7 +104,7 @@ typedef struct _VXBaseInstructionFormatterContext * @return Pointer to the formatted instruction string. This pointer remains valid until * this function is called again or the context is released. */ -const char* VXBaseInstructionFormatter_FormatInstruction( +VX_EXPORT const char* VXBaseInstructionFormatter_FormatInstruction( VXBaseInstructionFormatterContext *ctx, const VXInstructionInfo *info); @@ -113,7 +113,7 @@ const char* VXBaseInstructionFormatter_FormatInstruction( * @param ctx The instruction formatter context. * @return Pointer to the current symbol resolver or @c NULL if no symbol resolver is used. */ -VXBaseSymbolResolverContext* VXBaseInstructionFormatter_GetSymbolResolver( +VX_EXPORT VXBaseSymbolResolverContext* VXBaseInstructionFormatter_GetSymbolResolver( const VXBaseInstructionFormatterContext *ctx); /** @@ -122,7 +122,7 @@ VXBaseSymbolResolverContext* VXBaseInstructionFormatter_GetSymbolResolver( * @param symbolResolver Pointer to a symbol resolver instance or @c NULL, if no smybol * resolver should be used. */ -void VXBaseInstructionFormatter_SetSymbolResolver( +VX_EXPORT void VXBaseInstructionFormatter_SetSymbolResolver( VXBaseInstructionFormatterContext *ctx, VXBaseSymbolResolverContext *resolver); @@ -131,7 +131,7 @@ void VXBaseInstructionFormatter_SetSymbolResolver( * @param ctx The context of the instruction formatter to release. * The context may no longer used after it has been released. */ -void VXBaseInstructionFormatter_Release( +VX_EXPORT void VXBaseInstructionFormatter_Release( VXBaseInstructionFormatterContext *ctx); /* VXIntelInstructionFormatter ================================================================ */ @@ -141,7 +141,7 @@ void VXBaseInstructionFormatter_Release( * @return @c NULL if it fails, else an Intel instruction formatter context. * @see VXBaseInstructionFormatter_Release */ -VXBaseInstructionFormatterContext* VXIntelInstructionFormatter_Create(void); +VX_EXPORT VXBaseInstructionFormatterContext* VXIntelInstructionFormatter_Create(void); /** * @brief Creates an Intel-syntax instruction formatter. @@ -149,7 +149,7 @@ VXBaseInstructionFormatterContext* VXIntelInstructionFormatter_Create(void); * @return @c NULL if it fails, else an Intel instruction formatter context. * @see VXBaseInstructionFormatter_Release */ -VXBaseInstructionFormatterContext* VXIntelInstructionFormatter_CreateEx( +VX_EXPORT VXBaseInstructionFormatterContext* VXIntelInstructionFormatter_CreateEx( VXBaseSymbolResolverContext *resolver); /* ============================================================================================= */ diff --git a/Bindings/C/VXInternalConfig.h b/Bindings/C/VXInternalConfig.h new file mode 100644 index 0000000..9ef7753 --- /dev/null +++ b/Bindings/C/VXInternalConfig.h @@ -0,0 +1,44 @@ +/************************************************************************************************** + + Verteron Disassembler Engine + Version 1.0 + + Remarks : Freeware, Copyright must be included + + Original Author : athre0z + Modifications : + + Last change : 16. March 2015 + + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + +**************************************************************************************************/ + +#ifndef _VDE_VXINTERNALCONFIG_H_ +#define _VDE_VXINTERNALCONFIG_H_ + +#ifdef _MSC_VER +# define VX_INLINE __inline +#else +# define VX_INLINE inline +#endif + +#define VX_EXPORT + +#endif /* _VDE_VXINTERNALCONFIG_H_ */ \ No newline at end of file diff --git a/Bindings/C/VXInternalHelpersC.h b/Bindings/C/VXInternalHelpersC.h index d0bd0c8..2ea5ca7 100644 --- a/Bindings/C/VXInternalHelpersC.h +++ b/Bindings/C/VXInternalHelpersC.h @@ -35,6 +35,7 @@ #include "VXInstructionDecoderC.h" #include "VXInstructionFormatterC.h" +#include "VXInternalConfig.h" #include @@ -56,9 +57,7 @@ typedef enum _VXTypeId /* Context conversion helpers ================================================================== */ -// TODO: don't use __inline - -__inline struct _VXBaseDataSource* VXBaseDataSource_thiz( +VX_INLINE struct _VXBaseDataSource* VXBaseDataSource_thiz( VXBaseDataSourceContext *ctx) { assert(ctx->d.type == TYPE_BASEDATASOURCE @@ -66,7 +65,7 @@ __inline struct _VXBaseDataSource* VXBaseDataSource_thiz( return (struct _VXBaseDataSource*)ctx->d.ptr; } -__inline const struct _VXBaseDataSource* VXBaseDataSource_cthiz( +VX_INLINE const struct _VXBaseDataSource* VXBaseDataSource_cthiz( const VXBaseDataSourceContext *ctx) { assert(ctx->d.type == TYPE_BASEDATASOURCE @@ -74,35 +73,35 @@ __inline const struct _VXBaseDataSource* VXBaseDataSource_cthiz( return (const struct _VXBaseDataSource*)ctx->d.ptr; } -__inline struct _VXMemoryDataSource* VXMemoryDataSource_thiz( +VX_INLINE struct _VXMemoryDataSource* VXMemoryDataSource_thiz( VXBaseDataSourceContext *ctx) { assert(ctx->d.type == TYPE_MEMORYDATASOURCE); return (struct _VXMemoryDataSource*)ctx->d.ptr; } -__inline const struct _VXMemoryDataSource* VXMemoryDataSource_cthiz( +VX_INLINE const struct _VXMemoryDataSource* VXMemoryDataSource_cthiz( const VXBaseDataSourceContext *ctx) { assert(ctx->d.type == TYPE_MEMORYDATASOURCE); return (const struct _VXMemoryDataSource*)ctx->d.ptr; } -__inline struct _VXInstructionDecoder* VXInstructionDecoder_thiz( +VX_INLINE struct _VXInstructionDecoder* VXInstructionDecoder_thiz( VXInstructionDecoderContext *ctx) { assert(ctx->d.type == TYPE_INSTRUCTIONDECODER); return (struct _VXInstructionDecoder*)ctx->d.ptr; } -__inline const struct _VXInstructionDecoder* VXInstructionDecoder_cthiz( +VX_INLINE const struct _VXInstructionDecoder* VXInstructionDecoder_cthiz( const VXInstructionDecoderContext *ctx) { assert(ctx->d.type == TYPE_INSTRUCTIONDECODER); return (const struct _VXInstructionDecoder*)ctx->d.ptr; } -__inline struct _VXBaseSymbolResolver* VXBaseSymbolResolver_thiz( +VX_INLINE struct _VXBaseSymbolResolver* VXBaseSymbolResolver_thiz( VXBaseSymbolResolverContext *ctx) { assert(ctx->d.type == TYPE_BASESYMBOLRESOLVER @@ -110,7 +109,7 @@ __inline struct _VXBaseSymbolResolver* VXBaseSymbolResolver_thiz( return (struct _VXBaseSymbolResolver*)ctx->d.ptr; } -__inline const struct _VXBaseSymbolResolver* VXBaseSymbolResolver_cthiz( +VX_INLINE const struct _VXBaseSymbolResolver* VXBaseSymbolResolver_cthiz( const VXBaseSymbolResolverContext *ctx) { assert(ctx->d.type == TYPE_BASESYMBOLRESOLVER @@ -118,21 +117,21 @@ __inline const struct _VXBaseSymbolResolver* VXBaseSymbolResolver_cthiz( return (const struct _VXBaseSymbolResolver*)ctx->d.ptr; } -__inline struct _VXCustomSymbolResolver* VXCustomSymbolResolver_thiz( +VX_INLINE struct _VXCustomSymbolResolver* VXCustomSymbolResolver_thiz( VXBaseSymbolResolverContext *ctx) { assert(ctx->d.type == TYPE_CUSTOMSYMBOLRESOLVER); return (struct _VXCustomSymbolResolver*)ctx->d.ptr; } -__inline const struct _VXCustomSymbolResolver* VXCustomSymbolResolver_cthiz( +VX_INLINE const struct _VXCustomSymbolResolver* VXCustomSymbolResolver_cthiz( const VXBaseSymbolResolverContext *ctx) { assert(ctx->d.type == TYPE_CUSTOMSYMBOLRESOLVER); return (const struct _VXCustomSymbolResolver*)ctx->d.ptr; } -__inline struct _VXBaseInstructionFormatter* VXBaseInstructionFormatter_thiz( +VX_INLINE struct _VXBaseInstructionFormatter* VXBaseInstructionFormatter_thiz( VXBaseInstructionFormatterContext *ctx) { assert(ctx->d.type == TYPE_BASEINSTRUCTIONFORMATTER @@ -140,7 +139,7 @@ __inline struct _VXBaseInstructionFormatter* VXBaseInstructionFormatter_thiz( return (struct _VXBaseInstructionFormatter*)ctx->d.ptr; } -__inline const struct _VXBaseInstructionFormatter* VXBaseInstructionFormatter_cthiz( +VX_INLINE const struct _VXBaseInstructionFormatter* VXBaseInstructionFormatter_cthiz( const VXBaseInstructionFormatterContext *ctx) { assert(ctx->d.type == TYPE_BASEINSTRUCTIONFORMATTER @@ -148,14 +147,14 @@ __inline const struct _VXBaseInstructionFormatter* VXBaseInstructionFormatter_ct return (const struct _VXBaseInstructionFormatter*)ctx->d.ptr; } -__inline struct _VXIntelInstructionFormatter* VXIntelInstructionFormatter_thiz( +VX_INLINE struct _VXIntelInstructionFormatter* VXIntelInstructionFormatter_thiz( VXBaseInstructionFormatterContext *ctx) { assert(ctx->d.type == TYPE_INTELINSTRUCTIONFORMATTER); return (struct _VXIntelInstructionFormatter*)ctx->d.ptr; } -__inline const struct _VXIntelInstructionFormatter* VXIntelInstructionFormatter_cthiz( +VX_INLINE const struct _VXIntelInstructionFormatter* VXIntelInstructionFormatter_cthiz( const VXBaseInstructionFormatterContext *ctx) { assert(ctx->d.type == TYPE_INTELINSTRUCTIONFORMATTER); diff --git a/Bindings/C/VXOpcodeTableInternalC.h b/Bindings/C/VXOpcodeTableInternalC.h index 83e293b..54e1614 100644 --- a/Bindings/C/VXOpcodeTableInternalC.h +++ b/Bindings/C/VXOpcodeTableInternalC.h @@ -168,7 +168,7 @@ extern const char* vxInstrMnemonicStrings[]; * @param node The node. * @return The type of the specified opcode tree node. */ -__inline VXOpcodeTreeNodeType VXGetOpcodeNodeType(VXOpcodeTreeNode node) +VX_INLINE VXOpcodeTreeNodeType VXGetOpcodeNodeType(VXOpcodeTreeNode node) { return (VXOpcodeTreeNodeType)((node >> 12) & 0x0F); } @@ -178,7 +178,7 @@ __inline VXOpcodeTreeNodeType VXGetOpcodeNodeType(VXOpcodeTreeNode node) * @param node The node. * @return The value of the specified opcode tree node. */ -__inline uint16_t VXGetOpcodeNodeValue(VXOpcodeTreeNode node) +VX_INLINE uint16_t VXGetOpcodeNodeValue(VXOpcodeTreeNode node) { return (node & 0x0FFF); } @@ -187,7 +187,7 @@ __inline uint16_t VXGetOpcodeNodeValue(VXOpcodeTreeNode node) * @brief Returns the root node of the opcode tree. * @return The root node of the opcode tree. */ -__inline VXOpcodeTreeNode VXGetOpcodeTreeRoot() +VX_INLINE VXOpcodeTreeNode VXGetOpcodeTreeRoot() { return 0x1000; } @@ -198,7 +198,7 @@ __inline VXOpcodeTreeNode VXGetOpcodeTreeRoot() * @param index The index of the child node to retrieve. * @return The specified child node. */ -__inline VXOpcodeTreeNode VXGetOpcodeTreeChild(VXOpcodeTreeNode parent, uint16_t index) +VX_INLINE VXOpcodeTreeNode VXGetOpcodeTreeChild(VXOpcodeTreeNode parent, uint16_t index) { VXOpcodeTreeNodeType nodeType = VXGetOpcodeNodeType(parent); uint16_t tableIndex = VXGetOpcodeNodeValue(parent); @@ -257,7 +257,7 @@ __inline VXOpcodeTreeNode VXGetOpcodeTreeChild(VXOpcodeTreeNode parent, uint16_t * @param node The instruction definition node. * @return Pointer to the instruction definition. */ -__inline const VXInstructionDefinition* VXGetInstructionDefinition(VXOpcodeTreeNode node) +VX_INLINE const VXInstructionDefinition* VXGetInstructionDefinition(VXOpcodeTreeNode node) { assert(VXGetOpcodeNodeType(node) == OTNT_INSTRUCTION_DEFINITION); return &vxInstrDefinitions[node & 0x0FFF]; @@ -268,7 +268,7 @@ __inline const VXInstructionDefinition* VXGetInstructionDefinition(VXOpcodeTreeN * @param mnemonic The mnemonic. * @return The instruction mnemonic string. */ -__inline const char* VXGetInstructionMnemonicString(VXInstructionMnemonic mnemonic) +VX_INLINE const char* VXGetInstructionMnemonicString(VXInstructionMnemonic mnemonic) { return vxInstrMnemonicStrings[(uint16_t)mnemonic]; } @@ -278,7 +278,7 @@ __inline const char* VXGetInstructionMnemonicString(VXInstructionMnemonic mnemon * @param operandSize The defined operand size. * @return The the numeric value for the simple operand size definition. */ -__inline uint16_t VXGetSimpleOperandSize(VXDefinedOperandSize operandSize) +VX_INLINE uint16_t VXGetSimpleOperandSize(VXDefinedOperandSize operandSize) { static const uint16_t operandSizes[8] = { @@ -295,7 +295,7 @@ __inline uint16_t VXGetSimpleOperandSize(VXDefinedOperandSize operandSize) * @param operandSize The defined operand size. * @return The memory-size part of the operand size definition. */ -__inline VXDefinedOperandSize VXGetComplexOperandMemSize(VXDefinedOperandSize operandSize) +VX_INLINE VXDefinedOperandSize VXGetComplexOperandMemSize(VXDefinedOperandSize operandSize) { return (VXDefinedOperandSize)(operandSize & 0x0F); } @@ -305,7 +305,7 @@ __inline VXDefinedOperandSize VXGetComplexOperandMemSize(VXDefinedOperandSize op * @param operandSize The defined operand size. * @return The register-size part of the operand size definition. */ -__inline VXDefinedOperandSize VXGetComplexOperandRegSize(VXDefinedOperandSize operandSize) +VX_INLINE VXDefinedOperandSize VXGetComplexOperandRegSize(VXDefinedOperandSize operandSize) { return (VXDefinedOperandSize)((operandSize >> 4) & 0x0F); } diff --git a/CMakeLists.txt b/CMakeLists.txt index 9a9c0ae..f47e14d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,7 +46,8 @@ if (BUILD_C_BINDINGS) "Bindings/C/VXInstructionFormatterC.h" "Bindings/C/VXOpcodeTableC.h" "Bindings/C/VXOpcodeTableInternalC.h" - "Bindings/C/VXInternalHelpersC.h") + "Bindings/C/VXInternalHelpersC.h" + "Bindings/C/VXInternalConfig.h") set(vdec_sources "Bindings/C/VXDisassemblerUtilsC.c" "Bindings/C/VXInstructionFormatterC.c"