139 const char *comma_replace =
NULL;
152 }
else if (
buf[
p + 1] ==
' ') {
157 }
else if (
buf[
p] ==
'(') {
159 }
else if (
buf[
p] ==
')') {
161 }
else if (
buf[
p] ==
'[') {
163 comma_replace =
" + ";
164 }
else if (
buf[
p] ==
']') {
166 }
else if (
buf[
p] ==
'{') {
167 if (strchr(
buf +
p + 1,
',') < strchr(
buf +
p + 1,
'}')) {
169 comma_replace =
", ";
173 }
else if (
buf[
p] ==
'}') {
174 if (!comma_replace) {
178 }
else if ((
buf[
p] ==
'w' ||
buf[
p] ==
'x') &&
buf[
p + 1] ==
'z' &&
buf[
p + 2] ==
'r') {
196 rz_list_foreach (tokens, it,
buf) {
209 char *
newstr =
p->localvar_only
213 char *space = strrchr(
newstr,
' ');
238 }
else if (
delta > 0) {
239 tmplt =
p->pseudo ?
"%s + 0x%x" : (ucase ?
"%s, 0x%X" :
"%s, 0x%x");
242 tmplt =
p->pseudo ?
"%s - 0x%x" : (ucase ?
"%s, -0x%X" :
"%s, -0x%x");
246 char *
comma = strchr(oldstr,
',');
258 const int oplen =
op->size;
264 char *tstr =
strdup(data);
286 char *tstr_new, *ripend = strchr(
rip,
']');
287 const char *
neg = strchr(
rip,
'-');
288 ut64 off = (oplen == 2 || strstr(tstr,
".w") || strstr(tstr,
".W")) ? 4 : 8;
293 const char *maybe_num =
neg ?
neg + 1 :
rip;
310 bpargs =
p->varlist(
f,
'b');
311 spargs =
p->varlist(
f,
's');
314 rz_list_foreach (bpargs,
iter, var) {
316 ?
p->get_ptr_at(
f, var->delta,
addr)
319 delta = var->delta +
f->bp_off;
325 reg =
p->get_reg_at(
f, var->delta,
addr);
331 if (strstr(tstr, oldstr)) {
338 rz_list_foreach (spargs,
iter, var) {
340 ?
p->get_ptr_at(
f, var->delta,
addr)
349 reg =
p->get_reg_at(
f, var->delta,
addr);
355 if (strstr(tstr, oldstr)) {
364 if (
len > strlen(tstr)) {
376 .
name =
"arm.pseudo",
377 .desc =
"ARM/ARM64 pseudo syntax",
382 #ifndef RZ_PLUGIN_INCORE
static ut32 neg(ArmOp *op)
static RASN1String * newstr(const char *string)
void rip(char *fname, off_t offset, unsigned int length)
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 static semflg const void static shmflg const struct timespec struct timespec static rem const char static group const void length
RZ_API void Ht_() free(HtName_(Ht) *ht)
RZ_API void rz_list_free(RZ_NONNULL RzList *list)
Empties the list and frees the list pointer.
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")
RzParsePlugin rz_parse_plugin_arm_pseudo
static const RzPseudoConfig arm_config
static const RzPseudoReplace arm_replace[]
static char * mount_oldstr(RzParse *p, const char *reg, st64 delta, bool ucase)
static bool subvar(RzParse *p, RzAnalysisFunction *f, RzAnalysisOp *op, char *data, char *str, int len)
RZ_API RzLibStruct rizin_plugin
static const RzPseudoGrammar arm_lexicon[]
static const RzPseudoDirect arm_direct[]
static RzList * arm_tokenize(const char *assembly, size_t length)
static char * subs_var_string(RzParse *p, RzAnalysisVarField *var, char *tstr, const char *oldstr, const char *reg, int delta)
static bool parse(RzParse *p, const char *assembly, RzStrBuf *sb)
#define RZ_PSEUDO_DEFINE_REPLACE(x, y, f)
static bool rz_pseudo_convert(const RzPseudoConfig *config, const char *assembly, RzStrBuf *sb)
#define RZ_PSEUDO_DEFINE_DIRECT(x, y)
#define RZ_PSEUDO_DEFINE_CONFIG(d, l, r, m, t)
#define RZ_PSEUDO_DEFINE_GRAMMAR(x, y)
RZ_DEPRECATE struct rz_analysis_var_field_t RzAnalysisVarField
RZ_API ut64 rz_num_get(RzNum *num, const char *str)
RZ_API bool rz_is_valid_input_num_value(RzNum *num, const char *input_value)
RZ_API char * rz_str_newf(const char *fmt,...) RZ_PRINTF_CHECK(1
RZ_API char * rz_str_ndup(RZ_NULLABLE const char *ptr, int len)
Create new copy of string ptr limited to size len.
RZ_API void rz_str_case(char *str, bool up)
RZ_API RzList * rz_str_split_duplist(const char *str, const char *c, bool trim)
Split the string str according to the substring c and returns a RzList with the result.
RZ_API const char * rz_str_trim_head_ro(const char *str)
RZ_API char * rz_str_replace(char *str, const char *key, const char *val, int g)
RZ_API const char * rz_str_casestr(const char *a, const char *b)
char * name[RZ_REG_NAME_LAST]
ut64(WINAPI *w32_GetEnabledXStateFeatures)()