46 if (!sysregdb->
port) {
60 ht_up_free(sysregdb->
port);
129 if (!
s->os || strcmp(
s->os, os)) {
132 if (!
s->arch || strcmp(
s->arch,
arch)) {
135 return s->bits !=
bits;
139 if (!
s->arch || strcmp(
s->arch,
arch)) {
142 if (
s->bits !=
bits) {
145 return !
s->cpu || strcmp(
s->cpu,
cpu);
154 char *argument_key, *comment, *
name;
177 ht_up_insert(sysregdb->
port, address, sysregitem);
235 bool syscall_changed, sysregs_changed;
260 if (!strcmp(os,
"any")) {
262 }
else if (!strcmp(os,
"darwin") || !strcmp(os,
"osx") || !strcmp(os,
"macos")) {
266 if (syscall_changed) {
278 if (sysregs_changed) {
312 si->sargs =
calloc(
si->args + 1,
sizeof(
char));
335 if (
s && swi == -1) {
350 const char *ret, *ret2, *
key;
401 if (!strchr(
k,
'.')) {
406 if (!strchr(
si->name,
'.')) {
439 if (item && !strcmp(item->
type,
type)) {
RZ_API ut64 sdb_array_get_num(Sdb *s, const char *key, int idx, ut32 *cas)
int bits(struct state *s, int need)
static static fork const void static count static fd const char const char static newpath const char static path const char path
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags static arg static fd static protocol static who struct sockaddr static addrlen static backlog struct timeval struct timezone static tz const struct iovec static count static mode const void const struct sockaddr static tolen const char static pathname void static offset struct stat static buf void long static basep static whence static length const void static len key
RZ_API char * sdb_fmt(const char *fmt,...)
RZ_API void Ht_() free(HtName_(Ht) *ht)
static void list(RzEgg *egg)
RZ_API RZ_OWN RzList * rz_list_newf(RzListFree f)
Returns a new initialized RzList pointer and sets the free method.
RZ_API RZ_BORROW RzListIter * rz_list_append(RZ_NONNULL RzList *list, void *data)
Appends at the end of the list a new element.
void * calloc(size_t number, size_t size)
static const char file_name
static static fork const void static count static fd const char const char static newpath char char char static envp time_t static t const char static mode static whence const char static dir time_t static t unsigned static seconds const char struct utimbuf static buf static inc static sig const char static mode static oldfd struct tms static buf static getgid static geteuid const char static filename static arg static mask struct ustat static ubuf static getppid static setsid static egid sigset_t static set struct timeval struct timezone static tz fd_set fd_set fd_set struct timeval static timeout const char char static bufsiz const char static swapflags void static offset const char static length static mode static who const char struct statfs static buf unsigned unsigned num
return strdup("=SP r13\n" "=LR r14\n" "=PC r15\n" "=A0 r0\n" "=A1 r1\n" "=A2 r2\n" "=A3 r3\n" "=ZF zf\n" "=SF nf\n" "=OF vf\n" "=CF cf\n" "=SN or0\n" "gpr lr .32 56 0\n" "gpr pc .32 60 0\n" "gpr cpsr .32 64 0 ____tfiae_________________qvczn\n" "gpr or0 .32 68 0\n" "gpr tf .1 64.5 0 thumb\n" "gpr ef .1 64.9 0 endian\n" "gpr jf .1 64.24 0 java\n" "gpr qf .1 64.27 0 sticky_overflow\n" "gpr vf .1 64.28 0 overflow\n" "gpr cf .1 64.29 0 carry\n" "gpr zf .1 64.30 0 zero\n" "gpr nf .1 64.31 0 negative\n" "gpr itc .4 64.10 0 if_then_count\n" "gpr gef .4 64.16 0 great_or_equal\n" "gpr r0 .32 0 0\n" "gpr r1 .32 4 0\n" "gpr r2 .32 8 0\n" "gpr r3 .32 12 0\n" "gpr r4 .32 16 0\n" "gpr r5 .32 20 0\n" "gpr r6 .32 24 0\n" "gpr r7 .32 28 0\n" "gpr r8 .32 32 0\n" "gpr r9 .32 36 0\n" "gpr r10 .32 40 0\n" "gpr r11 .32 44 0\n" "gpr r12 .32 48 0\n" "gpr r13 .32 52 0\n" "gpr r14 .32 56 0\n" "gpr r15 .32 60 0\n" "gpr r16 .32 64 0\n" "gpr r17 .32 68 0\n")
RZ_API void ls_free(SdbList *list)
#define ls_foreach(list, it, pos)
RZ_API ut64 sdb_num_get(Sdb *s, const char *key, ut32 *cas)
#define rz_return_val_if_fail(expr, val)
RZ_API bool rz_file_exists(const char *str)
RZ_API RZ_OWN char * rz_file_path_join(RZ_NONNULL const char *s1, RZ_NULLABLE const char *s2)
Concatenate two paths to create a new one with s1+s2 with the correct path separator.
void(* RzListFree)(void *ptr)
RZ_API ut64 rz_num_get(RzNum *num, const char *str)
RZ_API RZ_OWN char * rz_path_system(RZ_NULLABLE const char *path)
Return the full system path of the given subpath path.
RZ_API char * rz_str_newf(const char *fmt,...) RZ_PRINTF_CHECK(1
RZ_API const char * rz_str_word_get0(const char *str, int idx)
RZ_API size_t rz_str_split(char *str, char ch)
Split string str in place by using ch as a delimiter.
#define rz_strf(buf,...)
Convenience macro for local temporary strings.
#define RZ_JOIN_2_PATHS(p1, p2)
RZ_API Sdb * sdb_new(const char *path, const char *name, int lock)
RZ_API void sdb_close(Sdb *s)
RZ_API Sdb * sdb_new0(void)
RZ_API char * sdb_get(Sdb *s, const char *key, ut32 *cas)
RZ_API bool sdb_free(Sdb *s)
RZ_API void sdb_reset(Sdb *s)
RZ_API const char * sdb_const_get(Sdb *s, const char *key, ut32 *cas)
RZ_API bool sdb_foreach(Sdb *s, SdbForeachCallback cb, void *user)
RZ_API int sdb_open(Sdb *s, const char *file)
RZ_API SdbList * sdb_foreach_list(Sdb *s, bool sorted)
static char * sdbkv_key(const SdbKv *kv)
static char * sdbkv_value(const SdbKv *kv)
RZ_API RzSyscall * rz_syscall_new(void)
Creates a new RzSyscall type.
RZ_API void rz_sysreg_item_free(RzSysregItem *s)
Frees an RzSysregItem type.
RZ_API RzSysregsDB * rz_sysregs_db_new()
Creates a new RzSysregDB type.
RZ_API bool rz_sysreg_load_sdb(RzSysregsDB *sysregdb, const char *path)
Loads the RzSysregDB from the path to the hashtable.
static bool callback_list(void *u, const char *k, const char *v)
static bool sdb_load_by_path(RZ_NONNULL RzSysregsDB *sysregdb, const char *path)
RZ_API RzSyscall * rz_syscall_ref(RzSyscall *sc)
RZ_LIB_VERSION(rz_syscall)
RZ_API void rz_syscall_free(RzSyscall *s)
Frees an RzSyscall type.
static bool sdb_load_sysregs(RzSysregsDB *sysregdb, Sdb *sdb)
RZ_API void rz_syscall_item_free(RzSyscallItem *si)
static int getswi(RzSyscall *s, int swi)
RZ_API RZ_OWN RzSysregItem * rz_sysreg_item_new(RZ_NULLABLE const char *name)
Creates a new RzSysregItem type.
RZ_API int rz_syscall_get_swi(RzSyscall *s)
static bool sysregs_reload_needed(RzSyscall *s, const char *arch, int bits, const char *cpu)
RZ_API bool rz_sysreg_set_arch(RzSyscall *s, RZ_NONNULL const char *arch, RZ_NONNULL const char *regs_dir)
Sets the architecture for sysregs during analysis and loads up the sysregs SDB database.
RZ_API int rz_syscall_get_num(RzSyscall *s, const char *str)
RZ_API RzSyscallItem * rz_syscall_item_new_from_string(const char *name, const char *s)
static bool load_sdb(Sdb **db, const char *name)
RZ_API RzSyscallItem * rz_syscall_get(RzSyscall *s, int num, int swi)
RZ_API const char * rz_sysreg_get(RzSyscall *s, const char *type, ut64 port)
Searches the sysregs SDB database inside librz/reg/d for the type (mmio/reg) and returns its value as...
static bool syscall_reload_needed(RzSyscall *s, const char *os, const char *arch, int bits)
RZ_API const char * rz_syscall_get_i(RzSyscall *s, int num, int swi)
RZ_API void rz_sysregs_db_free(RzSysregsDB *sysregdb)
Frees a RzSysregDB type.
RZ_API RzList * rz_syscall_list(RzSyscall *s)
RZ_API bool rz_syscall_setup(RzSyscall *s, const char *arch, int bits, const char *cpu, const char *os)
static void free_port_kv(HtUPKv *kv)
ut64(WINAPI *w32_GetEnabledXStateFeatures)()