jak-project/third-party/zydis/include/Zydis/Internal/FormatterATT.h
ManDude 5b44aece75
random fixes + support clang-cl on visual studio (#1129)
* delete unused shaders

* hide some options in debug menu

* change fullscreen logic a bit

* add "all actors" toggle

* borderless fix and fix alpha in direct renderer untextured (do we need a separate shader for that?)

* fix fuel cell orbit icons in widescreen

* fix `curve` types

* refs

* fix levitator task...

* fix some task stuff

* update font code a bit (temp)

* cmake, third-party and visual studio overhaul

* Update .gitmodules

* update modules

* clone repos

* fix encoding in zydis

* where did these come from

* try again

* add submodule

* Update 11zip

* Update 11zip

* Update 11zip

* delete

* try again

* clang

* update compiler flags

* delete 11zip. go away.

* Create memory-dump-p2s.py

* properly

* fix minimum architecture c++ compiler flags

* fix zydis

* oops

* Update all-types.gc

* fix clang-cl tests

* make "all actors" work better, entity debug qol

* update game-text conversion code to be more modularized

* Create vendor.txt

* fix typos and minor things

* update refs

* clang

* Attempt to add clang-cl support to vs2019 and CI

* vs2022 + clang-cl

* srsly? fix clang build

* Update launch.vs.json

* extend windows CI timer
2022-02-07 19:15:37 -05:00

184 lines
8.5 KiB
C
Vendored
Generated

/***************************************************************************************************
Zyan Disassembler Library (Zydis)
Original Author : Florian Bernd, Joel Hoener
* 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.
***************************************************************************************************/
/**
* @file
* Implements the `AT&T` style instruction-formatter.
*/
#ifndef ZYDIS_FORMATTER_ATT_H
#define ZYDIS_FORMATTER_ATT_H
#include <Zydis/Formatter.h>
#include <Zydis/Internal/FormatterBase.h>
#include <Zydis/Internal/String.h>
#ifdef __cplusplus
extern "C" {
#endif
/* ============================================================================================== */
/* Formatter functions */
/* ============================================================================================== */
/* ---------------------------------------------------------------------------------------------- */
/* Instruction */
/* ---------------------------------------------------------------------------------------------- */
ZyanStatus ZydisFormatterATTFormatInstruction(const ZydisFormatter* formatter,
ZydisFormatterBuffer* buffer, ZydisFormatterContext* context);
/* ---------------------------------------------------------------------------------------------- */
/* Operands */
/* ---------------------------------------------------------------------------------------------- */
ZyanStatus ZydisFormatterATTFormatOperandMEM(const ZydisFormatter* formatter,
ZydisFormatterBuffer* buffer, ZydisFormatterContext* context);
/* ---------------------------------------------------------------------------------------------- */
/* Elemental tokens */
/* ---------------------------------------------------------------------------------------------- */
ZyanStatus ZydisFormatterATTPrintMnemonic(const ZydisFormatter* formatter,
ZydisFormatterBuffer* buffer, ZydisFormatterContext* context);
ZyanStatus ZydisFormatterATTPrintRegister(const ZydisFormatter* formatter,
ZydisFormatterBuffer* buffer, ZydisFormatterContext* context, ZydisRegister reg);
ZyanStatus ZydisFormatterATTPrintAddressABS(const ZydisFormatter* formatter,
ZydisFormatterBuffer* buffer, ZydisFormatterContext* context);
ZyanStatus ZydisFormatterATTPrintDISP(const ZydisFormatter* formatter,
ZydisFormatterBuffer* buffer, ZydisFormatterContext* context);
ZyanStatus ZydisFormatterATTPrintIMM(const ZydisFormatter* formatter,
ZydisFormatterBuffer* buffer, ZydisFormatterContext* context);
/* ---------------------------------------------------------------------------------------------- */
/* ============================================================================================== */
/* Fomatter presets */
/* ============================================================================================== */
/* ---------------------------------------------------------------------------------------------- */
/* AT&T */
/* ---------------------------------------------------------------------------------------------- */
/**
* The default formatter configuration for `AT&T` style disassembly.
*/
static const ZydisFormatter FORMATTER_ATT =
{
/* style */ ZYDIS_FORMATTER_STYLE_ATT,
/* force_memory_size */ ZYAN_FALSE,
/* force_memory_seg */ ZYAN_FALSE,
/* force_memory_scale */ ZYAN_TRUE,
/* force_relative_branches */ ZYAN_FALSE,
/* force_relative_riprel */ ZYAN_FALSE,
/* print_branch_size */ ZYAN_FALSE,
/* detailed_prefixes */ ZYAN_FALSE,
/* addr_base */ ZYDIS_NUMERIC_BASE_HEX,
/* addr_signedness */ ZYDIS_SIGNEDNESS_SIGNED,
/* addr_padding_absolute */ ZYDIS_PADDING_AUTO,
/* addr_padding_relative */ 2,
/* disp_base */ ZYDIS_NUMERIC_BASE_HEX,
/* disp_signedness */ ZYDIS_SIGNEDNESS_SIGNED,
/* disp_padding */ 2,
/* imm_base */ ZYDIS_NUMERIC_BASE_HEX,
/* imm_signedness */ ZYDIS_SIGNEDNESS_AUTO,
/* imm_padding */ 2,
/* case_prefixes */ ZYDIS_LETTER_CASE_DEFAULT,
/* case_mnemonic */ ZYDIS_LETTER_CASE_DEFAULT,
/* case_registers */ ZYDIS_LETTER_CASE_DEFAULT,
/* case_typecasts */ ZYDIS_LETTER_CASE_DEFAULT,
/* case_decorators */ ZYDIS_LETTER_CASE_DEFAULT,
/* hex_uppercase */ ZYAN_TRUE,
/* hex_force_leading_number */ ZYAN_FALSE,
/* number_format */
{
// ZYDIS_NUMERIC_BASE_DEC
{
// Prefix
{
/* string */ ZYAN_NULL,
/* string_data */ ZYAN_DEFINE_STRING_VIEW(""),
/* buffer */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
},
// Suffix
{
/* string */ ZYAN_NULL,
/* string_data */ ZYAN_DEFINE_STRING_VIEW(""),
/* buffer */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
}
},
// ZYDIS_NUMERIC_BASE_HEX
{
// Prefix
{
/* string */ &FORMATTER_ATT.number_format[
ZYDIS_NUMERIC_BASE_HEX][0].string_data,
/* string_data */ ZYAN_DEFINE_STRING_VIEW("0x"),
/* buffer */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
},
// Suffix
{
/* string */ ZYAN_NULL,
/* string_data */ ZYAN_DEFINE_STRING_VIEW(""),
/* buffer */ { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
}
}
},
/* func_pre_instruction */ ZYAN_NULL,
/* func_post_instruction */ ZYAN_NULL,
/* func_format_instruction */ &ZydisFormatterATTFormatInstruction,
/* func_pre_operand */ ZYAN_NULL,
/* func_post_operand */ ZYAN_NULL,
/* func_format_operand_reg */ &ZydisFormatterBaseFormatOperandREG,
/* func_format_operand_mem */ &ZydisFormatterATTFormatOperandMEM,
/* func_format_operand_ptr */ &ZydisFormatterBaseFormatOperandPTR,
/* func_format_operand_imm */ &ZydisFormatterBaseFormatOperandIMM,
/* func_print_mnemonic */ &ZydisFormatterATTPrintMnemonic,
/* func_print_register */ &ZydisFormatterATTPrintRegister,
/* func_print_address_abs */ &ZydisFormatterATTPrintAddressABS,
/* func_print_address_rel */ &ZydisFormatterBasePrintAddressREL,
/* func_print_disp */ &ZydisFormatterATTPrintDISP,
/* func_print_imm */ &ZydisFormatterATTPrintIMM,
/* func_print_typecast */ ZYAN_NULL,
/* func_print_segment */ &ZydisFormatterBasePrintSegment,
/* func_print_prefixes */ &ZydisFormatterBasePrintPrefixes,
/* func_print_decorator */ &ZydisFormatterBasePrintDecorator
};
/* ---------------------------------------------------------------------------------------------- */
/* ============================================================================================== */
#ifdef __cplusplus
}
#endif
#endif // ZYDIS_FORMATTER_ATT_H