capstone/arch/XCore/XCoreMapping.h
Grond66 a7399233eb
Fix unchecked allocations (#2844)
* Fix trivial unchecked allocations

* Move instruction lookup caching allocation into the core

* Apply formatting nitpicks

Co-authored-by: Rot127 <45763064+Rot127@users.noreply.github.com>

* Assert to avoid an integer overflow in lookup_insn_map()

* Remove unused member from cs_struct

* Document what happens when lookup_insn_map() fails

---------

Co-authored-by: Samuel Arnold <samuel.arnold@crowdstrike.com>
Co-authored-by: Rot127 <45763064+Rot127@users.noreply.github.com>
2026-02-14 13:55:33 +00:00

28 lines
781 B
C

/* Capstone Disassembly Engine */
/* By Nguyen Anh Quynh <aquynh@gmail.com>, 2013-2015 */
#ifndef CS_XCORE_MAP_H
#define CS_XCORE_MAP_H
#include "capstone/capstone.h"
extern const insn_map *XCore_insns;
extern const unsigned int XCore_insn_count;
// return name of register in friendly string
const char *XCore_reg_name(csh handle, unsigned int reg);
// given internal insn id, return public instruction info
void XCore_get_insn_id(cs_struct *h, cs_insn *insn, unsigned int id);
const char *XCore_insn_name(csh handle, unsigned int id);
const char *XCore_group_name(csh handle, unsigned int id);
// map internal raw register to 'public' register
xcore_reg XCore_map_register(unsigned int r);
// map register name to register ID
xcore_reg XCore_reg_id(char *name);
#endif