Compare commits

...
590 Commits
Author SHA1 Message Date
pancake ee031a7021 vc4: upstream cgen tables, assembler, ESIL emulation and analysis
- Update the cgen generated sources to puppeh/binutils-vc4 (branch vc4),
  which decodes the vector unit and fixes sized ld/st, scaled immediates
  and the signed 12 bit offsets
- Decode 80 bit vector insns (16 byte buffer, 10 byte max op size)
- Decode what the tables miss or get wrong: tbb/tbh, 48 bit b/bl pc+o32,
  the missing 48 bit alu ops, and the shift of 32 bit addscale immediates
- Treat the 16 bit sp offset of lea/add sp as signed, print float6
  immediates as values so they assemble back
- Add an assembler on top of the cgen one, pc relative operands, relaxed
  wider forms, 48 bit fallbacks, and a check that rejects encodings cgen
  silently truncates
- Replace the analysis with a text driven one that emits ESIL for all
  scalar insns: flags in sr, conditions, compare and branch, ldm/stm,
  table branches, floats and conversions; vector insns are typed only
- Rewrite the pseudo plugin for the upstream syntax
- Drop libvc4 from the builds, the plugin never used it
2026-11-04 20:19:45 +01:00
pancake 0a0327aa45 vc4: pseudo compare-and-branch forms and meson include path fix
- Translate addcmpb<cond> and 3 operand b<cond> into compare and goto
- Render the never-taken f condition as false and fix 'x -N' spacing
- Resolve ../../include with realpath since p/vc4 is usually a symlink
- Document the separate arch.vc4 and asm.vc4 XPS plugins
2026-11-04 18:41:02 +01:00
pancake 9870775224 Add r2plugin xps interface and pseudo for vc4 2026-11-04 18:31:28 +01:00
pancake d5e7a28186 Ignore vc4 plugin build artifacts and editor caches 2026-11-04 11:33:25 +01:00
pancake c9571534b9 Add standalone Makefile to build the vc4 asm/anal plugin
Allows building arch_vc4 from libr/asm/arch/vc4 directly instead of
going through the whole r2 build. Mirrors libr/asm/p/vc4.mk but
resolves the sources locally, links libr/libvc4 objects and the
libr/asm/p/arch_vc4.c glue, and adds an install target.
2026-11-04 11:33:09 +01:00
pancake 5fff0016a3 Support bits:// packed and be16 unpacked roms for r2tama 2026-11-03 18:30:00 +01:00
pancake f2199032a7 Add Tamagotchi P1/P2 ESIL emulator 2026-11-03 18:10:09 +01:00
n0p 5d28dc6de4 md32: tests and docs for the scq16 table update and the public test vectors
test/test_scq16.py (267 checks) and test/test_md32.c cover the new forms, the open marker, the broadcast ports, the confidence levels and ctz(0). test/scq16_vectors.json carries 195 public bytes-only vectors with the expected result in the big-endian regime of the harness and in the little-endian regime of the core data memory; test/test_scq16_vectors.py runs both and the Makefile adds it to make test. doc/scq16.md, README and CHANGELOG describe the hypothesis file, the confidence levels and the open question on ctz(0).
2026-11-03 10:17:01 +01:00
n0p 645f4154ff md32: scq16 table update (229 forms), the open-reading marker, the broadcast ports and the confidence levels
jr rn (6f ec) reads a 5-bit register field (r0-r31); btst rd, rd, #pos (67 f8-fb) has a 5-bit position; ctz is its own form without the hypothetical flag and sqr? belongs to the op41 placeholder; and rd, rs, #0x1|#0x3|#0xf (2 bytes), add rd, rs, #-1 (2 bytes) and the 4-byte sb are high, the 4-byte btst rd, rs, #pos is medium (settled by execution results).

The exporter marks an open reading (a family placeholder or a provisional name) with SCQ16_FL_OPEN and gives an open alternative without a template the uniform ESIL marker REF,ALT,open; export --hyp applies the declared plugin hypotheses of isa/scq16_hyp.json, which is empty: the packing ESIL of op41.fld rd, rs, rt, #pos is carried by the ISA source, still flagged hypothetical.

The scalar ports v0-v31 are the broadcast ports of the vector register file: a write by vbcast / vbcast.i reaches the 64 lanes of vr_k; the custom op open has no effect; aoj reports open, reading, hypothetical and confidence per unit. ctz of a zero operand gives -1 under the table ESIL; whether the hardware returns 32 is an open question. asm: the pseudo rule of op41.fld.
2026-11-03 10:17:01 +01:00
n0p 899e3344ff md32: document the three encodings the plugin serves and its scope
The README introduction states what MS15E30, uSIP and SCQ16 are and how they relate: two MD32 encodings and one distinct byte-granular encoding that shares the MD32 scalar programming model, which is why it is a cpu mode of this plugin; the remaining DSP cores of the same modem use an unrelated SIMD ISA and are out of scope. doc/scq16.md carries the same note.
2026-11-03 08:31:29 +01:00
n0p 6493987c72 md32: tests and docs for the scq16 table update and the vector unit model
test/test_scq16.py: bytes-only checks of ctz (established) next to the
provisional sqr?, sra? rd, rd, #pos, vrd? rd, vb1[x], op41.fld with three
registers, the provisional and? masks, lw.post of 2 bytes with a 4-bit
destination, the signed post-increment of the 6e page, vector ops with
non-zero fields, a vector head and B slots with the new forms; analysis
(ctz named, sqr? / sra? / vrd? provisional, op41.fld with rt, the lw.post
destination r11); the ESIL of ctz / sqr? / sra? / vrd?, the .post
templates writing rd last (rd == rb), the signed post-increments and the
vector unit model (vset.a / vmem.set, v.mem.ld with a count and with the
whole register, v.mem.ld + v.mem.st through the VU, v.move.mv back and
forth, F2 >= 4 without effect, a bundle with a vector load, unmodelled
vector ops stepped over).  test/test_md32.c: ctz, lw.post r11, sra?,
v.mem.ld with its fields.  doc/scq16.md: the new forms, the .post
convention, the VU model and its limits, the register profile with vr*,
the calling convention (r16-r31 callee-saved, r0-r15 caller-saved, lr
saved by the functions that call); README "SCQ16 mode": the VU model,
the provisional sqr? / sra?, the calling convention; CHANGELOG entry.
2026-11-03 08:31:29 +01:00
n0p ba096f3546 md32: scq16 table update (402 bit alternatives), the .post convention and the vector unit model
isa/scq16_isa.json is re-exported by the `export` command of
tools/gen_scq16_tables.py: 228 forms / 402 bit alternatives.  ctz rd, rs
(41 f3 0x22) is an established operation with the ESIL rd = 31 - clz(rs
& -rs); new provisional readings: sqr? rd, rs (41 f3 0x23, rd = rs * rs),
sra? rd, rd, #pos (67 fc-fd), vrd? rd, vb1[x] (1a xy, a 32-bit read of
the VU scalar bank with rd = w[3:0] + 1), and? #0xf000? (67 98-9b and the
2-byte 00/01 with k = 6) and and? #0xc000? (67 b4-b7); op41.fld rd, rs,
rt, #pos reads its third field as a register; lw.post rd, [rb] += 4 (21)
has a 4-bit destination (r1-r16); the 3-bit post-increment of the 6e
.post family (sh.post, lw.post, lhu.post?, lbu.post) is signed (x = 4..7
is -4..-1 units); sra rd, rd, #imm (09) is established; the load
templates with a post-increment write rd last, so with rd == rb the
loaded value wins (a declared convention: the public MD32 documents rd
written first).

scq16_vu.inc.c (new, included by scq16_arch.inc.c): the vector unit
model of the ESIL.  The register profile gains the vector register file
vr0-vr31 (128 bytes each, exposed as the four 256-bit quarters
vrK_0..vrK_3; lane 16q is the low 16 bits of quarter q); vp0-vp7 (written
by vmem.set and the hypothetical vcfg4c? #0xc) and va0-va7 (written by
vset.a) are the existing scalar ports.  The custom ESIL op vop models the
three established vector operations and nothing else: v.mem.ld copies n
halves from DM[p] into vr[F1 >> 2] and v.mem.st copies n halves from vr0
to DM[p], with p = vp[2 * F2 + F3[4]] when F2 < 4 and n = va[A] when
1..64 (otherwise the whole register), post-incrementing the pointer by
the bytes accessed; v.move.mv copies vr[F3] into vr[F1].  A memory op
with F2 >= 4, the pair mode B = 2 of v.move.mv and every other op9 pop
their operands and have no effect.  The data memory is read and written
through the ESIL memory callbacks; the vector registers are kept in the
register arena.

asm_md32.c: pseudo rule of sqr (rd = (rs * rs)).  Makefile: the new
include file among the dependencies of the arch plugin.
2026-11-03 08:31:29 +01:00
n0p bfab794507 md32: tests and docs for the scq16 table update
test/test_scq16.py: bytes-only checks of the page 42 (cmov.ge, cmov.eq
with a register, the provisional cmov.*?, the remaining sel? codes), the
67 page (mv, bset/btst rd, rd, #pos, and #0x3fff), lbu.post with 5-bit
registers and the 23 page with a signed post-increment, the 6-byte and
#imm16, ctz?/clb?, vcfg4c? #0xc, ld46?, the established vector names
(v.move.mv, v.mem.ld, v.mem.st) next to the provisional ones, addsp 14 8x,
halt, sys41, lbu? off(sp), the 4-byte beq of 5c 40-6f, j.d1 decided by its
target (also in a B slot), the ESIL of the new forms, negative frame
offsets, halt/sys41 without effect and ret.d2 / jr.d2 across two aes
steps (a packet in the first slot).  test/test_md32.c: cmov.ge, mv 67 c8,
j.d1 by target, lbu.post of the 23 page, v.mem.ld.  doc/scq16.md: the
j.d1 length by target, the vector names (established / provisional), the
page 42, 46, 4c, 41 f3, 22/23, 67, 6e and 74 families, the ESIL
conventions (.d2 across two aes steps, 32-bit addresses, no-effect units,
the memory order inside a packet), the hypothetical alternatives of the
table, the limits (rd == rb post-increment, the vector unit), the
data-space bases; README "SCQ16 mode" updates; CHANGELOG entry;
tools/scq16_flags.r2 (DM, I/O window and DM2 bases as flags).
2026-11-02 16:26:48 +01:00
n0p 619f60a7df md32: scq16 table update (228 forms), decoder rules and generator features
isa/scq16_isa.json is re-exported by the `export` command of
tools/gen_scq16_tables.py: 228 forms / 400 bit alternatives.  The ESIL
templates, the delayed transfers (SETJT/SETD) and the hypothetical flag
come from the form-description module itself (its HYP table), so the
exporter applies no overlay of its own.  The vector names carry the ? of
a provisional name in the table string and none when the operation is
established (v.move.mv, v.mem.ld, v.mem.st: vector.firm_op9).  New or
renamed forms: cmov.ge rd, rs, #imm, ra; cmov.eq rd, rs, rx, ra (register
form); the provisional cmov.leu? / cmov.ltu? / cmov.lt? / cmov.le?; mv rd,
rs (67 c8); bset / btst rd, rd, #pos (3 bytes); lbu.post rd, [rb] += inc
with 5-bit registers (6e q2) and the 23 page as lbu.post rd, [rb] += simm3
(-4..-1); and rd, rs, #0x3fff (67 a4-a7); the 6-byte and rd, rs, #imm16
(74 sub 1); the provisional ctz? / clb? (41 f3); vcfg4c? #0xc with the
hypothetical p_k <- rs; ld46? as a hypothetical byte load with a
post-increment; lbu? rd, off(sp) (ex lb?); addsp sp, #imm (14 8x-fx); fxts
without the ?; halt and sys41 with the empty ESIL; the length leaves make
5c 40-6f a 4-byte beq rA, rB.

scq16_decode.c: a first byte 56 with the top two bits of the second byte
clear is the 4-byte j.d1 when its 22-bit target (from the packet start in
a B slot) is a plausible code address, else a formless 2-byte unit
(without a function table the plugin cannot decide by membership).  Every
ESIL memory access cuts its address to 32 bits: the ESIL machine computes
in 64 bits and aes does not mask addresses, so a negative frame offset
over sp wrapped above 4 GB.  The ? of a vector name now comes with the
table string (scq16_vname_firm).  scq16_arch.inc.c: a unit whose ESIL is
the empty string (nop, halt, ieon/ieoff, loopend, vwait?, sys41) no
longer blocks the ESIL of its packet; the override hook counts as the
unit ESIL; opex named / provisional of a vector op follow the table name.

asm_md32.c: pseudo rules of cmov.ge / cmov.leu / cmov.le (the ? of a
provisional name is stripped before the lookup), sys41, ctz / clb.
2026-11-02 16:26:48 +01:00
n0p f4f11b90c3 md32: tests and docs for the uSIP table update 2026-11-02 06:43:08 +01:00
n0p f58de93399 md32: uSIP table update (760 forms), decoder rules and generator features 2026-11-02 06:43:08 +01:00
n0p 58a5ac18e6 md32: English output text for the scq16 loop, jump and trap forms 2026-11-01 20:21:45 +01:00
n0p 9b0adabca8 md32: tests and docs for the scq16 mode
test/test_scq16.py exercises cpu=scq16 inside r2 with loose bytes only
(disassembly of units, packets, vector operations and bundles; analysis;
ESIL; the pseudo parser) and runs from make test; test/test_md32.c gets
three decode checks.  README section "SCQ16 mode", doc/scq16.md and the
CHANGELOG entry.
2026-11-01 20:21:45 +01:00
n0p 219b1f7c07 md32: scq16 cpu mode (table, decoder, arch and asm)
Add cpu=scq16, the SCQ16 variant of the MD32 family with a byte-granular
packet encoding, as a third cpu of the plugin.

isa/scq16_isa.json is the ISA table (218 forms, 389 bit alternatives, the
length-rule leaves of stand-alone units and packet heads, the vector op9
classes and provisional names, the register names) and
tools/gen_scq16_tables.py generates scq16_opcodes.h from it (the VU scalar
ports as ESIL registers, vector operations as the custom op vop, delayed
transfers as SETJT/SETD, the no-effect system forms and the hypothetical
readings flagged).

scq16_decode.c implements the length and packet rule by first-byte leaves
(stand-alone units, packet heads read shifted by one bit with the borrowed
bit of the B slot, masked orphans, 4-byte vector operations, vector heads,
8-byte bundles), the form match over the transformed unit, the operand
text and the ESIL expansion with the parallel-packet register remap and
the VU scalar-port registers.

scq16_arch.inc.c carries the analysis of the SCQ16 decode (types,
jump/fail with the delay slots counted in instructions, do as a loop
reference, loads/stores, stack ops, opex with the unit/packet/bundle
structure), the ESIL (the scalar forms; a packet as A then B with the
registers B reads and A writes copied to temporaries first; delayed
transfers through SETJT/SETD; the VU ports as registers; vector operations
as the custom op vop, a no-op) and the register profile (sp/lr as
csr14/csr15, a0, the loop registers, the VU ports).  arch_md32.c
dispatches decode, info and regs on cpu=scq16 and registers vop through
esilcb; asm_md32.c gets the SCQ16 pseudo-syntax (packets as
parallel { a; b; }, memory, stack, bit-field and transfer rules).
2026-11-01 20:21:45 +01:00
n0p a1b8861f9d md32: tests and docs for the uSIP table update
Plugin vectors for the loop count, the F' = 0 / h = 1 / m = 1 loops
(validated and unverified), the 4- and 3-unit bz.s (validated and unknown),
beq9sp, the bgt rA, #-1 cell, the W6 h = 1 cells and the loop guard, op2z?,
the h = 1 shifts, the 16-bit lea, the splits (R-slot4n, R-op4imm in 2 and
more units, S0-slot, S3), op72?, saturate?, sat40 H H T T, R-waw with the
P2W prefix, R-b111pre, R-b111ctl, R-bsnext, the omitted weak cell of
R-brHHTT, sub r14, st.w [sp], st.abs hi F' = 0, addq / cell E by value,
mtcsr of the accumulator CSRs, R-1eX0F0, R-movi6d; the lea, loop#, mtcsr,
movi #-32768 / #-32767, ld.h / ld.hu of R-1eX0 / R-ldF0 / R-hhttF0 / R-F0d,
op2z? and two R-waw vectors updated to the new readings; pseudo vectors for
the new rules; README, doc/usip.md (the loop cells, the post-layout splits
and the fusion, the explicit candidates, score rules and layout
constraints, the cells added with the table, the unverified fallback and
the order of the packet-level passes) and CHANGELOG.
2026-11-01 18:45:09 +01:00
n0p 85f40b5d6c md32: uSIP table update (726 forms), decoder rules and generator features
Regenerate isa/usip_isa.json and usip_opcodes.h (52 forms added, 13 retired,
14 modified): the loop #N count is the collected head field (bits 13:5, no
+1), loop #N with the F' = 0 tail exactly at +2, with h = 1 (N >= 128) and
with m = 1 (N >= 256, printed loop #N?), bz.s in 4- and 3-unit packets, the
split entries of the slot family stslot / stslot? / ldslot? (F-slot0,
S0-slot, the S3 cells ldslot/stslot #48-63), the fusion entry
op72? rA, #k, asr#b, op2z? rA, lsl/asr r8-r15, #B, the W6 cells
ld.h/st.h rB, [r8+rrr] and [rA]+ with h = 1, sub r14, #f12/2 with any F/F'
(spfix_sub_sp retired), st.w [sp], #imm14, st.abs with the hi F' = 0,
add rB, rB, #imm27 / st.h? [rB], #sat selected by the immediate value (also
the cell-E triples), add? rB, r15, #rot12 and ld.h? / ld.hu? rB, [r15+off]
with the F' = 0 tail, saturate? rd, rs1, movi #simm6 in the delay slot of a
validated branch, mtcsr #0x30-0x3e, ld.h / ld.hu / lea / movi #-32768 /
#-32767 / ld.hu [rA+rB] without the ?; the constraints of beq_imm8_d (the
op 9 beq.d with base sp and the adjacent tail is not a branch) and of the
seven op a *_s0f1 / *_imm8_F0 entries (the bgt rA, #-1 head class takes
only the adjacent S = 1 tail); the ABI passes eight arguments in r0-r7.

The generator emits the flags FUSE, SPLIT / SPLITBARE (with a USIP_FORM_*
index for every split and fusion entry), the constraint op instr_index,
any with up to four alternatives that may be a context condition or an
instruction position and six new context conditions; the loopn operand
type is the collected field.

The decoder keeps the score in twentieths (al1 = 0.3), adds the explicit
candidates loopcand / R-brHHTT / R-b111pre / R-b111ctl with the b111_layout
context extended to them, the bz.s rules of 4- and 3-unit packets (the rest
re-parsed as the delay slot, the 3-unit one with the target beyond the
packet and no write of rA), the S3 renames and the split pass of the slot
family with the split-tail reading and the nowaw guardian, the fusion after
the renames, R-movi6d, the R-w6h1 loop guard evaluated with the packet being
parsed, the R-loopA adjacency (.word at any distance but +2), rf0dmidwaw,
the score rules R-waw / al1 / R-bsnext / P2W-P2H prefix / sat40 H H T T /
rf0dpen and the instruction position of the renames. The loop entries with
the F' = 0 tail at +2 and the h = 1 heads with the S = 1 tail (and the
adjacent F = 0 tail) are accepted unverified; the m = 1 (loop #N?) and the
other h = 1 entries are not.

The arch plugin reports the stores of an immediate ([rB] / [sp], #imm) with
the value in val and [sp] as a stack access; the new mnemonics keep their
kinds (op2z? / op72? / saturate? are unknown operations). Pseudo syntax for
the stores of an immediate (also to [sp]), the absolute st.abs / ld.abs and
the ? of a count (loop#? #256?).
2026-11-01 18:45:09 +01:00
n0p a8d4a6a520 md32: tests and docs for the uSIP table update
Plugin vectors for the F = S = 0 and R-br0 cells (validated by the session,
rejected with fall-through, unknown backward, unverified forward), ret.s.d,
movi #-1 with F = 0, the op 2 shifts, the open b.s rejected and unverified,
bz.s P5, the m = 1 slots, loop.b1? and the ?ss=N loops, movi? #-32767, the
asr16 clamp, the bit-field pair and the BF_SEL cells, ld.bu/st.b with the
byte displacement, ld.b/st.h with F != S at +2 and the undo at +1, the
ld.h?/ld.hu? of R-hhttF0 / R-F0d, the sp adjustment pair, the ld.w?/st.w?
word classes, .stimm16? and mtcsr? with a named tail; the loop, open b.s,
mtcsr, movhi and save vectors updated; pseudo vectors; README, doc/usip.md
and CHANGELOG (the target validation filter, the address views, the F = 0
branch cells, the split and context groups, the new tie-breaks and what the
plugin can see of the guards).
2026-11-01 18:45:09 +01:00
n0p e108f90f79 md32: uSIP table update (687 forms), decoder rules and generator features
Regenerate isa/usip_isa.json and usip_opcodes.h (56 forms added, 3 retired,
71 modified): the b<cond>.d cells with head F = 0 (bne.d, ble.d, bgeu.d,
bge.d, bne.u8.d, beq.u8.d, bleu.d, read only in the (B class, tail distance)
cells of usip_br0_cells; the five weak cells of usip_br0_cells_weak are never
taken), bgt.d of the F = S = 0 cell back in the table, ret.s.d, loop.b1? and
the ?ss=N loops, bz.s with bit 3 = 0, the ld/st type 111 ld.bu / st.b with
the byte displacement (st.b? retired), ld.b / st.h with F != S of op 1
exactly at +2, ld.h? / ld.hu? with the F' = 0 tail as the second head of
H H T T and by the deferred tail of a head with base sp, the bit-field pair
in H H T T and the BF_SEL cells renamed from .bf?, the 16-bit op 2 shifts
lsl/lsl?/asr/asr? (addi4 retired), ldslot/stslot with m = 1, .stimm16?,
ld.w?/st.w? for the f12 = 1 / 3 mod 4 word classes, add r14 / sub r14,
movi? #-32767, movi rA, #-1 with F = 0, mtcsr? of the accumulator CSRs with
a named 16-bit tail; the known target as a validation filter on the
F = S = 0 cells, bne.d #-1, the loops with the F' = 1 tail, the open b.s and
the near b, with fall-through on failure (USIP_F_GUARDFT); the operand
conventions of six families revised. Thirty-one entries are post-layout
renames.

The generator emits the operand type offb, the flags GUARDFT / B111 / F0CTX
(flags is ut32), the constraint ops br0_cells / br0_cells_live, bf_valid,
the guards tail_named16 and target_packet_start_any_or_function_start, the
any sub-operations packet_len, guard, range and br0_cells, the large value
sets (usip_value_sets), the new context conditions and the tables
usip_br0_cells, usip_br0_cells_weak and usip_c48sym_table; form names are
sanitised into C identifiers.

The decoder implements the fall-through guards, the fifth guard kind with
the optional packet_start_any callback, the R-br0 cells by B class and tail
distance, the b111 group in the 2-unit packet and in H H T T (which now
takes tt = 11 tails), the context conditions b111_layout, hhtt_second_head,
f0d_triple, bfpair, bf_dst_not_written and rest_named_no_q, the f0ctx pass
on the .word pairs and the re-read of the R-F0d middle unit, R-op1fs, the
bz_s_P5 context rule, the m = 1 R7 slots, P2H, R-lr16, R-align48 and
R-c48sym in the score, the b.s guard admitting a function start and the
loop F' = 0 rule by field; immediates glued to a letter or '=' print in
decimal. The forms whose guard is a validation filter keep their reading
unverified when the target is unknown (conditional branches only forward);
a definite "not a packet start" rejects them.

The arch plugin initialises UsipGuardCtx by field, separates "not a packet
start" from "unknown" for backward targets with the lowest packet start
decoded in the session, reports offb as a disp operand in opex and sets the
stack deltas of addsp and the add r14, r14, #imm / sub r14, #imm pairs.
Pseudo syntax for the 2-operand lsl / asr.
2026-11-01 18:45:09 +01:00
n0p 5b9a32f8c4 md32: tests and docs for the uSIP table update
Plugin vectors for the 14-bit word displacement, nop.ctl, the bit-field
family, mtacc?, movi? #-32768, sgt #-1, the register bset/bext, the S0F1
branches (unverified, validated by the session, not validated), the r15-based
loads, .ldF0?, the F' = 0 ld.h?, the 48-bit value table, .3eX0?, the
lsl/sext16/zext16 renames, cop with addi, .hi, movhi with the tt = 10 tail
and .op4t0; the op8 slot split vector updated; pseudo vectors; README,
doc/usip.md and CHANGELOG (the post-layout renames, the K-tie cascade and
what the plugin can see of it, the extended target-guard fallback).
2026-11-01 18:45:09 +01:00
n0p 71ab77c46b md32: uSIP table update (634 forms), decoder rules and generator features
Regenerate isa/usip_isa.json and usip_opcodes.h (52 forms added, 12
retired, 103 modified): the 14-bit word displacement of the two-unit
ld.w/st.w, nop.ctl, the bit-field family fxtu/fxts/fup, movi? #-32768, the
register bset/bext, mtacc?, sgt #-1 with F = S = 1, addi #32 next to cop,
the 16-bit lsl/sext16/zext16 variants, the r15-based loads, .ldF0? and the
F' = 0 ld.h?/ld.hu?, .3eX0?, the b<cond>.d cells with the [0][1][tt] tail at
+2, movhi with the tt = 10 tail, the 48-bit constants admitted by value, the
double-class split; the .hi/.hilo pair entries and every not_hi1010
constraint are gone. Twenty entries are post-layout renames.

The generator emits the rename_from lists, the constraint ops tail_adjacent,
ieee_short and the 48-bit value table membership, the tail_adjacent
sub-operation of any, the context conditions cop_rA_in_packet and
not_c48_lo_follows, USIP_MAXVALS 12 and the tables usip_never_tail,
usip_never_head_with_tail and usip_c48_table; the rename entries are exempt
from the 16-bit position-class checks.

The decoder implements W14, the never-tail and never-head-with-tail units
from the tables, H1 (the forced hi(1010) decode is gone; .hi/.lo only after
a 48-bit-family head in the packet), the 48-bit value table in the partial
admission, P2W (no alignment penalty for the 2 mod 4 word offsets in the
H H T T layout), callin through a new guard callback, the post-layout
renames and the K-tie cascade: dedup and nowaw on the tied readings of the
packet, du2 over the neighbouring packets the caller supplies (packet_at /
branch_target callbacks, first-pass readings with USIP_GUARD_NO_CASCADE).
UsipPacket reports how a tie was decided; a failed guard of the op C
compare-and-branch cell prints the pair as .dsp. The unverified fallback
accepts the S0F1 cells whose unverified readings are right in nearly every
case and loop rX with the F' = 0 tail when the head has F = 1 and the S = 1
tail sits at +2.

The arch plugin answers the cascade callbacks with the packets decoded
earlier in the session, the first-pass readings of the packets inside the
bytes at hand and the branch targets seen so far, reports the tie-break in
opex, sets ireg for the r15-based loads and types fxtu/fxts as cast and fup
as or. Pseudo syntax for fxtu/fxts/fup, mtacc, the 2-operand addi,
sext16/zext16 and asr16; nop.ctl reads nop.
2026-11-01 18:45:09 +01:00
n0p b6da363492 md32: tests and docs for the uSIP table update
Plugin vectors for loop# (validated at +1 and +2, unverified), b<cond>.l
(validated, unverified, not taken, 64-bit), the signed 64-bit pairs, the
negative offsets, seq/sle/sgt, movhi, the 16-bit first-slot st.h, the
deferred st.h and its undo by a validated b.s, H H T T, the op8 split, the
0e10 trio, cop with F = S = 0, xor, movi rA!, bset rd!, osl and the
cmulr16/cmuli16 names; the jr, ld.d, movhi and bank-bit vectors updated;
pseudo vectors; README, doc/usip.md and CHANGELOG.
2026-11-01 18:45:09 +01:00
n0p 4932f31af9 md32: cmulr16/cmuli16 names follow the little-endian data memory
The names of 0xDA00 (cmulr16, a*c - b*d) and 0xDC00 (cmuli16, a*d + b*c)
follow the little-endian layout of the data memory: the high half of a 32-bit
complex word is at +2 and holds the real part. The earlier assignment assumed
a big-endian data memory.
2026-11-01 18:45:09 +01:00
n0p cdd0753019 md32: new uSIP mnemonics and conditions in the arch and asm plugins
Conditions bequ/bneu of the 48-bit forms, types for sle (cmp) and osl (shl),
val = N for loop #N, the signed offsets as disp operands in opex; pseudo
syntax for loop#, sle, bequ/bneu, the 2-operand xor, mfacc, the bset family
and osl; the ? marker is stripped repeatedly and ld.d/ld.w are not
sign-extended.
2026-11-01 18:45:09 +01:00
n0p 8b98f544d7 md32: uSIP table update (594 forms) and prior-free packet layout
The uSIP table grows to 594 forms (137 added, 18 retired, 76 modified): the
48/64-bit b<cond>.l prefix forms with the complete condition table, loop #N,
the op 6 set-on-compare family, movhi by its 20-bit value, the 48-bit
constants by one formula, the signed ld.d/st.d, the closed negative
half-word and word offsets, the deferred st.h tail, the position cells and
the slot split.

The generator gains the operand types offh/offw/loopn and the redefined
movhi, the flags ADJDEF/PREFIX/RENAME/HHTT, 8 ranges per field, 64-bit
entries, the constraints gt/odd/packet_len_ge/head_index/head_pos_ge/ctx and
the b.s guard, any with up to three alternatives, the bcc48 condition table
and save w=4.

The decoder matches the prefix forms before the layout, ranks the readings
with the prior-free total order (s0, I, Fv, -A, K) instead of the enumeration
order and the group count, and implements the grammar rules (5e0d never a
tail, the deferred st.h tail with its undo and the validated-b.s guard, the
.d SP-negative rejection, the 3-unit and H H T T candidates with the forced
decode of hi(1010) heads, the 0e10 trio, the loop #N adjacency, the op8
split), the new penalties, the deferred constraints with fall-through, the
late guard evaluation, three tails for the 64-bit forms and the unverified
fallback for the prefix forms and loop #N.
2026-11-01 18:45:09 +01:00
n0p 4ad1a62408 md32: docs for the uSIP table update
README uSIP mode: the F' = 0 control tails, the target guards and what the
plugin can check, the new mnemonics and analysis types.  doc/usip.md: the
packet-model rules R0/R7, the table additions (movhi, base/offset, scale, the
new constraints, kinds io/jr), confidence census, ABI without a classic CSR
bank, and a section on the target-guard knowledge and the fallbacks.
CHANGELOG entry.
2026-11-01 18:45:09 +01:00
n0p 39458c3b5b md32: tests for the uSIP table update
test_plugin.py: vectors for ior/iow, nop32, the 32-bit ret of the sys shape,
jr?, addsp, ld.d?, the first-slot ldslot/lea? forms, movhi? and the guarded
3-unit control packets (loop with the tail at +2 and the end at the next
packet, beqz.d validated by a forward packet start and read as data when the
target is not one, call with the F' = 0 tail read unverified); the mov32 and
ld.b vectors show the bank bit on the register it applies to (r15!).
test_parse.c: the new pseudo rules.
2026-11-01 18:45:09 +01:00
n0p b07fcf44b1 md32: new uSIP mnemonics in the arch and asm plugins
arch_md32.c: operation types for the forms of the updated table: io for
ior/iow (ireg = the port register), rjmp for jr? rB (register jump with the
delay slot of a return), ret for rti, trap for trap?, nop for nop32, add for
addsp, lea for lea?, cmp for sne/scmp?, cast for extu, refptr 8 for the
ld.d?/st.d? pairs; the mnemonic test ignores the trailing ? of the medium
forms; extended CSR names in opex.

asm_md32.c: pseudo syntax for ior/iow, mfcsr/mtcsr, addsp (sp += / sp -=),
ldslot/stslot, jr, nop32, sne, scmp, movhi, extu, cop, rti, ieon/ieoff, idle,
isync, lpexit, trap and the 64-bit loads/stores; the trailing ? marker of
lea?/jr?/call? is ignored.
2026-11-01 18:45:09 +01:00
n0p 58536ef4e9 md32: uSIP table update (475 forms), generator features and decoder rules
isa/usip_isa.json goes from 386 to 475 forms (110 added, 24 retired, 140
modified): port I/O ior/iow instead of mfcr/mtcr, mtcsr and mfcsr with F' = 0,
the sys shape split by its tail field (cop, rti, lpexit?, isync?, ieon, ieoff,
trap?, sys?, ret, ret?, jr?, call rB), nop32, cmov r15, add rB, rA, #rot12 for
the whole op 0 cell, sne, scmp?, movhi?, extu, movi #-1, addsp, lea?, the
stack-slot closers (ldslot/stslot, .slot?, lsl #1/#2, movi #simm6, .bit4?,
.ext8?), ld.d?/st.d? (64-bit pairs), st.b?, ld.hu for type 110, unsigned
12-bit ld/st offsets, ld.bu in the class-E cells, per-operand bank bits
(rB! by x, rA! by m, rs1! by ss), save w=2 = four words; the 48-bit call with
the far tail is retired (those packets are call/b with the F' = 0 tail at +2).

tools/gen_usip_tables.py: the movhi operand type, base as a constant added to
register/immediate fields, scale on immediates, the ge and any constraints,
membership masks for the large CSR sets, the target guards as constraint
records, flag USIP_F_ADJ2, kinds io/jr, the sys name table, extended CSR names
and kind names.  The header stays byte-identical on regeneration.

usip_decode.c: packet guards, adjacency rule and tie-breaks.  F' = 0 control
tails exactly at +2 (otherwise data), target guards evaluated after the mask
match (32-bit forms: a failure is .word, no fall-through; the 16-bit call.s
falls through), packet_len constraints with the real packet length so that
the stand-alone closers never count as named 16-bit ops, closers matched with
bit 15, rules R0 (the final closer may be its own group) and R7 (first-slot
ldslot/stslot/lea? when the rest of the packet is named), the 1dX6 + named
tail and validated-guard tie-breaks; the enumeration order is unchanged.

The decoder asks the caller about branch targets through UsipGuardCtx.  The
arch plugin answers packet starts from the stream: the packets decoded so far
in the session and a scan of the bytes radare2 hands it (64 bytes of
lookahead).  Function starts are not available to an arch plugin, so the
decoder applies a documented fallback: the call / b / compare-and-branch with
immediate forms whose F' = 0 tail sits at +2 and beqz.d are read unverified
(trailing ?, confidence medium, opex.target_guard = unverified); loop, far b,
bnez.d, the register compare-and-branch and the open-packet call.s are
treated as a failed guard.
2026-11-01 18:45:09 +01:00
n0p 3dfb0180d0 md32: changelog note for the emulator test expectation in usip mode 2026-11-01 18:45:09 +01:00
n0p 73831a1ee2 md32: emulator test expects the delayed-return stop in usip mode
With the packet decoder, 5ef9 is ret.d and the rest of the packet is its
delay slot, so md32-run stops with unsupported_delay_slot_execution and
zero completed steps, exactly as for the MS15E30 delayed branch.  README:
make test passes against radare2 6.2.5 on Linux as well.
2026-11-01 18:45:09 +01:00
n0p 68e9f6dfe3 md32: six group-5 16-bit forms missing from the MS15E30 table
rem16, ctz16 and the four complex half-word products (cmulcr16, cmuli16,
cmulr16, cmulci16) occupy 0xCA80-0xCABF, 0xCB00-0xCBFF and 0xD800-0xDFFF,
which the public table leaves undecoded.  Names and operand order follow
the neighbouring group-5 forms; the semantics are inferred from usage
(rem16 as a non-negative modulo, the cmul* variants as the cross-sum and
straight-difference terms) and are marked as such in the source.
2026-10-30 19:53:17 +01:00
n0p 2c54fda563 md32: document the uSIP mode
README: the uSIP mode section (packet model, what one pd line is,
mnemonics and operands, analysis, limitations) replaces the partial
support notes; build note for radare2 6.2.2.  CHANGELOG entry.
doc/usip.md: table format, constraint and context-rule semantics,
confidence levels, ABI, known limitations of the table-driven reading.
2026-10-30 16:28:21 +01:00
n0p a0ccecf534 md32: uSIP packet vectors in the plugin test
Exercise the usip mode on real packets: conditional branch with its tail,
b.s with a 48-bit delay-slot op, call with the S S O O layout (.unit
tails, delay = 3), interleaved 48-bit call.abs, hardware loop reference,
ret.d, the two-unit bz.s context rule, a truncated packet at the end of
the buffer, save/restore/ret and basic blocks that keep the delay slot.
2026-10-30 16:28:21 +01:00
n0p e94cc3060d md32: uSIP pseudo syntax
Pseudo rules for the uSIP mnemonics: # immediates, [base+off], [base]+
and [sp+off] memory operands, compare-and-branch, ld/st as dmemN[...],
movi/mov32, ALU, cmov, loop, save/restore.  test_parse.c updated.
2026-10-30 16:28:21 +01:00
n0p ac1af9c612 md32: wire the uSIP packet decoder into the arch plugin
In usip mode the plugin decodes whole packets (cached per session, 64
entries) and emits one op per run of adjacent units of the same
instruction; displaced tails become .unit ops that name their head.
Types, conditions, jump/fail/delay, loads/stores, immediates, save and
restore, sys and loop references come from the table; opex reports the
form, its confidence, the slot, the unit addresses and the packet
summary.  MAXOP_SIZE is 16 in this mode and regs() exposes the ABI.
The previous five hard-coded uSIP patterns are replaced by the table.
MS15E30 decoding is unchanged.
2026-10-30 16:28:21 +01:00
n0p 94bccea25c md32: table-driven VLIW packet decoder for uSIP
usip_decode.c reads the 16-bit big-endian units of a packet (closed by
bit 15), enumerates the group splits and head/tail assignments the table
allows (heads first, tails round-robin), scores them (unknown units,
instructions, groups, documented tie-break penalties), applies the
adjacency and context rules and returns one instruction per head with
the addresses of its units.  Control flow is restricted to slot 0 and
the rest of an open packet is its delay slot.
2026-10-30 16:28:21 +01:00
n0p 3f8dada173 md32: add the uSIP instruction table and its header generator
isa/usip_isa.json describes the uSIP (MD32 family, VLIW packet variant)
instruction set: 386 forms with masks, operand fields, constraints,
packet rules and a confidence level, plus the packet model (unit scan,
head/tail layout, tie-breaks, context rules) and the register/CSR model.
tools/gen_usip_tables.py generates usip_opcodes.h from it: every field
referenced by a format string or a constraint, constraints as structured
UsipCons records, 16-bit flags and the indices of the context-only forms.
2026-10-30 16:28:21 +01:00
pancake a21d29689b Add support for md32 architecture 2026-10-30 10:31:15 +01:00
pancake 099cb94abf Initial import of the gamegear emulator 2026-10-29 13:35:02 +01:00
pancake de674fbeb0 Add gameboy emulation documentation 2026-10-29 13:30:02 +01:00
pancake f81d48eaca Add gameboy usleep delays 2026-10-29 13:16:44 +01:00
pancake 610dd48707 Fix standalone r2gb test loading and ignore build outputs 2026-10-27 00:35:12 +01:00
pancake c6663b87e9 Initial import of the r2gb plugin 2026-10-27 00:30:24 +01:00
pancake f7dca9d52b Add asynchronous PCM streaming through auq 2026-10-27 00:28:32 +01:00
pancake f2a4b1dfa0 Fix the arpeggio demo 2026-10-26 23:37:46 +01:00
pancake b5b1101110 Fix the doom song 2026-10-26 23:30:34 +01:00
pancake 445c6a5a57 Fix build of r2au 2026-10-26 23:08:44 +01:00
Ricardo J. Rodríguez 5ab2c6aa7d msl: follow spec 1.1.1 register names and thread states
Thread Context (0x0011) changed in Memory Slice spec 1.1.0/1.1.1:
register names are now normative (Table 19g) and the block gained
Suspended/Partial flags, thread states 0x05-0x07 and a per-thread Arch
byte at +0x13.

debug.msl: map the ARM64 aliases fp/lr (and cpsr) that 1.1.0 producers
could write to x29/x30/pstate when seeding (consumer rule 29), using the
thread's Arch byte with the file header as fallback. `dpt` derives the
status letter from ThreadState (r/S/s/z) instead of only the Current flag.

core.msl (`dgm`): never write the fp/lr aliases on ARM64, tag the frame
pointer, status and link registers via r2's BP/SR/LR aliases, and set
Suspended alongside Current since the registers come from a halted
debuggee.
2026-10-26 18:38:36 +01:00
dependabot[bot] 1e989215d9 Bump libc from 0.2.190 to 0.2.191 in /x86iced
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.190 to 0.2.191.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Changelog](https://github.com/rust-lang/libc/blob/0.2.191/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.190...0.2.191)

---
updated-dependencies:
- dependency-name: libc
  dependency-version: 0.2.191
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-10-26 13:48:46 +01:00
dependabot[bot] a2692a2380 Bump libc from 0.2.172 to 0.2.190 in /x86iced
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.172 to 0.2.190.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Changelog](https://github.com/rust-lang/libc/blob/0.2.190/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.172...0.2.190)

---
updated-dependencies:
- dependency-name: libc
  dependency-version: 0.2.190
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-10-13 08:46:15 +02:00
pancake 614d94959e r2ida: import IDB C types into radare2 scripts 2026-09-27 07:36:17 +02:00
pancake 7a0269097b Fix PowerPC disassembler plugin 2026-09-27 07:14:34 +02:00
pancake c8f032c01d Fix MicroBlaze plugin build 2026-09-27 07:05:38 +02:00
pancake 188d102f6b Initial chrome devtools interface for radare2 2026-08-31 19:22:37 +02:00
Abhi 3275d32127 Build CI plugins from checkout 2026-07-29 15:13:39 +01:00
Abhi f4218097d2 Use radare2 GitHub Action in CI 2026-07-29 15:13:39 +01:00
Abhi 96dbf53b1c Fix x86iced for r2 6.1 ABI 2026-07-29 15:13:39 +01:00
pancake e3111fcba3 Remove the r2jadx attic 2026-06-27 18:51:29 +02:00
dependabot[bot] 5b0ea473f9 Bump libc from 0.2.154 to 0.2.172 in /x86iced
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.154 to 0.2.172.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Changelog](https://github.com/rust-lang/libc/blob/0.2.172/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.154...0.2.172)

---
updated-dependencies:
- dependency-name: libc
  dependency-version: 0.2.172
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2026-06-27 18:39:34 +02:00
f28a2ec94c Add plugins for memory slice (msl)
* msl: add Memory Slice (.msl) plugins (io/bin/debug/core)

Loadable radare2 plugins for the Memory Slice process-dump format:

- io_msl    open a slice as a process address space (msl://); verifies
            the SHA-256 block chain and End-of-Capture FileHash on open,
            warning on a truncated or tampered slice
- bin_msl   parse a slice as a CORE object (arch/bits/os, entry, maps)
- debug_msl emulated ESIL debug backend, incl. reverse exec (dsb/aesb)
- core_msl  producer: "dgm"/"dgma" write a slice from a live debug session

Build/install with the local Makefile (pkg-config r_core) or via r2pm.
test/genmsl.py emits a valid synthetic slice for exercising the read path.

* msl: select and list captured threads in the debug backend

A slice can capture several threads (one Thread Context block each); the debug
backend only seeded the Current thread. Expose every captured thread:

- .threads callback: `dpt` / `dptj` lists each captured thread with its PC.
- .select callback: `dpt=<tid>` re-seeds the register file from that thread
  and seeks to its captured PC, so any thread can be emulated.

msl_seed_regs now takes a target tid (>=0 exact, <0 Current with first-thread
fallback) and reports the chosen tid, which msl_ensure stores in dbg->tid.

Also fixes a double-unref of the mmap buffer (msl_seed_regs used to unref a
buffer owned by its caller), and accounts for r_debug_select swapping the
register arena after .select returns (seed both arenas so the new thread's
registers survive the swap). test/genmsl.py gains --mt to emit a second,
non-Current thread for exercising listing and selection.

* msl: resolve module symbols and PE exports in bin.msl

The bin plugin presented a slice as maps only. Parse ModuleEntry (0x0002)
blocks and expose them as libraries (`il`) and symbols (`is`): one symbol per
module base plus, for PE images whose headers are captured, one FUNC symbol per
exported function at its address. A VA->file-offset translator over the
captured-run maps reads the module image (DOS/PE headers, export directory).
radare2 then names call targets -- `sym.kernel32.dll_CreateFileW` -- instead of
bare addresses.

test/genmsl.py gains --pe (a minimal in-memory PE export table) and a
memory_region() helper. ELF .dynsym resolution is left to the Python tools.

* msl: note thread listing/selection in the plugin table

The debug.msl row documented reverse execution but not the `dpt` / `dpt=<tid>`
thread listing and selection; mention it for consistency with the body.

---------

Co-authored-by: Ricardo J. Rodríguez <ricardo@thanatos>
Co-authored-by: Claude Opus 4.8 (1M context) <[email protected]>
2026-06-27 09:51:49 +02:00
pancake 80925aeba6 r2jadx: Use r2.log instead of console.log 2026-05-11 15:44:41 +02:00
pancake 45f9bc841c r2jadx: Use better r2js and improve xrefs caching and more 2026-05-11 12:09:41 +02:00
pancake 69f93467a1 r2jadx: refactor into separate files 2026-05-11 07:53:17 +02:00
pancake 67b24be239 r2jadx: add -s to search words 2026-05-11 07:43:26 +02:00
pancake cd9cc5c190 r2jadx: add pd:j alias 2026-05-11 07:26:42 +02:00
pancake 568a7fd146 r2jadx: config -e with optable color and addresses 2026-05-11 07:22:21 +02:00
pancake d276feb5e8 Fix help message for r2jadx 2026-05-11 06:11:22 +02:00
pancake c3b9864f1d Rewrite r2jadx to typescript 2026-05-10 09:57:56 +02:00
Nerijus Bendžiūnas 7a6e3737c8 fix(r2k): allow Linux module to compile using clang
__FORCE_ORDER is a GCC-specific input constraint not supported
by clang. Use a "memory" clobber on clang instead.

Signed-off-by: Nerijus Bendžiūnas <[email protected]>
2026-02-28 17:46:22 +01:00
pancake 430b6fa559 Minor fix for the rar cpu code 2026-01-09 07:29:22 +01:00
pancake 1cf58513ad Fix r2doom build 2025-10-03 23:15:11 +02:00
Takumi Matsuura da8623bdbe Change to prioritize using uv 2025-10-03 13:58:38 +02:00
pancake 43057468c6 Add r2604 badge 2025-09-30 14:07:19 +02:00
pancake 7ed4cb393f Assume keys in afen can have spaces 2025-09-30 14:05:07 +02:00
pancake 031b7c20c0 Implement 'afen*' command to dump the database 2025-09-30 14:01:32 +02:00
pancake 9edd5e922b Release 6.0.0 2025-09-22 18:38:39 +02:00
satk0 dea1f62f8f Remove global var in afen 2025-09-22 15:54:03 +02:00
pancake e9306ef9fe Fix x86iced build for r2-6.0 2025-09-16 17:10:17 +02:00
pancake 941e0e8f81 Fix the VC4 build 2025-09-16 16:41:11 +02:00
satk0 fdcf847944 Make afen work 2025-09-16 15:41:57 +02:00
pancake e9035eda1c Rewrite all the asm plugins into arch ones 2025-09-04 12:08:37 +02:00
pancake f2d4e0d371 Fix vc4 build 2025-09-04 11:17:25 +02:00
pancake f06bef6f21 Do not build afen 2025-09-04 01:06:35 +02:00
pancake aac87e940d Fix build of the bin.gguf plugin 2025-09-02 19:38:24 +02:00
Abhi 6c0afb35c2 r2angr: fix latest cmake issues on termux (#386)
* fix latest cmake issues on termux

Affected packages: unicorn, pypcode

* pin angr version

angr since `9.2.155` moved to rust toolchain, which can't be compiled in termux due to bug in rustc not us.

* Update angr

just in case user installed r2 from package manager

* small fixes

* fix: illegal number

```shell
r2angr: 8: [: Illegal number:
```
2025-08-30 01:39:59 +02:00
pancake 1b276095d4 Add a chiptune song created with r2ai 2025-08-27 18:33:22 +02:00
pancake e90d99b9f4 Add more openai-generated versions of the "doom song" 2025-08-27 18:06:47 +02:00
pancake e0bb03cdd1 Fix r2au for the r2-6.x 2025-08-27 17:38:01 +02:00
pancake 6c9df38c66 FIx vc4 and blackfin 2025-03-13 19:27:49 +01:00
pancake 38e79b50b1 Fix build with latest r2 from git 2025-03-12 16:28:10 +01:00
pancake b03125fc99 Move rlcc from libr/egg/rlcc and shlr/mpc 2025-02-06 23:02:37 +01:00
pancake 36f9503eda Fix gguf plugin name 2025-02-06 19:18:10 +01:00
pancake 3a25b7f345 Fix hexagon install 2024-12-11 15:31:52 +01:00
pancake b91c295be3 Remove awful function and warning from squashfs 2024-12-04 16:47:19 +01:00
pancake 9e4c70872e Fix build of fs-squashfs 2024-12-04 11:50:32 +01:00
pancake 94f8d2dc94 Update build instructions for the r2k plugin 2024-12-02 15:37:00 +01:00
pancake 89624cc37c r2k: Fix write on protected regions, lock RCU when acessing tasks fixing races 2024-12-02 15:32:27 +01:00
NighterMan 42aed83113 Fix r2k-linux build on latest Linux kernels 6.4.x 2024-12-01 23:52:32 +01:00
pancake 4d944cce9a Release 5.9.6 2024-11-05 18:30:09 +01:00
pancake 49a91651d2 Fix invalid pfb string in r2svd when the bitstruct have 0 fields 2024-10-31 08:50:51 +01:00
Roman Valls Guimera 3596e7f1a5 Repoint cmsis-svd repo to upstream cmsis-svd org 2024-10-22 06:52:53 +02:00
Abhi 54ff412976 Fix setup on termux (#367)
* Fix installation on termux
* remove binutils & build-essential
  * They should already be present if the user has installed R2.
* remove un-necessary install
2024-10-21 17:49:49 +02:00
dependabot[bot] 3d2fa7985b Bump serde_json from 1.0.124 to 1.0.132 in /x86iced
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.124 to 1.0.132.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.124...1.0.132)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2024-10-21 17:49:10 +02:00
pancake 3064bbcb7f Fix license names 2024-10-21 17:48:39 +02:00
pancake 97d8b87bf5 Fix license name for blackfin 2024-10-21 17:48:35 +02:00
pancake 26450ea9b9 Fix the CI 2024-09-30 20:10:22 +02:00
pancake 14d385082c Inverse r2 version check for r2svd 2024-09-30 13:10:12 +02:00
pancake 3a92956545 os.path.join is UB. thank you py3 2024-09-30 12:41:05 +02:00
pancake 5ef0b34d57 Install r2svd with symlink 2024-09-30 12:30:36 +02:00
pancake 57f3c159e0 Setuptools is dead, not just deprecated. workarounding with more hacks 2024-09-30 12:26:21 +02:00
pancake 991ee0f685 Setuptools was deprecated, so we need it now 2024-09-30 12:19:41 +02:00
pancake 4e72a04103 Join paths properly 2024-09-30 12:16:14 +02:00
pancake 9a61bb6f7d Use our cmsis-svd fork 2024-09-30 12:15:39 +02:00
pancake 9c22aa709d Parse register fields and support ascii art stuff for r2svd 2024-09-29 19:23:14 +02:00
Roman Valls Guimera ccefb4237d Fix setuptools deprecations and switch to version-1.0 of cmsis_svd 2024-09-29 12:11:59 +02:00
Roman Valls Guimera ef93ab4c91 Deprecate setuptools:
% r2svd --help
/Users/rvalls/.local/share/radare2/prefix/bin/r2svd:9: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  import pkg_resources
2024-09-29 12:11:59 +02:00
sha0coder 496b46918b r2ida first version 2024-09-27 22:05:03 +02:00
Nitan Alexandru Marcel 82b3a8e97d Use TMPDIR env or fallback to /tmp for temporary log file (#360) 2024-09-05 16:27:41 +02:00
pancake 0350bec1e7 One venv for angr and arg for structurer 2024-08-31 16:18:57 +02:00
pancake 6e06bcd365 Force the latest capstone to fix angr on arm64 boxes 2024-08-31 16:11:48 +02:00
pancake b170500a27 Honor R2_BADDR in r2angr if set 2024-08-29 20:54:47 +02:00
pancake ece2da866a Show r2poke version 2024-08-29 20:53:41 +02:00
pancake fecf53943b Enable the alien tokens for gnupoke4 2024-08-29 20:53:36 +02:00
pancake dda5cb2d70 Improved output and hints for r2angr 2024-08-29 18:31:16 +02:00
pancake ebe772353a oops 2024-08-29 18:22:22 +02:00
pancake d6f4f63aca Add r2angr wrapper script for decompiling 2024-08-29 17:55:45 +02:00
pancake 343dce1014 atombios not ported, but at least dont break the build 2024-08-26 10:55:50 +02:00
dependabot[bot] 3bb3fbf753 Bump serde from 1.0.201 to 1.0.208 in /x86iced
Bumps [serde](https://github.com/serde-rs/serde) from 1.0.201 to 1.0.208.
- [Release notes](https://github.com/serde-rs/serde/releases)
- [Commits](https://github.com/serde-rs/serde/compare/v1.0.201...v1.0.208)

---
updated-dependencies:
- dependency-name: serde
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2024-08-19 10:53:02 +02:00
dependabot[bot] 42131f6bd6 Bump serde_json from 1.0.117 to 1.0.124 in /x86iced
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.117 to 1.0.124.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.117...v1.0.124)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <[email protected]>
2024-08-19 09:25:47 +02:00
satk0 663b25a8fc Make afen function specific (#351) 2024-08-01 22:43:01 +02:00
pancake b0f48b0194 Support GNU Poke4 for r2poke 2024-07-11 17:08:10 +02:00
satk0 6e4ece2732 Fix rparse to rcore binding for afen (#346) 2024-06-25 18:07:32 +02:00
Sylvain Pelissier 628a9d20d0 Update ci.yml with afen plugin
Add r2afen build in CI.
2024-05-22 08:16:50 +02:00
pancake 315256b0ef Release 5.9.0 2024-05-21 17:18:27 +02:00
satk0 eef6f4a39f Fix to make afen installable 2024-05-20 17:38:01 +02:00
satk0 306cc36d80 Add possibility to build afen plugin 2024-05-20 07:36:08 +02:00
satk0 39f897acfe Mention pancake help in README 2024-05-20 07:36:08 +02:00
satk0 33c681dadf Add an example usage 2024-05-20 07:36:08 +02:00
satk0 fd6d8979ea Add afen plugin 2024-05-20 07:36:08 +02:00
Sylvain Pelissier 167e5c48b2 Update ci.yml with VC4 test
Brings back the VC4 test in CI.
2024-05-13 08:17:46 +02:00
Sylvain Pelissier 82d0276127 Update ci.yml with x86iced plugin
Add x86iced pulgin in CI.
2024-05-12 07:40:36 +02:00
GRAUX Pierre d9273fc53e Enable CI for vc4 plugin 2024-05-11 23:49:37 +02:00
GRAUX Pierre 26d8b75ffe Remove compilation warnings for vc4 plugin 2024-05-11 21:12:56 +02:00
GRAUX Pierre fc38eb7862 Add instruction analysis information for vc4 plugin 2024-05-11 21:12:56 +02:00
GRAUX Pierre da11f75c73 Translate the vc4 plugin from asm to arch 2024-05-11 21:12:56 +02:00
pancake 7be547f648 Some minor improvements for r2jadx 2024-05-10 20:37:25 +02:00
Richard Patel 31fba0eafd x86iced: add register access info 2024-05-09 08:37:58 +02:00
Richard Patel 77269480b3 x86iced: support mnemonic 2024-05-09 08:37:58 +02:00
pancake 8903ddf7ef r2sarif is now in a separate repository 2024-05-09 01:59:40 +02:00
Richard Patel a88eecf962 x86iced: fix crash 2024-05-08 14:54:20 +02:00
Richard Patel f912df64a2 x86iced: add metadata
- Enable Dependabot so we get automatic PRs for iced-x86 updates
- Add Cargo metadata (disable publish, MIT license, description)
2024-05-08 14:54:20 +02:00
pancake 6dd7921729 Rename r2iced to x86iced 2024-05-07 17:42:37 +02:00
pancake ae05525a78 Add makefile for r2iced. Rename to x86-iced 2024-05-07 17:02:03 +02:00
Richard Patel 78f4e70ca7 r2iced: support AT&T, masm syntax 2024-05-07 15:59:51 +02:00
Richard Patel ec94bfcd50 Add r2iced 2024-05-04 14:24:13 +02:00
Sylvain Pelissier 6de9a49e88 Update ci.yml
Bring back blackfin build in CI
2024-05-01 14:30:39 +02:00
GRAUX Pierre a36564eaa9 Fix blackfin plugin compilation 2024-04-29 18:05:22 +02:00
pancake ccc7d46e92 Initial work to support revng decompiler for r2, for now just a docker image 2024-03-29 17:36:39 +01:00
pancake 6c21ca2a7d Implement sarif -i to import findings 2024-03-10 20:20:56 +01:00
pancake adf9e7aca8 Make rules supported by sarif generic from external file instead of hardcoded 2024-03-10 20:08:16 +01:00
pancake d1f90741b0 Initial working version of Sarif and add a couple of finding types more 2024-03-01 16:59:06 +01:00
pancake bb15dc4562 Add Makefile, readme and some more code for the Sarif plugin 2024-02-29 12:43:03 +01:00
pancake 90567f4c80 Add sample sarif script for r2 2024-02-19 19:41:16 +01:00
silur e8d1cb20b2 remove libr/asm/arch/evm 2024-02-09 23:26:29 +01:00
pancake 98e6d29133 leftover? 2024-02-07 09:42:51 +01:00
pancake e5ef780da8 Rewrite the r2jadx plugin into r2js
* nodejs code was broken because syspipe was no longer compatible with latest node
* This is very experimental
2023-12-05 20:28:35 +01:00
pancake 6f8c8f0836 Initial import of the GGUF bin plugin 2023-11-21 11:26:25 +01:00
Sylvain Pelissier c28cf25f7a Fix CI badge 2023-10-30 21:48:26 +01:00
Sylvain Pelissier 6a7a636ebe Update ci.yml with asahi plugin
Add asahi build in CI
2023-10-23 13:38:20 +02:00
pancake e3b6897bda apt update 2023-10-19 21:39:01 +02:00
pancake 209c82d674 Bump ubuntu and checkout version 2023-10-19 21:37:46 +02:00
pancake e68f98a223 Fix build of the asahi plugin 2023-10-19 21:30:18 +02:00
pancake 84aa166231 r2ai has been permanently moved into its own repository 2023-10-16 14:37:20 +02:00
pancake a005f0402b Add support for tinyllama queries 2023-10-16 14:30:18 +02:00
pancake 1a1e68a882 Remove unused code_interpreter.py 2023-10-16 01:35:46 +02:00
pancake 68a8e3d4e5 Add conversational example and refactoring the templater logic in r2ai 2023-10-10 00:18:02 +02:00
pancake 7d6afc0855 Support multiple AIs instances 2023-10-09 21:31:13 +02:00
pancake a0fd4013b0 Always decolor the command queries and improve <<SYS>> prompt 2023-10-09 20:43:44 +02:00
pancake dd78a53a1a Fix r2ai from shell 2023-10-09 18:58:19 +02:00
pancake 5a13ac3032 More cleanup and tweaks for r2ai 2023-10-09 12:37:33 +02:00
pancake d3fe9b7223 Use r2lang.cmd if needed 2023-10-09 12:14:22 +02:00
pancake 90b782e683 Add uninstall target 2023-10-09 12:06:33 +02:00
pancake 36feb1733c Add make user-install 2023-10-09 12:06:01 +02:00
pancake 0fd38b8121 Add live mode option to fully integrate r2ai with r2js 2023-10-09 11:53:07 +02:00
pancake 229188050e Remove r2ai/cli 2023-10-09 10:54:32 +02:00
pancake 31a841c561 Use rlang if available, so we can register a core plugin for r2ai 2023-10-09 10:48:33 +02:00
Sylvain Pelissier 5469876cfa Remove r2yara from ci.yml
Now in it's own package
2023-10-06 22:19:51 +00:00
pancake 8c90086fc2 Remove r2yara because it's now living in its own repo
* https://github.com/radareorg/r2yara
2023-10-06 16:45:29 +02:00
Sylvain Pelissier 82734d3371 Uptade CI 2023-10-03 10:09:44 +00:00
pancake edeadec44c Add 'model' command and bring back the hugging face download 2023-10-03 00:44:47 +02:00
pancake d5a88f6b41 Fix yara 'scan S' regression and add short command 'yr' 2023-10-02 12:29:33 +02:00
pancake 4f67e1af9a Add yara version command in r2yara 2023-10-02 12:08:26 +02:00
Sylvain Pelissier e1ace49642 Update core_yara.c
Fix options parsing.
2023-10-02 09:35:24 +00:00
pancake 046db11e95 Fix segfault in yara scan 2023-10-02 11:22:46 +02:00
pancake e1edea1405 Prepend cwd in model path 2023-09-29 02:30:52 +02:00
pancake a5a042cecc Fix crash and improve chat model query construction 2023-09-28 11:25:05 +02:00
pancake d91308a818 Support uncensored models, more tokens and custom query templates 2023-09-28 10:37:12 +02:00
pancake bb205b2607 Add torrent file for the models 2023-09-27 17:28:33 +02:00
pancake 3636cc53ff Fix r2poke build 2023-09-26 23:16:38 +02:00
pancake b652ff1305 Add r2ai.pdf 2023-09-26 16:42:02 +02:00
pancake e50cfcc008 Fix r2yara null deref and help message 2023-09-26 11:39:34 +02:00
pancake 7044515214 Fix build of the keystone plugins 2023-09-26 11:25:44 +02:00
pancake 1c83c693ba Update gitignore 2023-09-26 11:22:40 +02:00
pancake d3f44531c7 path fixes for r2yara 2023-09-26 11:21:00 +02:00
pancake 9a2cd79b6c Move yara/yara into r2yara 2023-09-26 11:17:37 +02:00
pancake 44ae4f46c5 Update r2yara core plugin to fix build and fix other UB bugs 2023-09-26 11:01:00 +02:00
pancake 296ff27e42 py3 just in case 2023-09-25 20:33:24 +02:00
pancake 400d67c472 Download the cherrypop model 2023-09-25 20:24:42 +02:00
pancake 01ef784858 r2pm init is deprecated 2023-09-22 17:56:49 +02:00
pancake 8a2c686105 More fixes for r2ai to handle ^C and solve installation issues 2023-09-22 13:28:32 +02:00
pancake d12ef02a13 Add env, improve prompt, clear screen, better prompting, etc 2023-09-22 12:45:27 +02:00
pancake 3fcb7ecf9b Fix prompt glitches in r2ai 2023-09-21 02:50:14 +02:00
pancake e7c8f4e7e5 Initial implementation of the local r2ai based on open-interpreter
* Improved shell with, $role :slurp !r2 !!r2pipe commands
* See readme for default model download
2023-09-21 02:08:28 +02:00
robman2444 848a1b2eeb added -fPIC to hexagon makefile. Kindof a kludge, but it works 2023-09-16 00:01:56 +02:00
pancake 1947df56fd Missing file 2023-09-15 16:27:33 +02:00
pancake c12d4badff Fix crash 2023-09-12 22:28:55 +02:00
pancake fd3871893a Reword the anal and asm hexagon plugins into an arch one 2023-09-12 22:08:55 +02:00
pancake 0a7590f748 Add hugging face test script 2023-08-18 16:04:02 +02:00
pancake 9ae0981f5a Improve optimized decompilation with bard 2023-08-01 12:56:54 +02:00
pancake bdb04b54fa Minor help improvement for bard 2023-07-19 18:42:34 +02:00
pancake 1318082a67 Make the bard script a plugin 2023-07-19 18:30:03 +02:00
pancake e72b5010c8 Add bard setup instructions 2023-07-18 13:50:54 +02:00
pancake 9b5b0013f9 Add hello world for r2ai with Google Bard 2023-07-18 13:49:05 +02:00
pancake c4b7f76081 Fix unicorn build with latest r2 2023-07-11 16:31:18 +02:00
pancake 71eb56d619 Add r2doom ai-image logo 2023-06-19 11:04:27 +02:00
pancake d3911fa5a5 Add support for delimited alien tokens in r2poke 2023-05-18 16:55:53 +02:00
pancake 5cf30b4af2 Fix enemy's health 2023-05-18 15:17:54 +02:00
pancake 0b983e477e Add beep support to r2doom 2023-05-18 11:23:33 +02:00
pancake 822a45ab18 Go realtime in r2doom 2023-05-17 12:12:17 +02:00
pancake cd4e396bcd Rename sysz to s390x and add evm to keystone 2023-05-15 12:32:28 +02:00
pancake 22f196cecc Implement strife, locked doors, ascii perspective, better damage, flash weapon when shooting 2023-05-15 10:48:59 +02:00
pancake f8dea3b7e2 Fix x86.ks 2023-05-14 22:08:38 +02:00
pancake 3a7484b467 Fix build of the keystone plugins 2023-05-14 22:07:30 +02:00
pancake 4901c49c4e Fix r2au assembler, visual piano, phone and other demos 2023-05-14 21:44:42 +02:00
pancake 90765cc641 Minor improvements for the r2au plugin 2023-05-13 21:29:03 +02:00
pancake f665a9eb11 Update r2au plugin for r2-5.8.x 2023-05-13 21:08:37 +02:00
pancake e0a8b8b3e3 Fix shooting and damage computations 2023-05-13 20:13:25 +02:00
pancake 3584dee33b Handle arrow and wasd keys in r2doom 2023-05-13 20:04:05 +02:00
pancake 0c113bdea8 Faster clear primitives to fix the blinking hud in r2doom 2023-05-13 19:50:10 +02:00
pancake 23fc638c27 Fix collisions precission bug in r2doom 2023-05-13 19:35:25 +02:00
pancake 7d67e6343d Fix infinite loop on large screens running r2doom 2023-05-12 12:36:07 +02:00
pancake ad95329c1e facepalm 2023-05-09 11:49:08 +02:00
pancake d10a5257cd glibc fix 2023-05-09 11:41:58 +02:00
pancake 9896414afb Fix linux build 2023-05-09 11:37:26 +02:00
pancake a599c6c2d6 Add screenshot and fix the readme 2023-05-09 11:25:19 +02:00
pancake ba754bed7b Fix linux build of r2doom 2023-05-09 11:08:13 +02:00
pancake a745e3cd65 Initial import of the r2doom 2023-05-09 10:56:05 +02:00
pancake 4235786fab Fix #322 - filter newlines in comments 2023-03-10 12:46:06 +01:00
pancake 6fc39af6e2 Support call commands in r2svd if available 2023-03-10 12:42:41 +01:00
pancake 6a0781ab3f Add initial json.pk for r2poke from mnabipoor <3 2023-02-28 00:30:13 +01:00
pancake c31f8fb226 Fix reg profile for blackfin 2023-02-27 00:22:41 +01:00
pancake 831b8579ee Upgrade the blackfin disassembler from latest -plus code 2023-02-27 00:03:31 +01:00
pancake 6bd03e5642 Improve the blackfin analysis details 2023-02-26 23:38:28 +01:00
pancake 77c8e95061 Translate the blackfin plugin from asm to arch 2023-02-26 19:33:48 +01:00
pancake 730aff1b19 Use rpath for home's poke 2023-02-16 20:28:46 +01:00
pancake eba95758d2 Support alien tokens thanks to the cuki lexic
* WIP: Use $r2cmd::.... to run commands or resolve flags
2023-02-16 17:21:43 +01:00
pancake 9836aa3b73 r2poke: Add eprint and use it from the runtime exception handler 2023-02-16 17:04:44 +01:00
pancake ab97757ada Implement eprintf() for the r2poke 2023-02-16 16:58:19 +01:00
dependabot[bot] ad856dee2d Bump minimist and mkdirp in /r2jadx
Bumps [minimist](https://github.com/substack/minimist) and [mkdirp](https://github.com/isaacs/node-mkdirp). These dependencies needed to be updated together.

Updates `minimist` from 1.2.0 to 1.2.6
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/commits)

Updates `mkdirp` from 0.5.1 to 0.5.6
- [Release notes](https://github.com/isaacs/node-mkdirp/releases)
- [Changelog](https://github.com/isaacs/node-mkdirp/blob/main/CHANGELOG.md)
- [Commits](https://github.com/isaacs/node-mkdirp/compare/0.5.1...v0.5.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
- dependency-name: mkdirp
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
2023-02-16 16:28:28 +01:00
pancake 07c8150329 Initial the exception handler and open the R2 io device 2023-02-16 16:27:52 +01:00
pancake 913874da41 Add runtime exception handler for r2poke 2023-02-16 15:48:03 +01:00
pancake 75a4f63391 Improve the poke plugin 2023-02-16 00:46:35 +01:00
pancake d834af469c Link to the system wide poke 2023-02-09 22:38:06 +01:00
pancake 7e0235ea45 Add the fosdem 2023 slides 2023-02-08 11:01:01 +01:00
pancake e49a1bb2e3 Build fixes 2023-01-19 16:50:40 +01:00
pancake c563cdd8f8 More standard makefile stuff 2023-01-19 11:47:35 +01:00
pancake bb4a2bdb6d Show help on poke 2023-01-19 11:37:59 +01:00
pancake 97070385b4 Initial import of the r2poke plugin 2023-01-19 03:58:54 +01:00
pancake 18d26928e6 Fix m32c build for r2-5.8 2023-01-17 17:32:05 +01:00
pancake 5baebd4620 Initial publication of the EAST decompiler (Vlang)
* It's just a PoC that aims to combine the vlang compiler internals
* Feel free to play or contribute! I wrote pdq based on this codebase
* Based on ESIL parsing and analysis to create an AST that can be
* printed into C-like syntax.
2022-12-30 12:20:37 +01:00
pancake d034b2769a Release 5.8.0 2022-12-23 11:33:24 +01:00
pancake 0cea6e28e4 Better name for the r2addrline script 2022-12-08 05:11:23 +01:00
pancake 9689796965 Add script to convert addr2line output to r2 CL script 2022-12-08 05:05:27 +01:00
pancake 8fe16da993 Add the daila question 2022-12-06 16:41:02 +01:00
pancake 52439a5845 Improve the readme 2022-12-02 21:05:16 +01:00
pancake e27b7bfe3c Initial import of the r2ai plugin PoC 2022-12-02 21:01:07 +01:00
dependabot[bot] 9962027deb Bump minimatch from 3.0.4 to 3.1.2 in /r2jadx
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.1.2.
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.1.2)

---
updated-dependencies:
- dependency-name: minimatch
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>
2022-11-30 21:30:28 +01:00
lgtm-com[bot]andLGTM Migrator 79bf9fa5ba Add CodeQL workflow for GitHub code scanning (#319)
Co-authored-by: LGTM Migrator <[email protected]>
2022-11-30 18:34:09 +01:00
pancake b74faa00f2 Add malbolge plugin taken from r2 master 2022-11-13 20:56:03 +01:00
pancake 88a5de0331 fix leak in the world 2022-10-18 22:29:29 +02:00
pancake fe805b5781 fix pwm for negative positions 2022-10-06 19:28:42 +02:00
pancake 33cc031b38 Use RCons.printf in pwm 2022-10-06 00:24:19 +02:00
pancake 39d6a3e9c9 Add pwm plugin to print world map 2022-10-05 22:45:08 +02:00
pancake 5cda6a599e Fix keystone build on latest r2 2022-09-30 12:33:34 +02:00
pancake 245716be19 Use pkg-config for keystone instead of assuming its in libdir 2022-09-30 12:31:35 +02:00
pancake f8137fd314 Expose the +R2PM_USRPLUGIN_DIR for yara 2022-09-29 18:46:22 +02:00
pancake fe4e54b50e expose LIBEXT 2022-09-29 18:45:05 +02:00
pancake 790c02b9ce Support the new xdg apis in the yara plugin 2022-09-29 18:44:07 +02:00
Sylvain Pelissier acbb8a7c0f Remove EVM from CI
The code is moving to core.
2022-09-24 17:28:11 +02:00
Sylvain Pelissier b557dc24a0 Merge pull request #316 from radareorg/evm
Correct EVM opcode max representation length
2022-09-12 17:32:58 +02:00
Sylvain Pelissier c4594ce486 Correct EVM opcode max representation length 2022-09-12 17:22:08 +02:00
Sylvain Pelissier 40a6d34bea Merge pull request #315 from sylvainpelissier/ci
Correct check_buffer for bcl, atombios and pcap.
2022-09-11 23:14:51 +02:00
Sylvain Pelissier 38e369a367 Correct check_buffer for bcl, atombios and pcap. 2022-09-11 22:58:00 +02:00
Sylvain Pelissier af3214df2c Update ci.yml
Bring back yara test
2022-08-22 15:29:59 +02:00
Sylvain Pelissier 88aaebc6ee Update README.md
Change link to plugins documentation.
2022-08-18 09:25:09 +02:00
Sylvain Pelissier 9d82adef43 Temporary disable yara test in CI 2022-08-17 15:15:17 +02:00
Sylvain Pelissier 4779456cd6 Bring back evm, vc4 and yara tests in CI 2022-08-17 15:02:16 +02:00
Sylvain Pelissier 4a795e0b30 Temporary disable r2pipe-go in CI 2022-08-17 14:05:26 +02:00
Sylvain Pelissier bec354d82c Temporary disable swf test in CI 2022-08-17 11:00:59 +02:00
Sylvain Pelissier 0ab8603f0c Update x86 BEA build 2022-08-17 10:39:16 +02:00
Sylvain Pelissier d5add35cd5 Update ci.yml
Add libcurl to CI build process.
2022-08-17 09:57:58 +02:00
Richard Patel 15b05687ae Move BPF to radare2 (#310) 2022-08-01 18:21:21 +02:00
pancake 14f68e9388 import dcpu from r2. as its now a dead arch 2022-06-28 16:39:48 +02:00
Sylvain Pelissier a4f8842bd8 Merge pull request #308 from radareorg/sylvainpelissier-yara
Temporary disable yara in CI
2022-05-09 08:42:48 +02:00
Sylvain Pelissier 55cc028778 Temporary disable yra in CI
Until finding why it does not pass in CI but it pass locally.
2022-05-09 08:30:05 +02:00
Sylvain Pelissier baa29e633a Correct builds 2022-05-08 22:21:29 +02:00
pancake 165b565eb2 More work on the unicorn plugin 2022-05-07 13:05:46 +02:00
pancake 053f774462 Initial mmio support for unicorn 2022-05-07 12:47:08 +02:00
pancake 002b26d5e9 unicorn: Add support for the new command interface 2022-05-07 12:06:21 +02:00
pancake 2dd9a63faa fix null deref in unicorn 2022-05-07 01:04:16 +02:00
pancake 5af97a31d2 Fix arm64 unicorn init 2022-05-07 01:02:59 +02:00
pancake e8099c7b14 codesign when installing debug plugins for latest macOS 2022-05-07 00:47:08 +02:00
pancake 5a78bcb402 codesign unicorn 2022-05-07 00:29:40 +02:00
pancake 8a0da3c5b7 Add support for mips in unicorn 2022-05-07 00:22:21 +02:00
Sylvain Pelissier ed8e9d96d7 Correct EVM and Z80 builds 2022-05-04 09:27:46 +02:00
Sylvain Pelissier a1bc103782 Correct microblaze and x86zyan builds 2022-05-03 16:53:01 +02:00
Sylvain Pelissier c56286efdb Correct blackfin, evm and vc4 builds 2022-05-02 22:24:38 +02:00
Sylvain Pelissier adb999852e Correct bea and ppcdisasm builds 2022-05-02 19:55:58 +02:00
Sylvain Pelissier 3254c72bc6 Merge pull request #307 from radareorg/x86udis
Correct x86udis build
2022-05-02 19:14:38 +02:00
Sylvain Pelissier 575bfec497 Correct x86udis build 2022-05-02 19:03:51 +02:00
Sylvain Pelissier 6a3d97082b Correct keystone build 2022-04-28 22:54:18 +02:00
pancake 5c172dcb55 Release 5.6.8 2022-04-26 11:52:16 +02:00
pancake 64b81544bd Install acr if not installed when autogening 2022-04-26 11:52:06 +02:00
pancake caee604777 Import r2au from https://github.com/radare/radare2-au 2022-04-13 10:46:50 +02:00
pancake 71c938d827 The hexagon (qdsp6) plugin from r2 (moved out from master)
* For maintainance reasons
2022-03-21 23:46:09 +01:00
pancake 5c9126d2d8 Initial import of the rl78 disassembler plugin based on binutils 2022-03-20 18:47:32 +01:00
Sylvain Pelissier df747eba95 Add evm compilation in CI. (#303) 2022-02-12 10:35:23 +01:00
Sylvain Pelissier b50ce706ea Replace sdb_fmt by r_strf (#302) 2022-02-12 10:35:10 +01:00
dependabot[bot] 2eb8d24357 Bump ajv from 6.10.0 to 6.12.6 in /r2jadx (#305) 2022-02-12 10:34:27 +01:00
pancake 3f0adee8a9 Fix evm build warnings 2021-12-13 11:23:00 +01:00
pancake 283554e8fd Sync unicorn with latest r2 io changes 2021-12-13 11:19:45 +01:00
pancake 45d4483161 Fix unicorn build 2021-12-13 11:09:38 +01:00
David Vestal e30d193d28 test extras build for snowman to use QT5 (#300) 2021-12-12 01:42:11 +01:00
Sylvain Pelissier e8c9895354 Add separate CFLAGS to vc4 compilation (#299) 2021-10-24 00:19:48 +02:00
pancake b5b7ddf7c5 Fix m32c build 2021-10-02 11:03:01 +02:00
Sylvain Pelissier 83bcd0ef38 Remove nios from Makefiles (#296) 2021-09-29 22:33:53 +02:00
pancake ea07e3fc43 non-blocking m32c test 2021-09-27 18:13:14 +02:00
pancake e158c1bbdc Initial import of the m32c.gnu plugin ##disasm (#285)
* Delete the nios2 plugin because its already in core
2021-09-27 17:41:43 +02:00
pancake 679046a6c0 lseek -> seek 2021-09-24 16:51:39 +02:00
Sylvain Pelissier 1d9f052001 Remove arm64v35 plugin from extras (#294) 2021-09-09 08:55:42 +02:00
pancake bdb9416300 Fix swf signature 2021-09-09 02:45:17 +02:00
dependabot[bot] 158169099e Bump path-parse from 1.0.6 to 1.0.7 in /r2jadx (#291)
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-11 08:25:36 +02:00
Matthew Di Ferrante a4c71ac354 Fix OP_REVERT and OP_SELFDESTRUCT mapping (#290)
Fix mistaken mapping for REVERT and SELFDESTRUCT from `0xfb` and `0xfd` to `0xfd` and `0xff` respectively.
2021-07-28 08:44:04 +02:00
Sylvain Pelissier 2aee0cb6d8 Add r2svd build in CI. (#289) 2021-07-26 13:04:09 +02:00
pancake 903bbe6c70 unstatic 2021-07-15 17:03:20 +02:00
pancake 5db084ce75 Fix #286 - Fix the bad code in swf disassembler (#287) 2021-07-15 12:31:37 +02:00
Sergi Àlvarez i Capilla b49e51aefb Release 5.3.0 2021-06-01 01:41:35 +02:00
pancake 393d2f573a Fix the priorities to pull the v35 repo 2021-05-25 15:36:33 +02:00
Shadorain 5efc8aac3c sys/sysctl.h no longer supported, won't build. (#282)
* sys/sysctl.h no longer supported by glibc: affects fs-squash

Glibc 2.32 and greater no longer support sys/sysctl.h, fs-squash plugin
doesn't build.
I put an `#ifdef` checking if an older GLIBC is still in use, if not
it will use `linux/sysctl.h` instead.

* remove unsquashfs binary
* Removed support for older glibc
* Processors variable is now const at 1
2021-05-17 00:48:05 +02:00
pancake 4d44a7abea Fix build of z80.nc 2021-05-11 18:00:58 +02:00
pancake 25e895800e Fix build of vc4 and z80 plugins 2021-05-11 17:59:28 +02:00
pancake eea5e126ae Fix ba2 plugin compilation warnings 2021-05-11 12:23:19 +02:00
dependabot[bot] 9e30411db8 Bump hosted-git-info from 2.7.1 to 2.8.9 in /r2jadx (#284)
Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.7.1 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](https://github.com/npm/hosted-git-info/compare/v2.7.1...v2.8.9)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-10 15:57:12 +02:00
dependabot[bot] 0b1bc17ec4 Bump lodash from 4.17.19 to 4.17.21 in /r2jadx (#283)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.19 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.19...4.17.21)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-10 09:32:06 +02:00
pancake f5763dcae7 Initial import of the r2pongo plugin 2021-05-09 01:22:18 +02:00
Sylvain Pelissier 035c0ff594 Map yara scan results to correct virtual address (#281)
* Map yara scan results to correct virtual address

* Honor io.va configuration during Yara scan

* FIx according to r2 coding guidelines

* Rely on map instead of section for virtual address in Yara scan

* Fix variable error
2021-04-29 23:58:30 +02:00
pancake 32152f2ec2 Fix arm64v35 build 2021-04-27 12:56:17 +02:00
aemmitt-ns b44d25e0e2 Translate arm64 analysis to v35 disassembler (#280)
* convert old arm64 analysis plugin to v35
* add more from previous arm64 analysis, incl float and vec support
* fix sb && s warning from null postfix
* converted the old anop64 to v35
* fix esil for b.cc instrs
* fix cset/csel/cinc
* fix register indexed mem ops, slightly simplify esil generation
2021-04-27 12:25:47 +02:00
pancake e25b59fe2e Release 5.2.0 2021-04-12 01:39:45 +02:00
pancake ac57ab34a7 Update URL 2021-03-29 22:39:31 +02:00
pancake 24072c986e Add README for iref 2021-03-29 22:37:18 +02:00
pancake 5877128009 Add iref utility 2021-03-29 22:33:46 +02:00
pancake 29894cabdc Take the omap3430 registers script into r2svd 2021-03-17 12:39:09 +01:00
Sylvain Pelissier eb27602a8e Add keystone tests in CI (#278) 2021-02-12 16:56:48 +01:00
Sylvain Pelissier 5b020c3796 Add yara build and test in CI. (#277) 2021-02-11 01:45:55 +01:00
Sylvain Pelissier 457a8bf1ea Add test in ci.yml (#275) 2021-02-10 09:28:56 +01:00
Sylvain Pelissier f2b8a6aa40 Bring back tests in CI for plugins (#274) 2021-02-07 21:43:55 +01:00
Sylvain Pelissier 0a09545ce0 Fix baleful plugin build (#273) 2021-02-06 00:16:34 +01:00
Sylvain Pelissier 3b29d305ab Fix Vector35 ARM64 plugin build (#272) 2021-02-04 22:39:37 +01:00
pancake 184a769b90 Release 5.1.0 2021-01-26 18:18:43 +01:00
pancake 5a14def4af Add history logs for the e2r thing 2021-01-18 12:13:31 +01:00
pancake c8cb79e175 Add esil2reil plugin ripping code from r2 2021-01-18 12:12:19 +01:00
pancake e40dd90bb9 Add missing clean targets 2021-01-08 12:32:59 +01:00
pancake ae8872e121 Add ASAHI (Apple-M1's GPU) disassembler plugin 2021-01-08 12:30:06 +01:00
pancake 1943c6793a Build arm64v35 in the CI 2020-12-08 14:20:55 +01:00
pancake d3faa7e8a6 Fix arm64v35 install and implement uninstall 2020-12-08 14:20:11 +01:00
pancake 7c0287d0e7 Add Vector35 ARM64 disassembler and analyzer plugins (#269) 2020-12-08 13:59:38 +01:00
pancakeandpancake ef6b08214f Update autogenerated ACR scripts (#270)
Co-authored-by: pancake <[email protected]>
2020-11-30 18:09:01 +01:00
Damien Zammit 6ec77c12b6 GitHub CI: Point to correct repo, use new flag && fix badge (#268) 2020-10-20 10:59:09 +02:00
pancake 644ee622c5 Add Github CI badge and fix s/lang/rlang pkgname for duktape after being moved to rlang 2020-10-13 14:14:38 +02:00
pancake 34719628b9 Support passing svd file as argument and filter flag names 2020-10-11 10:58:19 +02:00
pancake e45ff06e70 Import spc700 asm + bin plugins from core 2020-10-08 14:18:29 +02:00
Christopher Hewitt 6f726e0f68 Update nios target (#264) ##asm
* nios: Update function syntax, remove comment.
* nios: Initial work on analysis plugin.
* nios: Update Makefile targets.
* nios: Current progress.
* nios: Load nios_ops into hashtable.
* nios: Use new HtPP API.
* nios: Resolve "r_reg_get_value: Bit size 11 not supported", cleanup.
* nios: Remove ambiguity between struct and function.
- nios_op -> insn_op
* nios: Add missing new RAnalOpMask argument to nios_op function.
* nios: Update return type for set_reg_profile.
- int -> bool
* nios: Minor formatting fixes.
- Update plugin date comment
- Remove empty lines after breaks
* nios: Add target to Travis CI build config.
2020-10-01 15:42:05 +02:00
Damien Zammit c4d27a8e94 atombios: Make plugins compile again && GitHub CI (#265) ##asm
* atombios: Make plugins compile again
* anal_atombios: Fix call 0x00 illegal instruction
* bin_atombios: Fix offsets of symbols/sections
* anal_atombios: Fix jump offsets too
* GitHubCI: Add initial yaml
* WIP: Try r2pm fix
* GitHubCI: Add atombios test
2020-10-01 15:41:39 +02:00
darkreaper-skmc fb7ed81025 Blackfin assembly capability added (#266) ##asm 2020-10-01 15:41:04 +02:00
pancake a9b4f2be6f Move r2wars into its own repo 2020-09-08 16:56:05 +02:00
Sylvain Pelissier dd59385722 Set flags for yara hits (#263) 2020-08-03 12:28:22 +08:00
dependabot[bot] 440147b930 Bump lodash from 4.17.15 to 4.17.19 in /r2jadx (#260)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.15 to 4.17.19.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.15...4.17.19)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-07-23 13:47:47 +02:00
s0i37 7d2cdb43dc r2graph script (#261) 2020-07-23 13:47:37 +02:00
Jerome-PSandJerome-PS 70907f1ee4 Improve BA2 analyser (#251)
Co-authored-by: Jerome-PS <Jerome-PS>
2020-07-17 11:03:44 +08:00
pancake d7fc41424b Dont test r2frida in here 2020-07-07 13:45:58 +02:00
Emil Bay 1d54839979 Use unassigned as default print since EVM has an invalid instruction 2020-07-07 11:22:44 +02:00
Emil Bay 5561fe99c3 Add latest evm instructions 2020-07-07 11:22:44 +02:00
정재영 e74a93c4ad patch two stack buffer overflow. In disassembling swf function 2020-07-03 11:25:36 +02:00
정재영 374fa1646f patch Heap overflow 2020-07-03 11:25:36 +02:00
abcSup 8069025044 Fix and refactor pcap r_bin plugin 2020-07-03 11:24:40 +02:00
Jerome-PS d818dba15e Adding support for BA2 CPU (#250) ##asm 2020-06-14 23:55:18 +02:00
pancake 010a1e39b1 Fix build of asm.m68k-net 2020-06-11 15:37:04 +02:00
s0i37andsoier 3167bed57f Static taint analysis (#249)
* added static taint analysis script

* Update readme.md

* added help() and version()

* Update readme.md

* cosmetic

Co-authored-by: soier <soier@work>
2020-06-02 12:24:14 -05:00
Sylvain Pelissier b6acfeef45 Update travis to remove pyc (#248)
pyc was removed with #246 .
2020-05-14 15:03:41 +08:00
FXTi 3fd5cd76cb Remove pyc plugins (#246) 2020-05-13 20:12:42 -05:00
Sylvain Pelissier 86f8c56be8 Support yara versions less than 4.0.0 (#247) 2020-05-09 11:33:21 +02:00
pancake a015f9fe7e Add hexagon.gnu plugin (moved from r2 core) 2020-04-24 11:37:30 +02:00
pancake 792d43b3ba Add .pkgname for swf and pcap plugins 2020-04-24 11:36:08 +02:00
FXTi 8d1c02121a Fix pyc anal plugin (#245) 2020-04-18 20:33:57 +02:00
pancake dc5887818e Release 4.4.0 2020-04-14 04:59:48 +02:00
FXTi ac22c81ada Fix (#243) 2020-04-12 10:50:35 +02:00
pancake 859c307cb5 Optimize travis 2020-04-12 02:04:12 +02:00
pancake 249e782a2e Fix crash in swf 2020-04-12 01:00:37 +02:00
pancake 097a5f56e4 Fix build of the unicorn plugin 2020-04-12 00:51:58 +02:00
FXTi d65bb20b65 .pyc anal plugin (#237)
* Add symbols in pyc's bin
2020-04-12 00:40:21 +02:00
dependabot[bot] e9993f8fdf Bump acorn from 6.1.1 to 6.4.1 in /r2jadx (#239)
Bumps [acorn](https://github.com/acornjs/acorn) from 6.1.1 to 6.4.1.
- [Release notes](https://github.com/acornjs/acorn/releases)
- [Commits](https://github.com/acornjs/acorn/compare/6.1.1...6.4.1)

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2020-04-05 01:42:38 +02:00
Itay Cohen db29d60aa9 Merge pull request #238 from sylvainpelissier/yara
Update yara  module according to yara API changes
2020-04-04 17:01:29 +03:00
Sylvain Pelissier e9a74be52c Update yara module according to yara API changes 2020-03-22 18:57:07 +01:00
FXTi 72a43824b1 Correct entries function and fixes (#236) 2020-03-18 00:05:54 +01:00
FXTi 8a5936eb64 Improvement of Bin and Asm of pyc plugin (#235) 2020-03-15 09:00:39 +01:00
pancake e4a73ccf07 Release 4.3.0 2020-03-04 01:25:03 +01:00
Sylvain Pelissier fc564166bd Update test folder to radare2/test and add test for yara in Travis (#233) 2020-03-02 21:36:20 +08:00
pancake 7cc5d343af Enable bcl in travis 2020-03-02 12:24:32 +01:00
pancake 854e6f38ed Fix build of BCL plugins (asm, anal, bin) 2020-03-02 12:23:57 +01:00
Sylvain Pelissier 8da191d171 Add print string option to yara 2020-03-01 20:57:48 +01:00
pancake 2749dedb1e The retdec pkg doesnt needs to be tested by us 2020-02-12 00:25:10 +01:00
pancake 327898bac1 Fix build for pcap and swf 2020-02-12 00:22:22 +01:00
pancake 046efbdae8 Fix more plugins 2020-02-11 15:58:45 +01:00
pancake cc4a103ff3 Fix swf build 2020-02-11 15:53:42 +01:00
pancake b9723c5629 Fix nios build 2020-02-11 15:48:36 +01:00
pancake ae90621fe0 Initial implementation of the r2svd tool 2020-02-11 12:23:20 +01:00
Khairulmizam Samsudin 2e53b36308 Code cleanup 2020-02-06 17:55:28 +01:00
Khairulmizam Samsudin 26838fc56f Implement disassembler for Python >=3.6
- Used architecture bits to diffrentiate Python operand size
- Default to Python >=3.6
2020-02-06 17:55:28 +01:00
Khairulmizam Samsudin 986b99a6fe Implement disassembler for Python <3.6 2020-02-06 17:55:28 +01:00
Khairulmizam Samsudin 4c9a552d06 Change line ending to unix 2020-02-06 17:55:28 +01:00
Khairulmizam Samsudin ef5771f7ce Various fix for section detection (#226)
- Correct pointer offset after finding entry point
- Define the right size for Python object type
- Prevent memory corruption problem when naming section
2020-02-04 17:57:38 +01:00
Sylvain Pelissier 8ba3432f5c Microblaze ESIL load and store with immediate 2020-02-03 15:13:39 +01:00
Sylvain Pelissier 271369f8ee Move RAnalOpMask into parameter 2020-02-03 15:13:39 +01:00
Sylvain Pelissier 145e685c60 Logical instructions with immediate 2020-02-03 15:13:39 +01:00
Sylvain Pelissier 730433360e Microblaze ESIL: handle carry flag 2020-02-03 15:13:39 +01:00
Khairulmizam Samsudin f1f617f791 Implement new method to find entrypoint
- Detect entrypoint for ALL cpython version
- Detection does not depend on correct bytecode magic number
2020-02-02 11:13:26 +01:00
Khairulmizam Samsudin c3d8e433bd Refactor pyc_version struct
- Update latest magic from github.com/python/cpython
- Simplify the structure of pyc_version
- remove unicode information from pyc_version struct
2020-02-02 11:13:26 +01:00
Khairulmizam Samsudin 934c08364f Add base address information 2020-01-28 18:07:58 +01:00
Khairulmizam Samsudin 6e8b2ed5db Fix bytecode version detection 2020-01-28 18:07:58 +01:00
Khairulmizam Samsudin 2434f97937 Replace CORELIB with R2_PLUGIN_INCORE 2020-01-28 18:07:58 +01:00
procfs 3319911179 fix overflow bugs in pyc module 2020-01-27 16:58:39 +01:00
Khairulmizam Samsudin 5eb18b3e3b Disable TYPE_LONG due to dependencies to libgmp 2020-01-27 07:45:37 +01:00
Khairulmizam Samsudin 91eeb7b154 Updated using new RBuffer struct 2020-01-27 07:45:37 +01:00
Khairulmizam Samsudin b01f0180ea Updated using new RBinPlugin struct 2020-01-27 07:45:37 +01:00
Khairulmizam Samsudin 16e27dc9e9 Ignore tags 2020-01-27 07:45:37 +01:00
Sylvain Pelissier 5f6f945498 Microblaze ESIL for shift and sign extension (#216) 2019-10-28 16:53:50 +01:00
pancake 7ec6dbcf88 Release 4.0 2019-10-28 16:52:59 +01:00
pancake bc6d3f36da Import r2ida from https://github.com/radare/radare2ida 2019-10-28 11:03:42 +01:00
Sylvain Pelissier 96d68f14ed Microblaze ESIL update (#215)
* Corrected jumps and remove git messages
* Add ESIL for right shift and correct imm value
* Separate branch with immediate instructions
2019-10-16 12:52:27 +02:00
dependabot[bot] a67e7f0adb Bump lodash from 4.17.11 to 4.17.15 in /r2jadx (#213)
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.11 to 4.17.15.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.11...4.17.15)

Signed-off-by: dependabot[bot] <[email protected]>
2019-10-07 18:24:45 +08:00
dependabot[bot] 7125f795b4 Bump eslint-utils from 1.3.1 to 1.4.2 in /r2jadx (#212)
Bumps [eslint-utils](https://github.com/mysticatea/eslint-utils) from 1.3.1 to 1.4.2.
- [Release notes](https://github.com/mysticatea/eslint-utils/releases)
- [Commits](https://github.com/mysticatea/eslint-utils/compare/v1.3.1...v1.4.2)

Signed-off-by: dependabot[bot] <[email protected]>
2019-10-07 18:24:36 +08:00
Sylvain Pelissier 6ad247901d Update test to use NodeJS 10 (#211) 2019-10-07 17:24:36 +08:00
Maijin 7ecb70cd26 Change radare->radareorg links 2019-10-07 10:53:33 +02:00
Sylvain Pelissier f90380fc23 Improvements for Microblaze ESIL of jump an return operations 2019-10-07 15:53:45 +08:00
Anton Kochkov a0d0c360da Fix urls 2019-10-07 15:48:54 +08:00
Anton Kochkov 80e37a663d Fix urls 2019-10-07 15:48:15 +08:00
pancake fb3c96694e Add checkm8 io plugin 2019-09-30 20:01:56 +02:00
Sylvain Pelissier 2ee3d1153b Microblaze add calls and delay branch (#209) 2019-09-24 20:19:46 +02:00
Sylvain Pelissier 972e774df8 Add Travis CI test for Microblaze and update ESIL (#207) 2019-09-18 14:15:21 +02:00
pancake 4325c5c797 Release 3.9.0 2019-09-17 18:50:05 +02:00
Sylvain Pelissier 738ed6451c Improve Microblaze ESIL ##anal (#206) 2019-09-16 09:36:43 +02:00
Sylvain Pelissier d686d94c0e Correct pointer for r_str_newf function (#205) 2019-09-10 13:25:21 +02:00
Sylvain Pelissier 86a32aa11e Handle negative immediate values in instructions (#204) 2019-09-08 19:09:49 +02:00
pancake 0d830052ad Release 3.7.0 2019-08-01 05:10:31 +02:00
pancake cb31b4c934 Fixes and improvements in cmdline handling and such for r2snow 2019-07-24 12:06:33 +02:00
pancake 78336f4977 More fixes for r2snow 2019-07-24 06:45:43 +02:00
pancake 85f79f83b3 Import snowman output as comments into r2 in r2snow 2019-07-24 04:41:53 +02:00
pancake 940dfec369 More fixes and ipmrovements for r2jadx 2019-07-11 06:45:45 +02:00
pancake 807d1999c0 Update r2pipe dependency for r2jadx 2019-07-10 20:15:31 +02:00
pancake b74f1d306b Lots of improvements for r2jadx! 2019-07-10 12:54:43 +02:00
pancake 3134973ee0 Fix indent and add one more try/catch block 2019-07-09 15:42:37 +02:00
pancake 6993b40789 Use --illegal-access=warn 2019-07-09 15:39:04 +02:00
pancake f54381e411 Add missing md380 Makefile 2019-07-09 15:34:21 +02:00
pancake bd89b33d1a Add ^C message 2019-07-09 15:33:55 +02:00
pancake 96a6b07921 Check for jadx version and use r2pipe.isAvailable() after upgrading dependencies 2019-07-09 15:24:39 +02:00
pancake 05f76e5578 Release 3.6.0 2019-06-24 15:49:47 +02:00
pancake 2e8fac708c Initial working version of r2jadx 2019-06-21 10:27:44 +02:00
pancake c7ffc478e5 Initial implementation of r2jadx 2019-06-16 20:15:02 +02:00
meme c276d25c57 Update <mybfd.h> to reflect the static inlining of bfd_get_bits
https://github.com/radare/radare2/blob/master/libr/asm/arch/include/mybfd.h#L584-L585
2019-06-15 16:35:17 +02:00
dissonant-research c45284dab5 Switching from RIOSection to RIOMap in unicorn debug 2019-05-24 09:27:58 +02:00
pancake e9b20fb9eb Release 3.5.0 2019-05-13 11:18:56 +02:00
pancake cabcd22f39 refix 2019-04-26 00:28:49 +02:00
pancake 65b16c4ea2 Fix build for udis 2019-04-26 00:25:37 +02:00
pancake 32caa03626 Fix bin-md380 crash 2019-04-20 11:48:55 +02:00
pancake 710bd658e3 Implement loadbuffer ni md380 2019-04-20 02:17:43 +02:00
pancake a39b5dfac7 Fix build of md380 bin 2019-04-20 02:15:27 +02:00
pancake 207a4677a1 Initial import of the r2emuhash 2019-04-14 13:35:49 +02:00
pancake 9eb4ca72bb Release 3.4.0 2019-04-01 22:16:24 +02:00
Fedor Sakharov 0459dfa816 fixes trimmed last bytes in disassembly (#195)
Fixes #194
2019-03-10 23:20:46 +08:00
pancake d8517a28ec Fix truncated numbers issue 2019-03-08 19:44:30 +01:00
pancake 5a0cc39fac Release 3.3.0 2019-02-19 14:50:08 +01:00
Andrew Barbarello 5883f35f20 yara-r2: replace r_io_read_at with r_io_pread_at
r_io_read_at is deprecated, and the intention is clearly to read all
bytes of the current file to be scanned with yara rules.
2019-02-17 16:25:15 +01:00
Andrew Barbarello 93f603828e yara-r2: remove unused yara2 sigs/refs to yara2 2019-02-17 16:25:15 +01:00
Andrew Barbarello fdcd534137 yara-r2: install to R2PM_USERPLUGIN_DIR
Makefile was using `R2_PLUGDIR`, which is no longer exported in
environment by `r2pm`, see
https://github.com/radare/radare2/issues/12751 .

Instead, we use `R2PM_USRPLUGIN_DIR`. Also update
`r_cmd_yara_load_default_rules` to load yara3 rules from the correct
path
2019-02-17 16:25:15 +01:00
Maijin 37e60e452c Add pcap in r2r-extras travis 2019-01-03 22:12:26 +01:00
Francesco Tamagni 43be0652d4 Move BPF plugin here 2018-12-31 20:27:38 +01:00
Stevie Johnstone 9d081e9f84 Fix unicorn README. dh is now dL 2018-12-30 01:36:32 +01:00
Stevie Johnstone 277114e466 Fix unicorn plugin build
* debug_evm.so was being built instead of debug_unicorn.so fix Makefiles
* "sections" is now an SdbList
* debug interface has changed to take RDebug* as the first argument
* "flags" member is now "perm"
* R_IO_READ and friends are now R_PERM_R etc
2018-12-30 01:36:32 +01:00
Federico G. Schwindt b2244eb386 More fixes to get these building (#187)
While here silence some warnings and simplify.
2018-12-20 12:24:28 +01:00
Federico G. Schwindt 038878331c Fix compilation (#186)
* Add missing object file

* Correctly append the insn

* Fix compilation
2018-12-19 15:18:55 +01:00
pancake 7436fe335a Missing ; 2018-12-04 17:05:47 +01:00
pancake 5be184ad09 Add one more NE url reference 2018-12-04 15:39:41 +01:00
pancake 412a2b3c10 Add NE and JNI headers 2018-12-04 15:39:11 +01:00
pancake e369064b38 Release 3.1.0 2018-11-26 04:24:12 +01:00
Sebastien Alaiwan 4c6150eb72 Use new buf_asm interface for mycpu example plugin (#183) 2018-11-21 13:53:44 +01:00
Sebastien Alaiwan 111f9716de Add Jaguar GPU disassembler (#184) 2018-11-21 13:32:27 +01:00
Giovanni 87cf193fa9 Update README.md (#182) 2018-11-19 13:03:21 +01:00
pancake a5a5d23273 Release 3.0.1 2018-11-09 17:49:04 +01:00
condret 7db8694ccf refix bale anal-plugin (use the new interrupt api) (#177) 2018-10-21 18:41:49 +02:00
Fedor Sakharov c9268f928d fixes r_io flags in io_evm (#180) 2018-10-21 18:41:40 +02:00
Fedor Sakharov bc5297eb66 Fixes permissions flag for the EVM plugin (#179) 2018-10-21 15:50:40 +02:00
Christopher Hewitt fe6b3f0356 nios: Update to match new RasmOp API. (#178) 2018-10-21 13:26:12 +02:00
pancake 6a2b0792bd Fix some more asm plugins, more to go! 2018-10-18 19:09:41 +02:00
pancake 49b143ecec Fix snprintf issue in last baleful commit 2018-10-18 19:02:22 +02:00
pancake 78aae788e2 Delete unnecessary yara/build.mk 2018-10-18 17:47:12 +02:00
pancake d6dac273e9 Start to improve the makefiles and add missing bitcoin.h 2018-10-18 17:46:14 +02:00
d4em0n 3edba75c46 Bring back the missing dmangle.d 2018-10-18 17:08:53 +02:00
skuater f5743ad7ee fixed baleful 2018-10-18 16:05:38 +02:00
pancake 7f322a2194 Fix #175 - build for udis86 plugin 2018-10-16 22:36:21 +02:00
pancake b22e3a37ef Add r2elisa 2018-10-04 02:40:51 +02:00
Fedor Sakharov 0d721e2d33 Fixes long push operands display (#171) 2018-09-20 19:20:03 +02:00
pancake d087a6076e Release 2.9.0 2018-09-04 02:08:10 +02:00
Fedor Sakharov 2479d03e9d Updates EVM code for the new RasmOp API (#169) 2018-09-03 10:16:22 +02:00
David Douard 26650ee04e mc6809: update to match new RasmOp API (#168) 2018-08-31 18:00:09 +02:00
Rene Laemmert 63ecdc603a fix usage of RStrBuf in keystone.c 2018-08-26 17:30:33 +02:00
pancake 0c43eec6cf Refix olly(2) 2018-08-25 13:50:19 +02:00
pancake 3b8c967d7d Refix olly 2018-08-25 13:49:46 +02:00
pancake ec86d7d221 Fix atom and x86 plugins 2018-08-25 13:47:45 +02:00
pancake 206108514e Release 2.8.0 2018-08-14 16:15:17 +02:00
Maijin 25d39975d5 Add more R2_ prefix for some var 2018-08-07 22:15:32 +02:00
pancake af308ea3bd Release radare2-extras 2.7.0 2018-07-09 16:17:36 +02:00
pancake 89bf3cc1e7 Fix build of lief 2018-06-20 19:51:20 +02:00
Christopher Hewitt becc4cfb70 nios: Update libr/Makefile for r2pm plugin use. 2018-06-08 00:37:10 +02:00
Christopher Hewitt f00cecbc5f nios: Add nios to libr/asm/Makefile. 2018-06-07 09:42:28 +02:00
Christopher Hewitt 1a56c842e1 nios: Working disassembler plugin. 2018-06-07 09:42:28 +02:00
Christopher Hewitt 33882645ba nios: Update dis-asm.h and mybfd.h. 2018-06-07 09:42:28 +02:00
Christopher Hewitt cb010aff69 nios: Manually merge in contemporary binutils code and other fixes for modern compilers. 2018-06-07 09:42:28 +02:00
Christopher Hewitt e809b61b47 nios: Add missing headers and support code. 2018-06-07 09:42:28 +02:00
Christopher Hewitt 956b3aaf14 nios: Import cpu definitions from bfd and cgen opcodes support code. 2018-06-07 09:42:28 +02:00
Christopher Hewitt f64cec8e36 nios: Create asm_nios target. Update mybfd.h. 2018-06-07 09:42:28 +02:00
Christopher Hewitt 7028bab425 nios: Initial import of nios binutils. 2018-06-07 09:42:28 +02:00
pancake 5a9d5c4b36 Fix overflow in swf 2018-06-06 17:55:48 +02:00
Damien Zammit ec624bef6f dwarf: Fix broken test 2018-06-02 17:01:24 +02:00
Damien Zammit 6f5fa00837 x86zyan: Fix broken test 2018-06-02 17:01:24 +02:00
Damien Zammit 525c42ef94 yara: Fix broken test 2018-06-02 17:01:24 +02:00
Damien Zammit 9127f0e92d TESTS: Comment out broken tests, add build id where it broke 2018-06-02 17:01:24 +02:00
Damien Zammit f41d4b1305 travis: Install rust as default, use gcc-7, 14.04 and install GNU make 2018-06-02 17:01:24 +02:00
Damien Zammit 9b6801955e atombios: Improvements
- Include local data blocks as locs
- Autodetect binary fix
- Include global data blocks as sections
- Add ESIL to resolve data from tables
- Bugfix ESIL for various instructions
- Bugfix ESIL for jmp conditions
- Easier to read disasm, still with ESIL support
2018-05-30 14:27:02 +08:00
Anton Kochkov b64bc715dc Enable sudo for Travis 2018-05-30 14:22:15 +08:00
Damien Zammit d2137ab4e4 atombios: disasm + analysis + bin plugins (#158) 2018-05-26 12:32:51 +02:00
pancake 1780ea5dd2 Add task_struct pointer field in the proc_info struct 2018-05-25 22:19:55 +10:00
pancake d2e83eda06 Fix format string 2018-05-25 13:03:42 +02:00
pancake 5445b2ae79 Release 2.6.0 and generate acr files with 1.6.2 2018-05-21 18:39:01 +02:00
pancake 1e04d8b4e9 +x r2crash.js 2018-04-23 02:11:57 +02:00
pancake aad642538c Use enum instead of define 2018-04-12 11:20:51 +02:00
pancake 938e608c62 Initial import of types/ 2018-04-12 11:14:35 +02:00
ilovezfs 8cce5eb0a4 x86_udis.mk: also pass LDFLAGS (#154) 2018-04-11 16:33:28 +02:00
pancake 4d45b13de6 Release 2.5.0 2018-04-10 00:07:10 +02:00
pancake 99fb4669ad Fix copies from protected zones in r2k 2018-04-03 14:33:36 +02:00
pancake c8c7fdfa6b Fix copy_to_user crash in r2k (happening in linux64 4.15 kernels) 2018-04-02 22:18:01 +02:00
pancake bf73b81148 Use more void*, %p and build fixes in r2k-linux 2018-04-02 19:58:34 +02:00
pancake 30750b1843 Update cr3/cr4 code in r2k for kernels 4.9 and 4.13 2018-04-02 19:34:15 +02:00
pancake 5f74c1cc3c Fix build of r2k on linux4, crashes everywhere 2018-04-02 14:21:25 +02:00
pancake 4088f4a750 Add install and uninstall targets 2018-03-29 05:08:32 +02:00
pancake 714c551579 Add build instructions in readme 2018-03-29 05:03:47 +02:00
pancake 5c9d831a58 Initial import of the r2tox plugin 2018-03-29 04:56:33 +02:00
wavvs 41b78ff52a Fix cloning to non-empty existing directory (#139) (#140) 2018-03-19 15:11:43 +01:00
GNU fbc790d5c9 update x86_udis.mk (#151) 2018-03-19 15:09:56 +01:00
pancake 76f80bbadd Add blackfin build 2018-03-15 00:34:29 +01:00
pancake c96395e089 Fix udis build 2018-03-15 00:31:57 +01:00
pancake 4410acf12c Add x86udis for travis 2018-03-15 00:21:36 +01:00
pancake cfc652101a Fix udis regprofile 2018-03-15 00:15:57 +01:00
pancake 3bd9f11283 Fix anal.x86.udis build 2018-03-14 23:49:15 +01:00
pancake 8582da5145 Add generic udis86 target 2018-03-14 22:43:47 +01:00
pancake 882fbe49b8 Import the anal.x86.udis plugin from core 2018-03-14 22:36:05 +01:00
pancake 60285a5370 Initial import of the asm.x86.udis86 plugin
Moved from radare2 (core)
2018-03-14 22:34:04 +01:00
pancake 409a0e7a45 Release 2.4.0 2018-03-05 18:24:30 +01:00
Silur 7d0fee72b2 byzantium opcodes (#149) 2018-02-25 10:32:27 +01:00
pancake 3f594da048 Release 2.3.0 2018-02-06 14:45:11 +01:00
pancake cd73547b05 Add r2crash script to generate r2 scripts out of Mac crashlogs 2018-01-29 11:24:28 +01:00
Fedor Sakharov 49183314d8 Fix for initial declarations in debug_evm.c (#146) 2017-12-25 16:25:16 +01:00
Fedor Sakharov 52bd0b571a Add targets for EVM so r2pm works (#145) 2017-12-25 13:52:39 +01:00
pancake 010ade6bf6 Release 2.2.0 2017-12-24 19:05:49 +01:00
Fedor Sakharov a912bd66ea Evm improvements (#144)
* Fix warnings in anal_evm.c

* Correctly handle error codes in io_evm.c

* io_evm has to use application/json headers

* Read evm function signatures from file

* Fix opcode types in EVM

* Fix sizes of DUPn commands in EVM

* io_evm now reads stack backwards

* Brings anal-evm to build

* Move to radare-specific types

* Fix warnings

* Store all push addrs to sdb to use for jump opcodes

* Removes debug prints

* Adds anal-install target to Makefile.acr

* Fix memleaks in EVM sdb usage
2017-12-12 20:04:50 +01:00
701 changed files with 664007 additions and 15314 deletions

No files matched your search

+6
View File
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "cargo"
directory: "/x86iced"
schedule:
interval: "weekly"
+56
View File
@@ -0,0 +1,56 @@
name: CI
on:
push:
pull_request:
jobs:
build-extras:
name: Build radare2 extras and r2pipe
runs-on: ubuntu-22.04
env:
EXTERNAL_BUILDS: 'keystone-lib unicorn-lib'
LOCAL_BUILDS: 'asahi blackfin blessr2 keystone microblaze ppcdisasm r2svd vc4 x86iced'
TESTS: 'keystone vc4'
steps:
- uses: actions/checkout@v3
with:
repository: radareorg/radare2
ref: master
path: ./radare2
- uses: radareorg/github-actions@v3
with:
from-git: true
- uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
path: ./radare2-extras
- name: Init r2pm
run: r2pm -U
- name: Compile and install plugins
run: |
set -e
for p in $EXTERNAL_BUILDS ; do
echo $p
r2pm -i $p
done
R2PM_GITDIR="$(r2pm -H R2PM_GITDIR)"
for p in $LOCAL_BUILDS ; do
echo $p
ln -s "$GITHUB_WORKSPACE/radare2-extras" "$R2PM_GITDIR/$p"
R2PM_OFFLINE=1 r2pm -i $p
done
- name: Test plugins
working-directory: radare2/test
run: |
set -e
for p in $TESTS ; do
echo $p
make $p
done
r2r -u "$GITHUB_WORKSPACE/radare2-extras/test/db/extras/microblaze"
r2r -u "$GITHUB_WORKSPACE/radare2-extras/test/db/extras/ppcdisasm"
set +e
+41
View File
@@ -0,0 +1,41 @@
name: "CodeQL"
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
schedule:
- cron: "30 16 * * 1"
jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
security-events: write
strategy:
fail-fast: false
matrix:
language: [ javascript, python ]
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Initialize CodeQL
uses: github/codeql-action/init@v2
with:
languages: ${{ matrix.language }}
queries: +security-and-quality
- name: Autobuild
uses: github/codeql-action/autobuild@v2
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v2
with:
category: "/language:${{ matrix.language }}"
+6
View File
@@ -17,4 +17,10 @@
*.swo
*.un~
/Makefile
r2yara/Makefile
/options.mk
# misc
tags
node_modules
-114
View File
@@ -1,114 +0,0 @@
os:
- linux
compiler:
- clang
addons:
sources:
- ubuntu-toolchain-r-test
- llvm-toolchain-precise-3.6
apt:
packages:
- g++
- llvm-dev
- libatomic-ops-dev
- mono-xbuild
- curl
- tcc
- libboost-dev
- libqt4-dev
- cmake
- cmake-data
- ninja-build
- libboost-dev
- libqt4-dev
- exuberant-ctags
- libelf-dev
- libgmp-dev
- zlib1g-dev
- swig
env:
- TESTS="r2pm -i armthumb"
- TESTS="r2pm -i baleful"
# - TESTS="r2pm -i bcl" [BR] https://travis-ci.org/radare/radare2-extras/builds/157522362
- TESTS="r2pm -i blackfin"
- TESTS="r2pm -i blessr2"
# - TESTS="r2pm -i bpf" [BR] https://travis-ci.org/radare/radare2-extras/builds/157522362
# - TESTS="r2pm -i dlang" [BR] https://travis-ci.org/radare/radare2-extras/builds/157522362
- TESTS="r2pm -i dirtycow"
- TESTS="r2pm -i lang-duktape"
- TESTS="git clone git://git.code.sf.net/p/libdwarf/code libdwarf-code && cd libdwarf-code && ./configure && make && cd .. && r2pm -i dwarf-parser && cd radare2-regressions && ./r2r dwarf && cd .. && r2pm -u libdwarf && rm -rf libdwarf-code" #need to remove libdwarf? or travis destroys the vm so no issue in that?
- TESTS="r2pm -i r2frida"
# - TESTS="r2pm -i io-ewf" # https://github.com/travis-ci/apt-package-whitelist/issues/3205
# - TESTS="r2pm -i keystone-lib && r2pm -i keystone && cd radare2-regressions && make keystone && cd .." [BR] https://travis-ci.org/radare/radare2-extras/builds/157522362
- TESTS="r2pm -i microblaze"
- TESTS="r2pm -i msil"
- TESTS="r2pm -i ppcdisasm"
- TESTS="r2pm -i psosvm"
- TESTS="r2pm -i pyc"
- TESTS="r2pm -i vala && r2pm -i valabind && r2pm -i r2api-python"
# - TESTS="r2pm -i r2pipe-cs" [BR] https://travis-ci.org/radare/radare2-extras/builds/157522362
- TESTS="r2pm -i r2pipe-go"
- TESTS="r2pm -i r2pipe-js"
- TESTS="r2pm -i r2pipe-py"
- TESTS="r2pm -i r2pipe-rb"
# - TESTS="r2pm -i r2pipe-vala" https://travis-ci.org/radare/radare2-extras/builds/157522362
- TESTS="r2pm -i radare2"
# - TESTS="r2pm -i r2snow" https://travis-ci.org/radare/radare2-extras/jobs/199500082
# - TESTS="r2pm -i radeco" [BR] https://travis-ci.org/radare/radare2-extras/builds/157522362
- TESTS="r2pm -i retdec"
- TESTS="r2pm -i swf && cd radare2-regressions && make swf && cd .."
- TESTS="r2pm -i m68k-net && cd radare2-regressions && make m68k-extras && cd .."
# - TESTS="r2pm -i swig" Sorry. This package cannot be installed in your home.
- TESTS="r2pm -i syms2elf"
# - TESTS="r2pm -i tcc" [BR] https://travis-ci.org/radare/radare2-extras/builds/157522362
- TESTS="r2pm -i unicorn-lib && r2pm -i unicorn" # need to do this properly
- TESTS="r2pm -i vala"
- TESTS="r2pm -i valabind"
- TESTS="r2pm -i vapi"
- TESTS="r2pm -i vc4"
- TESTS="r2pm -i winapi"
- TESTS="r2pm -i www-enyo"
# - TESTS="r2pm -i www-m" [BR] https://travis-ci.org/radare/radare2-extras/builds/157522362
- TESTS="r2pm -i www-p"
- TESTS="r2pm -i www-t"
- TESTS="r2pm -i x86bea"
- TESTS="r2pm -i x86tab"
- TESTS="r2pm -i x86olly && cd radare2-regressions && make olly-extras && cd .."
- TESTS="r2pm -i z80-nc"
- TESTS="r2pm -i yara && r2pm -i yara-r2"
- TESTS="r2pm -i x86zyan"
sudo:
- false
language:
- c
cache:
- ccache
- apt
before_script:
- export WORKING_DIR=${TRAVIS_BUILD_DIR}/..
- cd ${WORKING_DIR}
- rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install 7
- git clone https://github.com/radare/radare2-regressions
- git clone https://github.com/radare/radare2 && cd radare2
- ./configure --prefix=${WORKING_DIR}/install > /dev/null
- make -s -j2 > /dev/null
- make install > /dev/null
- cd ..
- export PATH=${WORKING_DIR}/install/bin:${PATH}
- export LD_LIBRARY_PATH=${WORKING_DIR}/install/lib:${LD_LIBRARY_PATH}
- export LIBR_INCLUDE=${WORKING_DIR}/radare2/libr/include
- export LIBR_UTIL=${WORKING_DIR}/radare2/libr/util
- export PKG_CONFIG_PATH=${WORKING_DIR}/radare2/pkgcfg
- export GOPATH=${WORKING_DIR}/
- curl -sSf https://static.rust-lang.org/rustup.sh | sh
- r2pm init
- export R2PM_GITDIR=${WORKING_DIR}
- cd radare2-extras
- ./configure --prefix=${WORKING_DIR}/install
- cd ..
script:
- eval $TESTS
+12 -5
View File
@@ -1,6 +1,5 @@
VERSION=@VERSION@
HAVE_LIB_YARA=@HAVE_LIB_YARA@
PREFIX=@PREFIX@
include options.mk
DESTDIR?=
TAR=tar -cvf
CZ=xz -f
@@ -13,9 +12,10 @@ DIRS+=libr/anal/p
endif
help:
@echo "Usage make [target] .. Targets:"
@echo "Usage make [target] .. Targets:"
@echo " all - build everything"
@echo " baleful - build baleful r2 plugin"
@echo " afen - build afen r2 plugin"
@echo " asm - build armthumb, ppc, psosvm, x86bea, m68k plugins"
@echo " io - build io plugins"
@echo " anal - build analysis plugins (RAnal)"
@@ -24,14 +24,19 @@ help:
@echo " yara - build yara3 r2 plugin"
@echo " (target)-install - install given plugin"
@echo " (target)-clean - clean given plugin"
@echo " install-yara{2,3} - install Yara 2 or 3 from Git"
# @echo " install-yara{2,3} - install Yara 2 or 3 from Git"
afen:
$(MAKE) -C afen
baleful:
$(MAKE) -C baleful
debug unicorn:
$(MAKE) -C libr/debug/p
anal:
$(MAKE) -C libr/anal/p
anal-install:
$(MAKE) -C libr/anal/p install DESTDIR=$(DESTDIR)
asm:
$(MAKE) -C libr/asm/p
asm-install:
@@ -51,6 +56,8 @@ yara:
$(MAKE) -C yara/$@
yara-clean:
$(MAKE) -C yara/yara clean
afen-install:
$(MAKE) -C afen install DESTDIR=$(DESTDIR)
baleful-install:
$(MAKE) -C baleful install DESTDIR=$(DESTDIR)
debug-install unicorn-install:
+15 -13
View File
@@ -1,5 +1,8 @@
radare2-extras [![Build Status](https://travis-ci.org/radare/radare2-extras.svg?branch=master)](https://travis-ci.org/radare/radare2-extras)
==============
# radare2-extras
[![GithubCI Status](https://github.com/radareorg/radare2-extras/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/radareorg/radare2-extras/actions?query=workflow%3A%22ci%22)
[![radare2](https://img.shields.io/badge/radare2-6.0.4-green)](https://github.com/radareorg/radare2)
This repository contains extra plugins for radare2.
The reasons why those plugins are distributed in a separate
@@ -12,13 +15,6 @@ repository are the following:
* Duplicates functionality from r2 (no need to have
multiple disassemblers for the same arch in core)
The compiled plugins will be installed at
/usr/lib/radare2-extras/$(VERSION)
Some of the plugins/code doesnt compiles, it will be reviewed
and cleaned up, merged into core, updated or removed.
In addition, this repository will be useful to new contributors,
comers who want to write his own r2 plugins for example.
@@ -27,10 +23,16 @@ repository to be as concise as possible, and reduce the
amount of unnecessary plugins to shrink the install size and
keep it usable for 99% of users.
Building
========
## Building
The recommended way to build and install those plugins for users
is to use r2pm. See the radare2-pm repository for details:
is to use r2pm. See the [radare2 plugins](https://github.com/radareorg/radare2#plugins) documentation for details.
https://github.com/radare/radare2-pm
## Notable plugins
* [`msl`](msl/) — Memory Slice (`.msl`) support: open/emulate process memory
dumps (`io`/`bin`/`debug` plugins, with ESIL reverse execution) and produce
them from a live debug session (`dgm`/`dgma`, `core` plugin).
* [`r2gg`](r2gg/) — Game Gear emulation through Z80 ESIL, with color terminal
display, controls, Sega cartridge banking, interrupts, and stereo PSG audio.
+22
View File
@@ -0,0 +1,22 @@
LIBEXT=$(shell r2 -HR2_LIBEXT)
CFLAGS+=$(shell pkg-config --cflags r_core)
LDFLAGS+=$(shell pkg-config --libs r_core)
R2_USER_PLUGINS=$(shell r2 -HR2_USER_PLUGINS)
CORE_AFEN=src/libcoreafen.$(LIBEXT)
OBJS=src/main.o
all: $(CORE_AFEN)
$(CORE_AFEN): $(OBJS)
r2pm -r $(CC) $(LDFLAGS) -shared -fPIC -o $(CORE_AFEN) $(OBJS)
clean:
rm -f $(OBJS) $(CORE_AFEN)
user-install install:
mkdir -p $(R2_USER_PLUGINS)
cp -f $(CORE_AFEN) $(R2_USER_PLUGINS)
user-uninstall uninstall:
rm -f $(R2_USER_PLUGINS)/$(CORE_AFEN)
+30
View File
@@ -0,0 +1,30 @@
# afen plugin
Author: satk0
NOTE: Making this plugin would not be possible without the help from pancake. Big thanks to him!
Radare2 plugin to rename expressions
This plugin should register a new `afen` command that should rename any expression
to any text, thus enabling a creation of variables from expressions.
## Building and installing the plugin:
Build:
r2pm -r meson setup build
Install:
meson install -C build
## Run:
r2 -e asm.parser=afen -e asm.pseudo=true <file>
## Usage:
For instance, to rename `rbp + rax - 0x1020` expression to `cwd[i]`, you could use the following command:
afen cmd[i] "rbp + rax - 0x1020"
+12
View File
@@ -0,0 +1,12 @@
project('r2-afen', 'c', license : 'MIT', meson_version : '>=1.00', version : '0.1.0')
r2_plugdir = run_command('r2', '-H', 'R2_USER_PLUGINS', check: true).stdout().strip()
sources = [ 'src/main.c' ]
lib = library('coreafen', sources,
dependencies : [
dependency('r_core')
],
install_dir: r2_plugdir,
install: true
)
+269
View File
@@ -0,0 +1,269 @@
/* radare - Copyright 2024 - satk0 */
#define R_LOG_ORIGIN "core.afen"
#include <r_core.h>
typedef struct RAfenRepl {
char *old_name;
char *new_name;
} RAfenRepl;
#if R2_VERSION_NUMBER >= 50909
#else
static R_TH_LOCAL HtUP *ht; // hash table
#endif
#if R2_VERSION_NUMBER >= 50909
static void fini(RAsmPluginSession *aps) {
RParse *p = aps->rasm->parse;
R_FREE (p->retleave_asm);
}
#endif
static char *parse(RCore *core, const char *data, HtUP *ht) {
char *out = strdup (data);
#if R2_VERSION_NUMBER >= 50909
RAnalFunction *fcn = r_anal_get_function_at (core->anal, core->addr);
#else
RAnalFunction *fcn = r_anal_get_function_at (core->anal, core->offset);
#endif
if (fcn) {
RVector *vec = ht_up_find (ht, fcn->addr, NULL);
if (vec) {
RAfenRepl *repl;
r_vector_foreach (vec, repl) {
out = r_str_replace_all (out, repl->old_name, repl->new_name);
}
}
}
return out;
}
// afen parser
#if R2_VERSION_NUMBER >= 50909
static char *r_parse_afen(RAsmPluginSession *aps, const char *data) {
char* out = parse ((RCore *) aps->rasm->user, data, aps->data);
return out;
}
#else
static int r_parse_afen(RParse *p, const char *data, char *str) {
char* out = parse ((RCore *) p->analb.anal->user, data, ht);
strcpy (str, out);
return true;
}
#endif
// RParse plugin Definition Info
#if R2_VERSION_NUMBER >= 50909
RAsmPlugin r_parse_plugin_afen = {
.meta = {
.name = "afen",
.desc = "Afen parse plugin",
},
.parse = r_parse_afen,
.fini = fini,
// .subvar = subvar,
};
#else
RParsePlugin r_parse_plugin_afen = {
.name = "afen",
.desc = "Afen parse plugin",
.parse = r_parse_afen,
};
#endif
static inline void repl_free_afen(void *e, void *user ) {
RAfenRepl *repl = (RAfenRepl *) e;
if (repl) {
R_FREE (repl->old_name);
R_FREE (repl->new_name);
}
}
static inline void vector_value_free_afen(HtUPKv *kv) {
RVector *vec = (RVector *) kv->value;
if (vec) {
r_vector_free (vec);
}
}
static bool print_afen_rules(void *user, const ut64 key, const void *value) {
RCore *core = (RCore *) user;
RVector *vec = (RVector *) value;
RAfenRepl *repl;
r_vector_foreach (vec, repl) {
r_cons_printf (core->cons, "'@0x%08"PFMT64x"'afen \"%s\" \"%s\"\n", key, repl->new_name, repl->old_name);
}
return true;
}
// setup afen parser
#if R2_VERSION_NUMBER >= 50909
static bool r_core_init_afen(RCorePluginSession *cps) {
RCore *core = (RCore *) cps->core;
r_asm_plugin_add (core->rasm, &r_parse_plugin_afen);
RAsmPluginSession *afen_aps = NULL;
RListIter *iter;
RAsmPluginSession *aps;
r_list_foreach (core->rasm->sessions, iter, aps) {
if (aps && aps->plugin && aps->plugin->meta.name &&
!strcmp(aps->plugin->meta.name, "afen")) {
afen_aps = aps;
break;
}
}
if (!afen_aps) {
R_LOG_ERROR ("Failed to find afen plugin session");
return false;
}
HtUP /*<ut64, RVector<RAfenRepl*>>*/ *ht = ht_up_new (NULL, vector_value_free_afen, NULL);
if (!ht) {
R_LOG_ERROR ("Fail to initialize hashtable");
ht_up_free (ht);
return false;
}
afen_aps->data = ht;
cps->data = ht;
return true;
}
#else
static bool r_core_init_afen(void *user, const char *input) {
RCmd *rcmd = (RCmd *) user;
RCore *core = (RCore *) rcmd->data;
r_parse_plugin_add (core->parser, &r_parse_plugin_afen);
/*<ut64, RVector<RAfenRepl*>>*/ ht = ht_up_new (NULL, vector_value_free_afen, NULL);
if (!ht) {
R_LOG_ERROR ("Fail to initialize hashtable");
ht_up_free (ht);
return false;
}
return true;
}
#endif
#if R2_VERSION_NUMBER >= 50909
static bool r_core_fini_afen(RCorePluginSession *cps) {
HtUP *ht = cps->data;
ht_up_free (ht);
ht = NULL;
return true;
}
#else
static bool r_core_fini_afen(void *user, const char *input) {
ht_up_free (ht);
ht = NULL;
return true;
}
#endif
static bool check_for_afen_command(RCore *core, const char *input, HtUP *ht) {
if (r_str_startswith (input, "afen*")) {
ht_up_foreach(ht, print_afen_rules, core);
return true;
} else if (r_str_startswith (input, "afen")) {
int argc = 0;
char **argv = r_str_argv (input, &argc);
if (!argv || argc != 3) {
R_LOG_INFO ("Usage: afen new_name old_name");
r_str_argv_free (argv);
return true;
}
#if R2_VERSION_NUMBER >= 50909
RAnalFunction *fcn = r_anal_get_function_at (core->anal, core->addr);
#else
RAnalFunction *fcn = r_anal_get_function_at (core->anal, core->offset);
#endif
if (!fcn) {
#if R2_VERSION_NUMBER >= 50909
R_LOG_ERROR ("No Function at 0x%08" PFMT64x, core->addr);
#else
R_LOG_ERROR ("No Function at 0x%08" PFMT64x, core->offset);
#endif
R_LOG_INFO ("Use afen inside a function!");
r_str_argv_free (argv);
return false;
}
RVector *vec = ht_up_find (ht, fcn->addr, NULL);
if (!vec) {
vec = r_vector_new (sizeof (RAfenRepl), repl_free_afen, NULL);
ht_up_insert (ht, fcn->addr, vec);
}
bool updated = false;
RAfenRepl *repl;
r_vector_foreach (vec, repl) {
if (repl->old_name && argv[2] && !strcmp (repl->old_name, argv[2])) {
if (repl->new_name) {
R_FREE (repl->new_name);
}
repl->new_name = strdup (argv[1]);
updated = true;
break;
}
}
if (updated) {
r_str_argv_free (argv);
return true;
}
repl = R_NEW0 (RAfenRepl);
repl->new_name = strdup (argv[1]);
repl->old_name = strdup (argv[2]);
r_vector_push (vec, repl);
r_str_argv_free (argv);
return true;
}
return false;
}
#if R2_VERSION_NUMBER >= 50909
static bool r_core_call_afen(RCorePluginSession *cps, const char *input) {
return check_for_afen_command(cps->core, input, cps->data);
}
#else
static bool r_core_call_afen(void *user, const char *input) {
return check_for_afen_command((RCore *) user, input, ht);
}
#endif
// RCore plugin Definition Info
RCorePlugin r_core_plugin_afen = {
.meta = {
.name = "core-afen",
.desc = "Rename expressions",
.author = "satk0",
.license = "GPLv3",
},
.call = r_core_call_afen,
.init = r_core_init_afen,
.fini = r_core_fini_afen
};
#ifndef R2_PLUGIN_INCORE
R_API RLibStruct radare_plugin = {
.type = R_LIB_TYPE_CORE,
.data = &r_core_plugin_afen,
.version = R2_VERSION,
#if R2_VERSION_NUMBER >= 50909
.abiversion = R2_ABIVERSION,
#endif
};
#endif
+22
View File
@@ -0,0 +1,22 @@
R2_LIBEXT=$(shell r2 -H R2_LIBEXT)
R2_USER_PLUGINS=$(shell r2 -H R2_USER_PLUGINS)
CFLAGS+=$(shell pkg-config --cflags r_core)
LDFLAGS+=$(shell pkg-config --libs r_core)
CFLAGS+=-Igpu/wrap
all: gpu
$(CC) $(CFLAGS) $(LDFLAGS) -shared -fPIC arch_asahi.c -o arch_asahi.$(R2_LIBEXT)
mrproper clean:
rm -f *.$(R2_LIBEXT)
gpu:
git clone https://github.com/AsahiLinux/gpu
install:
mkdir -p "$(R2_USER_PLUGINS)"
cp -f arch_asahi.$(R2_LIBEXT) $(R2_USER_PLUGINS)
uninstall:
rm -f $(R2_USER_PLUGINS)/arch_asahi.$(R2_LIBEXT)
+14
View File
@@ -0,0 +1,14 @@
ASAHI
=====
This is the r2 disassembler plugin for
the ASAHI GPU shipped in the Apple M1.
This plugin is just a shim on top of [AsahiLinux](https://github.com/AsahiLinux/gpu)
Installation
------------
* Install r2 from git and then type `make; make install`
Alternatively you can just `r2pm -ci asahi`
+40
View File
@@ -0,0 +1,40 @@
/* radare2 - GPL3 - Copyright 2021-2023 - pancake */
#include <r_lib.h>
#include <r_arch.h>
#include "gpu/disasm/disasm.c"
static bool decode(RArchSession *as, RAnalOp *op, RAnalOpMask mask) {
char out[128];
FILE *fp = fmemopen (out, sizeof (out), "w");
*out = 0;
bool stop = false;
int res = agx_disassemble_instr ((uint8_t*)op->bytes, &stop, false, fp);
fclose (fp);
r_str_replace_char (out, '\n', ' ');
free (op->mnemonic);
op->mnemonic = r_str_trim_dup (out);
op->size = res;
return op->size;
}
static RArchPlugin r_arch_plugin_asahi = {
.meta = {
.name = "asahi",
.license = "MIT",
.desc = "Asahi: Apple's M1 GPU",
},
.arch = "asahi",
.bits = 32,
.decode = &decode,
};
#ifndef CORELIB
RLibStruct radare_plugin = {
.type = R_LIB_TYPE_ARCH,
.data = &r_arch_plugin_asahi,
.version = R2_VERSION
};
#endif
+30 -1
View File
@@ -5,10 +5,39 @@
# git clone https://github.com/radare/acr
#
# -- pancake
#!/bin/sh
#
# Look for the 'acr' tool here: https://github.com/radare/acr
# Clone last version of ACR from here:
# git clone https://github.com/radare/acr
#
# -- pancake
r2pm -h >/dev/null 2>&1
if [ $? = 0 ]; then
echo "Installing the last version of 'acr'..."
r2pm -i acr > /dev/null
r2pm -r acr -h > /dev/null 2>&1
if [ $? = 0 ]; then
echo "Running 'acr -p'..."
r2pm -r acr -p
else
echo "Cannot find 'acr' in PATH"
fi
else
echo "Running acr..."
acr -p
fi
V=`./configure -qV | cut -d - -f -1`
if [ -n "$1" ]; then
echo "./configure $*"
./configure $*
fi
files=`find . -name configure.acr`
for a in ${files}; do
echo "[+] $a"
( cd `dirname $a` ; acr -p )
( cd `dirname $a` ; r2pm -r acr -p )
done
if [ -n "$1" ]; then
echo "./configure $@"
+22 -12
View File
@@ -4,30 +4,33 @@
#include <r_types.h>
#include <r_lib.h>
#include <r_asm.h>
// #include <r_arch.h>
#include <r_anal.h>
#include <stdio.h>
#include <fcntl.h>
static int ptsHandle=0;
static int ptsHandle = 0;
static int reg_read(RAnalEsil *esil, const char *regname, ut64 *num) {
static bool reg_read(RAnalEsil *esil, const char *regname, ut64 *num) {
RRegItem *reg = r_reg_get (esil->anal->reg, regname, -1);
if (reg) {
if (num)
if (num) {
*num = r_reg_get_value (esil->anal->reg, reg);
return 1;
}
return true;
}
return 0;
return false;
}
static int reg_write(RAnalEsil *esil, const char *regname, ut64 num) {
static bool reg_write(RAnalEsil *esil, const char *regname, ut64 num) {
RRegItem *reg = r_reg_get (esil->anal->reg, regname, -1);
if (reg) {
if (num)
if (num) {
r_reg_set_value (esil->anal->reg, reg,num);
return 1;
}
return true;
}
return 0;
return false;
}
/*
@@ -543,6 +546,10 @@ static int esil_baleful_intr (RAnalEsil *esil, int intr) {
return true;
}
static bool esil_bale_interrupt_wrapper_cb (RAnalEsil *esil, ut32 interrupt, void *user) { //user is always NULL, bc we has no init and fini
return !!esil_baleful_intr (esil, interrupt);
}
static int set_reg_profile(RAnal *anal) {
const char *p = \
"=PC pc\n"
@@ -598,8 +605,13 @@ static int set_reg_profile(RAnal *anal) {
return r_reg_set_profile_string (anal->reg, p);
}
static int esil_baleful_init (RAnalEsil *esil) {
if (!esil)
if (!esil) {
return false;
}
r_anal_esil_set_interrupt(esil,0,esil_bale_interrupt_wrapper_cb, NULL);
r_anal_esil_set_interrupt(esil,4,esil_bale_interrupt_wrapper_cb, NULL);
r_anal_esil_set_interrupt(esil,11,esil_bale_interrupt_wrapper_cb, NULL);
return true;
/*
internalMemory=malloc(4096);
if (!internalMemory) {
@@ -610,7 +622,6 @@ static int esil_baleful_init (RAnalEsil *esil) {
*((ut32 *)internalMemory)=0xdeadbeef;
eprintf("leido :%08x\n",*((ut32 *)internalMemory));
*/
return true;
}
static int esil_baleful_fini (RAnalEsil *esil) {
@@ -628,7 +639,6 @@ static RAnalPlugin r_anal_plugin_baleful = {
.bits = 32,
.esil_init = esil_baleful_init,
.esil_fini = esil_baleful_fini,
.esil_intr = esil_baleful_intr,
.esil = true,
.op = &baleful_op,
.set_reg_profile = set_reg_profile,
+36 -35
View File
@@ -211,124 +211,125 @@ static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len) {
const ut8 *r1;
const ut32 *imm;
const ut32 *imm1;
char outbuf[32] = {0};
switch (*buf) {
case 2://8 8 11 5
op->size = asm_baleful_getregs(buf,op->buf_asm,"+",0);
op->size = asm_baleful_getregs(buf,outbuf,"+",0);
break;
case 3://8 8 11 5
op->size = asm_baleful_getregs(buf,op->buf_asm,"-",0);
op->size = asm_baleful_getregs(buf,outbuf,"-",0);
break;
case 4://8 8 11 5
op->size = asm_baleful_getregs(buf,op->buf_asm,"*",0);
op->size = asm_baleful_getregs(buf,outbuf,"*",0);
break;
case 6://8 8 11 5
op->size = asm_baleful_getregs(buf,op->buf_asm,"^",0);
op->size = asm_baleful_getregs(buf,outbuf,"^",0);
break;
case 9://8 8 11 5
op->size = asm_baleful_getregs(buf,op->buf_asm,"&",0);
op->size = asm_baleful_getregs(buf,outbuf,"&",0);
break;
case 10://8 8 11 5
op->size = asm_baleful_getregs(buf,op->buf_asm,"|",0);
op->size = asm_baleful_getregs(buf,outbuf,"|",0);
break;
case 12://8 8 11 5
op->size = asm_baleful_getregs(buf,op->buf_asm,"<<",0);
op->size = asm_baleful_getregs(buf,outbuf,"<<",0);
break;
case 13://8 8 11 5
op->size = asm_baleful_getregs(buf,op->buf_asm,">>",0);
op->size = asm_baleful_getregs(buf,outbuf,">>",0);
break;
case 5: // //9 9 12 6
op->size = asm_baleful_getregs(buf,op->buf_asm,"/",1);
op->size = asm_baleful_getregs(buf,outbuf,"/",1);
break;
case 22: // 7 7 10 4
op->size = asm_baleful_getregs(buf,op->buf_asm,"and",2);
op->size = asm_baleful_getregs(buf,outbuf,"and",2);
break;
case 23: // 7 7 10 4
op->size = asm_baleful_getregs(buf,op->buf_asm,"cmp",2);
op->size = asm_baleful_getregs(buf,outbuf,"cmp",2);
break;
case 24: //7 4
op->size = asm_baleful_getregs(buf,op->buf_asm,"mov",3);
op->size = asm_baleful_getregs(buf,outbuf,"mov",3);
break;
case 30: // 6 3
op->size = asm_baleful_getregs(buf,op->buf_asm,"push",4);
op->size = asm_baleful_getregs(buf,outbuf,"push",4);
break;
case 15: //5
op->size = asm_baleful_getregs(buf,op->buf_asm,"call",5);
op->size = asm_baleful_getregs(buf,outbuf,"call",5);
break;
case 14: //5
op->size = asm_baleful_getregs(buf,op->buf_asm,"jmp",5);
op->size = asm_baleful_getregs(buf,outbuf,"jmp",5);
break;
case 16: //5
op->size = asm_baleful_getregs(buf,op->buf_asm,"jz",5);
op->size = asm_baleful_getregs(buf,outbuf,"jz",5);
break;
case 17: //5
op->size = asm_baleful_getregs(buf,op->buf_asm,"js",5);
op->size = asm_baleful_getregs(buf,outbuf,"js",5);
break;
case 18: //5
op->size = asm_baleful_getregs(buf,op->buf_asm,"jbe",5);
op->size = asm_baleful_getregs(buf,outbuf,"jbe",5);
break;
case 19: //5
op->size = asm_baleful_getregs(buf,op->buf_asm,"jg",5);
op->size = asm_baleful_getregs(buf,outbuf,"jg",5);
break;
case 20: //5
op->size = asm_baleful_getregs(buf,op->buf_asm,"jns",5);
op->size = asm_baleful_getregs(buf,outbuf,"jns",5);
break;
case 21: //5
op->size = asm_baleful_getregs(buf,op->buf_asm,"jnz",5);
op->size = asm_baleful_getregs(buf,outbuf,"jnz",5);
break;
case 27: //3
op->size = 3;
r = buf + 1;
r1 = buf + 2;
snprintf (op->buf_asm, R_ASM_BUFSIZE, "mov r_%02x,[r_%02x]",*r,*r1);
snprintf (outbuf, sizeof (outbuf), "mov r_%02x,[r_%02x]",*r,*r1);
break;
case 28: //3
r = buf + 1;
r1 = buf + 2;
op->size = 3;
snprintf (op->buf_asm, R_ASM_BUFSIZE, "mov [r_%02x],r_%02x",*r,*r1);
snprintf (outbuf, sizeof (outbuf), "mov [r_%02x],r_%02x",*r,*r1);
break;
case 11: //3
op->size = 3;
snprintf (op->buf_asm, R_ASM_BUFSIZE, "regX= regY==0");
snprintf (outbuf, sizeof (outbuf), "regX= regY==0");
break;
case 7: //3
op->size = 3;
snprintf (op->buf_asm, R_ASM_BUFSIZE, "regX= NEG regY");
snprintf (outbuf, sizeof (outbuf), "regX= NEG regY");
break;
case 8: //3
op->size = 3;
snprintf (op->buf_asm, R_ASM_BUFSIZE, "regX= NOT regY");
snprintf (outbuf, sizeof (outbuf), "regX= NOT regY");
break;
case 25: //2
op->size = asm_baleful_getregs(buf,op->buf_asm,"++",6);
op->size = asm_baleful_getregs(buf,outbuf,"++",6);
break;
case 26: //2
op->size = asm_baleful_getregs(buf,op->buf_asm,"--",6);
op->size = asm_baleful_getregs(buf,outbuf,"--",6);
break;
case 31: //2
op->size = asm_baleful_getregs(buf,op->buf_asm,"pop",6);
op->size = asm_baleful_getregs(buf,outbuf,"pop",6);
break;
case 32: // 2
op->size = asm_baleful_getregs(buf,op->buf_asm,"apicall",7);
op->size = asm_baleful_getregs(buf,outbuf,"apicall",7);
break;
case 1:
op->size = 1;
strcpy (op->buf_asm, "ret");
strcpy (outbuf, "ret");
break;
case 0:
op->size = 1;
strcpy (op->buf_asm, "nop");
strcpy (outbuf, "nop");
break;
case 29:
op->size = 1;
strcpy (op->buf_asm, "end virtual");
strcpy (outbuf, "end virtual");
break;
default:
op->size = 1;
strcpy (op->buf_asm, "nop");
strcpy (outbuf, "nop");
break;
}
r_strbuf_set (&op->buf_asm, outbuf);
return op->size;
}
+4 -4
View File
@@ -37,7 +37,7 @@ static int findpair(ut64 addr, const ut8 *buf, int len, int base) {
return 0;
}
static int bcl_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *buf, int len) {
static int bcl_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *buf, int len, RAnalOpMask mask) {
int i;
char cache[256] = {0};
ut64 dst = 0LL;
@@ -76,7 +76,7 @@ static int bcl_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *buf, int len)
return op->size;
}
static int set_reg_profile(RAnal *anal) {
static bool set_reg_profile(RAnal *anal) {
const char *p = \
"=PC pc\n"
"=SP sp\n"
@@ -93,7 +93,7 @@ static int set_reg_profile(RAnal *anal) {
return r_reg_set_profile_string (anal->reg, p);
}
struct r_anal_plugin_t r_anal_plugin_bcl = {
RAnalPlugin r_anal_plugin_bcl = {
.name = "bcl",
.desc = "Base Call DNA Illumina records",
.license = "BSD",
@@ -101,7 +101,7 @@ struct r_anal_plugin_t r_anal_plugin_bcl = {
.bits = 8,
.esil = true,
.op = &bcl_op,
.set_reg_profile = set_reg_profile,
.set_reg_profile = &set_reg_profile
};
#ifndef CORELIB
+6 -3
View File
@@ -9,21 +9,23 @@ static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len) {
const char *bases = "ACGT";
if (a->pc == 0) {
ut32 *clusters = (ut32*)buf;
snprintf (op->buf_asm, sizeof (op->buf_asm), "clusters %d\n", *clusters);
r_strbuf_setf (&op->buf_asm, "clusters %d", *clusters);
// snprintf (op->buf_asm, sizeof (op->buf_asm), "clusters %d\n", *clusters);
return op->size = 4;
}
if (*buf != 0) {
char base = bases[*buf & 3];
int qual = *buf >> 2;
snprintf (op->buf_asm, sizeof (op->buf_asm), "%c ; %d", base, qual);
r_strbuf_setf (&op->buf_asm, "%c ; %d", base, qual);
op->size = 1;
return 1;
}
strcpy (op->buf_asm, ".");
r_strbuf_setf (&op->buf_asm, ".");
return 0;
}
static int assemble(RAsm *a, RAsmOp *op, const char *buf) {
#if 0
bool qmode = false;
int quality = 0;
int outsz = 128;
@@ -76,6 +78,7 @@ static int assemble(RAsm *a, RAsmOp *op, const char *buf) {
out[op->size] = (quality<<2) | base;
op->size ++;
}
#endif
return op->size;
}
+65 -90
View File
@@ -5,8 +5,11 @@
#include <r_lib.h>
#include <r_bin.h>
static int check_bytes(const ut8 *buf, ut64 length) {
if (buf && length >= 4) {
static bool __check_buffer(RBinFile *bf, RBuffer *b) {
ut8 buf[8];
int length = r_buf_size (b);
int r = r_buf_read_at (b, 0, buf, sizeof (buf));
if (r == sizeof (buf)) {
ut32 cls = r_mem_get_num (buf, 4);
ut32 cls2 = r_mem_get_num (buf + 4, 4);
if (cls + 4 == length && !cls2) {
@@ -16,64 +19,49 @@ static int check_bytes(const ut8 *buf, ut64 length) {
return false;
}
static int check(RBinFile *arch) {
const ut8 *bytes = arch ? r_buf_buffer (arch->buf) : NULL;
ut64 sz = arch ? r_buf_size (arch->buf): 0;
return check_bytes (bytes, sz);
static bool load_buffer(RBinFile *bf, void **bin_obj, RBuffer *buf, ut64 loadaddr, Sdb *sdb) {
return __check_buffer (bf, buf);
}
static Sdb* get_sdb (RBinObject *o) {
if (!o) return NULL;
//struct r_bin_[NAME]_obj_t *bin = (struct r_bin_r_bin_[NAME]_obj_t *) o->bin_obj;
//if (bin->kv) return kv;
return NULL;
}
static void * load_bytes(RBinFile *arch, const ut8 *buf, ut64 sz, ut64 loadaddr, Sdb *sdb){
return (void*)(size_t)check_bytes (buf, sz);
}
static int load(RBinFile *arch) {
return check(arch);
}
static int destroy (RBinFile *arch) {
return true;
}
static ut64 baddr(RBinFile *arch) {
static ut64 baddr(RBinFile *bf) {
return 4;
}
static RBinAddr* binsym(RBinFile *arch, int type) {
static RBinAddr* binsym(RBinFile *bf, int type) {
return NULL; // TODO
}
static ut64 findEntry(RBuffer *buf, int n) {
ut8 b;
ut64 buf_size = r_buf_size (buf);
int i;
for (i=4;i<buf->length; i++) {
if (buf->buf[i] != 0) {
for (i = 4; i < buf_size; i++) {
if (r_buf_read_at (buf, i, &b, 1) != 1) {
break;
}
if (b != 0) {
if (n == 0) {
return i;
}
n--;
for (++i; i<buf->length; i++) {
if (!buf->buf[i])
for (++i; i < buf_size && b; i++) {
if (r_buf_read_at (buf, i, &b, 1) != 1) {
break;
}
}
}
}
return 0;
}
static RList* entries(RBinFile *arch) {
static RList* entries(RBinFile *bf) {
RList* ret = r_list_newf (free);
RBinAddr *ptr = NULL;
if (ret) {
if ((ptr = R_NEW0 (RBinAddr))) {
ut64 entry = findEntry (arch->buf, 2);
if (!entry) entry = findEntry (arch->buf, 1);
if (!entry) entry = findEntry (arch->buf, 0);
ut64 entry = findEntry (bf->buf, 2);
if (!entry) entry = findEntry (bf->buf, 1);
if (!entry) entry = findEntry (bf->buf, 0);
if (!entry) entry = 4;
ptr->paddr = entry;
ptr->vaddr = entry;
@@ -86,79 +74,74 @@ static RList* entries(RBinFile *arch) {
return ret;
}
static RList* sections(RBinFile *arch) {
static RList* sections(RBinFile *bf) {
RList *ret = NULL;
RBinSection *ptr = NULL;
ut64 textsize, datasize, symssize, spszsize, pcszsize;
ut64 entry0 = findEntry (arch->buf, 0);
ut64 entry1 = findEntry (arch->buf, 1);
ut64 entry2 = findEntry (arch->buf, 2);
ut64 entry0 = findEntry (bf->buf, 0);
ut64 entry1 = findEntry (bf->buf, 1);
ut64 entry2 = findEntry (bf->buf, 2);
if (!(ret = r_list_newf (free))) {
return NULL;
}
// add text segment
textsize = r_mem_get_num (arch->buf->buf + 4, 4);
ut8 str[4] = {0};
r_buf_read_at (bf->buf, 4, str, 4);
textsize = r_mem_get_num (str, 4);
if (!(ptr = R_NEW0 (RBinSection))) {
return ret;
}
if (!entry1) {
entry1 = arch->buf->length;
entry1 = r_buf_size (bf->buf);
}
strncpy (ptr->name, "init", R_BIN_SIZEOF_STRINGS);
ptr->size = entry1-entry0;
ptr->vsize = entry1-entry0;
ptr->name = strdup ("init");
ptr->size = entry1 - entry0;
ptr->vsize = entry1 - entry0;
ptr->paddr = entry0 + 4;
ptr->vaddr = entry0;
ptr->srwx = R_BIN_SCN_READABLE | R_BIN_SCN_EXECUTABLE | R_BIN_SCN_MAP; // r-x
ptr->add = true;
ptr->perm = R_PERM_RX;
r_list_append (ret, ptr);
if (entry1) {
if (entry2) {
if (!(ptr = R_NEW0 (RBinSection)))
if (!(ptr = R_NEW0 (RBinSection))) {
return ret;
strncpy (ptr->name, "fini", R_BIN_SIZEOF_STRINGS);
ptr->size = entry2-entry1;
ptr->vsize = entry2-entry1;
}
ptr->name = strdup ("fini");
ptr->size = entry2 - entry1;
ptr->vsize = entry2 - entry1;
ptr->paddr = entry1 + 4;
ptr->vaddr = entry1;
ptr->srwx = R_BIN_SCN_READABLE | R_BIN_SCN_EXECUTABLE | R_BIN_SCN_MAP; // r-x
ptr->perm = R_PERM_RX;
ptr->add = true;
r_list_append (ret, ptr);
} else {
entry2 = entry1;
}
}
if (entry2) {
if (!(ptr = R_NEW0 (RBinSection)))
if (!(ptr = R_NEW0 (RBinSection))) {
return ret;
strncpy (ptr->name, "text", R_BIN_SIZEOF_STRINGS);
ptr->size = arch->buf->length - entry2;
ptr->vsize = arch->buf->length - entry2;
}
ptr->name = strdup ("text");
ut64 filesize = r_buf_size (bf->buf);
ptr->size = filesize - entry2;
ptr->vsize = filesize - entry2;
ptr->paddr = entry2 + 4;
ptr->vaddr = entry2;
ptr->srwx = R_BIN_SCN_READABLE | R_BIN_SCN_EXECUTABLE | R_BIN_SCN_MAP; // r-x
ptr->perm = R_PERM_RX;
ptr->add = true;
r_list_append (ret, ptr);
}
return ret;
}
static RList* symbols(RBinFile *arch) {
// TODO: parse symbol table
return NULL;
}
static RList* imports(RBinFile *arch) {
return NULL;
}
static RList* libs(RBinFile *arch) {
return NULL;
}
static RBinInfo* info(RBinFile *arch) {
static RBinInfo* info(RBinFile *bf) {
RBinInfo *ret = R_NEW0 (RBinInfo);
if (ret) {
ret->file = strdup (arch->file);
ret->file = strdup (bf->file);
ret->bclass = strdup ("dna");
ret->rclass = strdup ("bcl");
ret->os = strdup ("Illumina DNA Sequences");
@@ -174,18 +157,17 @@ static RBinInfo* info(RBinFile *arch) {
return ret;
}
static ut64 size(RBinFile *arch) {
ut64 text, data, syms, spsz;
int big_endian;
if (!arch->o->info) {
arch->o->info = info (arch);
static ut64 size(RBinFile *bf) {
if (!bf->o->info) {
bf->o->info = info (bf);
}
big_endian = arch->o->info->big_endian;
ut8 str[32] = {0};
r_buf_read_at (bf->buf, 0, str, 32);
// TODO: reuse section list
text = r_mem_get_num (arch->buf->buf + 4, 4);
data = r_mem_get_num (arch->buf->buf + 8, 4);
syms = r_mem_get_num (arch->buf->buf + 16, 4);
spsz = r_mem_get_num (arch->buf->buf + 24, 4);
ut64 text = r_mem_get_num (str + 4, 4);
ut64 data = r_mem_get_num (str + 8, 4);
ut64 syms = r_mem_get_num (str + 16, 4);
ut64 spsz = r_mem_get_num (str + 24, 4);
return text + data + syms + spsz + (6 * 4);
}
@@ -193,25 +175,18 @@ RBinPlugin r_bin_plugin_bcl = {
.name = "bcl",
.desc = "Base Call DNA Illumina",
.license = "BSD",
.get_sdb = &get_sdb,
.load = &load,
.load_bytes = &load_bytes,
.load_buffer = &load_buffer,
.check_buffer = &__check_buffer,
.size = &size,
.destroy = &destroy,
.check = &check,
.check_bytes = &check_bytes,
.baddr = &baddr,
.binsym = &binsym,
.entries = &entries,
.sections = &sections,
.symbols = &symbols,
.imports = &imports,
.info = &info,
.libs = &libs,
};
#ifndef CORELIB
struct r_lib_struct_t radare_plugin = {
RLibStruct radare_plugin = {
.type = R_LIB_TYPE_BIN,
.data = &r_bin_plugin_bcl,
.version = R2_VERSION
+2 -2
View File
@@ -5,7 +5,7 @@
"main": "index.js",
"repository": {
"type": "git",
"url": "https://github.com/radare/radare2-bindings.git"
"url": "https://github.com/radareorg/radare2-bindings.git"
},
"keywords": [
"radare",
@@ -24,7 +24,7 @@
},
"license": "LGPL-3.0",
"bugs": {
"url": "https://github.com/radare/radare2-extras/issues"
"url": "https://github.com/radareorg/radare2-extras/issues"
},
"homepage": "http://www.radare.org",
"devDependencies": {
+11
View File
@@ -0,0 +1,11 @@
This is the r2 plugin to read/write memory using the checkm8 exploit.
1. Clone https://github.com/axi0mX/ipwndfu
2. Copy this file into the root directory of this repository
3. r2 -I r2io.py ipwndfu://
4. enjoy
NOTES
* This is very unstable, reading on unallocated regions results in device reboot
* Requires python3 .. so maybe better use @geohot's fork
+65
View File
@@ -0,0 +1,65 @@
# iOS pwndfu checkm8 io plugin for radare2
# ========================================
#
# -- pancake @ nopcode.org
#
# Usage:
# r2 -I test-py-io.py pwndfu://
#
# The r2lang.plugin function exposes a way to register new plugins
# into the RCore instance. This API is only available from RLang.
# You must call with with '#!python test.py' or 'r2 -i test.py ..'
import r2lang
from dfuexec import *
FAKESIZE = 512
device = None
def pyio(a):
def _open(path, rw, perm):
global device
device = dfu.acquire_device()
serial_number = device.serial_number
dfu.release_device(device)
device = PwnedDFUDevice()
print("MyPyIO Opening %s"%(path))
return 1234
def _check(path, many):
print("python-check %s"%(path))
return path[0:9] == "pwndfu://"
def _read(offset, length):
global device
res = device.read_memory(address, length)
print("python-read")
return res
def _seek(offset, whence):
print("python-seek")
if whence == 0: # SET
return offset
if whence == 1: # CUR
return offset
if whence == 2: # END
return ROM_SIZE
return ROM_SIZE
def _write(offset, data, length):
print("TODO: python-write")
return True
def _system(cmd):
print("pwndfu://%s"%(cmd))
return True
return {
"name": "pwndfu",
"license": "GPL",
"desc": "pwndfu IO plugin (pwndfu://3)",
"check": _check,
"open": _open,
"read": _read,
"seek": _seek,
"write": _write,
"system": _system,
}
print("Registering Python IO plugin...")
print(r2lang.plugin("io", pyio))
Vendored
+165 -61
View File
@@ -1,9 +1,10 @@
#!/bin/sh
# This script was automatically generated by ACR v1.3
# This script was automatically generated by ACR v2.2.4
# @author: pancake <nopcode.org>
# @url: http://www.nopcode.org
# @repo: git clone https://github.com/radare/acr
[ -z "${AWK}" ] && AWK=awk
do_remove() {
if [ "${ACR_RMFILES}" ]; then
printf "cleaning temporally files... "
@@ -25,7 +26,7 @@ while : ; do
ENVWORDS="${ENVWORDS} $1_CPU $1_OS"
STR=`eval "echo ${S}$1"`
SPLIT_CPU="`echo "$STR" | cut -d - -f 1`"
SPLIT_OS="`echo "$STR" | awk -F - '{
SPLIT_OS="`echo "$STR" | $AWK -F - '{
if ($2=="unknown"){
if (NF<3) { print $2; } else { print $3; }
} else {
@@ -40,6 +41,11 @@ shift
done
}
QUIET=0
be_quiet() {
QUIET=1
}
VPATH=`dirname ${0}`
if [ "${VPATH}" = "." ]; then
WODIS=current
@@ -61,12 +67,27 @@ if [ -e "${VPATH}/config.guess" ]; then
sh ${VPATH}/config.guess
return
fi
CPU="`uname -m|sed -e 's, ,,g'|cut -d - -f 1`"
CPU="`uname -m | tr 'A-Z' 'a-z' | sed -e 's, ,,g' | cut -d - -f 1`"
OS="`uname -s|tr A-Z a-z`"
uname -r | grep -qE "(Microsoft|WSL)" 2>/dev/null && OS="wsl"
GNU="`uname --help 2>&1 | grep gnu`"
[ "${GNU}" ] && OS="${OS}-gnu"
[ "${CPU}" = ppc ] && CPU="powerpc"
echo "${CPU}-unknown-${OS}"
# normalize CPU
case "${CPU}" in
ppc*|powermac*|powermacintosh*|powerpc*)
if echo "${CPU}" | grep -q '64'; then
CPU=powerpc64
else
CPU=powerpc
fi
;;
*) ;;
esac
VENDOR="unknown"
if [ "${OS}" = "darwin" ]; then
VENDOR=apple
fi
echo "${CPU}-${VENDOR}-${OS}"
}
SEARCHPATH="/usr /usr/local /usr/pkg /sw"
@@ -76,15 +97,19 @@ CROSSBUILD=0
BUILD=`guess_os`
HOST="${BUILD}"
TARGET="${HOST}"
ETCDIR="/etc"
SYSCONFDIR=""
DESCRIPTION=""
create_environ() {
: ${EPREFIX:="${PREFIX}"}
: ${SPREFIX:="${PREFIX}"}
: ${BINDIR:="${SPREFIX}/bin"}
: ${SBINDIR:="${PREFIX}/sbin"}
: ${SYSCONFDIR:="${SPREFIX}/etc"}
: ${ETCDIR:="${SPREFIX}/etc"}
: ${LIBDIR:="${SPREFIX}/lib"}
: ${PKGCFG_LIBDIR:='${exec_prefix}/lib'}
: ${PKGCFG_INCDIR:='${prefix}/include'}
: ${LIBEXECDIR:="${SPREFIX}/libexec"}
: ${INCLUDEDIR:="${SPREFIX}/include"}
: ${DATADIR:="${SPREFIX}/share"}
@@ -103,12 +128,12 @@ done
: ${INSTALL_PROGRAM_STRIP:=${INSTALL} -m 755 -s}
: ${INSTALL_MAN:=${INSTALL} -m 444}
: ${INSTALL_LIB:=${INSTALL} -m 755 -c}
PKGNAME='radare2-extras' ; VERSION='2.1.0' ; CONTACT_MAIL="[email protected]" ; CONTACT_NAME="pancake" ; CONTACT="pancake <[email protected]>" ;
PKGNAME='radare2-extras' ; VERSION='6.0.0' ; VERSION_MAJOR=6; VERSION_MINOR=0; VERSION_PATCH=0; VERSION_NUMBER=60000; CONTACT_MAIL="[email protected]" ; CONTACT_NAME="pancake" ; CONTACT="pancake <[email protected]>" ;
}
show_usage() {
cat <<EOF2
'configure' configures radare2-extras-2.1.0 to adapt to many kinds of systems.
'configure' configures radare2-extras-6.0.0 to adapt to many kinds of systems.
Usage: ./configure [OPTION]... [VAR=VALUE]...
@@ -120,6 +145,7 @@ Defaults for the options are specified in brackets.
Configuration:
-h, --help display this help and exit
-r, --report show what libs/programs require to work
-q, --quiet be quiet, less verbose (see ./configure -qV)
-V, --version display version information and exit
Installation directories:
@@ -139,6 +165,7 @@ Fine tuning of the installation directories:
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--mandir=DIR man documentation [DATADIR/man]
--sbindir=DIR system admin executables [EPREFIX/sbin]
--etcdir=DIR same as --sysconfdir (/etc)
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
@@ -157,7 +184,6 @@ printf "
Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
CPPFLAGS C preprocessor flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
@@ -177,8 +203,22 @@ take_environ() {
: ${PREFIX:=/usr/local/}
}
ochof() {
[ "$QUIET" = 1 ] && return
printf "$*"
}
ocho() {
[ "$QUIET" = 1 ] && return
echo "$*"
}
show_version() {
echo "radare2-extras-2.1.0 configuration script done with acr v1.3.
if [ "$QUIET" = 1 ]; then
echo "6.0.0"
exit 0
fi
echo "radare2-extras-6.0.0 configuration script done with acr v2.2.4.
The 'Free Software Foundation' message is only for autodetection.
Originally written by pancake <nopcode.org>."
exit 0
@@ -186,7 +226,7 @@ exit 0
parse_options() {
flag=`echo $1| cut -d = -f 1`
value=`echo $1| awk 'BEGIN{FS="=";}{print $2}'`
value=`echo $1| $AWK 'BEGIN{FS="=";}{print $2}'`
flag2=`echo $flag|cut -f2- -d -| sed -e 's,-,_,g' -e 's,^_,,g'|tr '[a-z]' '[A-Z]'`
if [ "${TARGET_OS}" = "darwin" ]; then
@@ -198,15 +238,22 @@ fi
case $flag in
-h|--help|--hel|--h|--he|-help)
show_usage ; ;;
-qV|-quiet-version|--quiet-version)
be_quiet
show_version ; ;;
-q|-quiet|--quiet)
be_quiet ; ;;
-V|-version|--version)
show_version ; ;;
-r|--r|--report)
echo "PKGNAME: radare2-extras"
echo "VERSION: 2.1.0"
echo "LANGS: c"
echo "OPTIONAL: libewf"
echo "PKG-CONFIG: r_core libewf unicorn yara"
echo "FLAGS: --with-ostype=auto --without-ewf"
echo "PKGNAME: radare2-extras"
echo "VERSION: 6.0.0"
echo "AUTHOR: pancake"
echo "EMAIL: [email protected]"
echo "LANGS: c"
echo "OPTIONAL: libewf libyara"
echo "PKGCONFIG: r_core libewf unicorn yara"
echo "FLAGS: --with-ostype=auto --without-ewf"
exit 0
;;
--cache-file)
@@ -236,16 +283,22 @@ echo "FLAGS: --with-ostype=auto --without-ewf"
--datadir)
DATADIR="$value"; ;;
--sysconfdir)
SYSCONFDIR="$value"; ;;
SYSCONFDIR="$value"
ETCDIR="$value"; ;;
--etcdir)
SYSCONFDIR="$value"
ETCDIR="$value"; ;;
--sharedstatedir)
SHAREDSTATEDIR="$value"; ;;
--localstatedir)
LOCALSTATEDIR="$value"; ;;
--libdir)
LIBDIR="$value"; ;;
LIBDIR="$value"
PKGCFG_LIBDIR="$value"; ;;
--libpath)
LDFLAGS="${LDFLAGS} ${LIBPATH}$value"; ;;
--includedir)
PKGCFG_INCDIR="$value"
INCLUDEDIR="$value"; CFLAGS="${CFLAGS} -I$value"; ;;
--infodir)
INFODIR="$value"; ;;
@@ -271,49 +324,80 @@ parse_options "$1"
shift
done
ENVWORDS="MANDIR INFODIR LIBDIR INCLUDEDIR LOCALSTATEDIR SYSCONFDIR DATADIR DOCDIR LIBEXECDIR SBINDIR BINDIR EPREFIX PREFIX SPREFIX TARGET HOST BUILD INSTALL INSTALL_LIB INSTALL_MAN INSTALL_PROGRAM INSTALL_PROGRAM_STRIP INSTALL_DIR INSTALL_SCRIPT INSTALL_DATA HOST_OS HOST_CPU BUILD_OS BUILD_CPU TARGET_OS TARGET_CPU PKGNAME VPATH VERSION CONTACT CONTACT_NAME CONTACT_MAIL CC CFLAGS CPPFLAGS LDFLAGS HAVE_LANG_C R2_CFLAGS R2_LDFLAGS HAVE_PKGCFG_R_CORE USEROSTYPE HAVE_LIB_EWF EWF_CFLAGS EWF_LDFLAGS HAVE_PKGCFG_LIBEWF WANT_EWF UC_CFLAGS UC_LDFLAGS HAVE_PKGCFG_UNICORN HAVE_LIB_YARA YARA_CFLAGS YARA_LDFLAGS HAVE_PKGCFG_YARA"
ENVWORDS="MANDIR DESCRIPTION INFODIR LIBDIR INCLUDEDIR LOCALSTATEDIR ETCDIR SYSCONFDIR DATADIR DOCDIR LIBEXECDIR SBINDIR BINDIR EPREFIX PREFIX SPREFIX TARGET HOST BUILD INSTALL INSTALL_LIB INSTALL_MAN INSTALL_PROGRAM INSTALL_PROGRAM_STRIP INSTALL_DIR INSTALL_SCRIPT INSTALL_DATA HOST_OS HOST_CPU BUILD_OS BUILD_CPU TARGET_OS TARGET_CPU VERSION VERSION_MAJOR VERSION_MINOR VERSION_PATCH VERSION_NUMBER PKGCFG_LIBDIR PKGCFG_INCDIR PKGNAME VPATH CONTACT CONTACT_NAME CONTACT_MAIL PKGCONFIG CC CFLAGS CPPFLAGS LDFLAGS HAVE_LANG_C R2_CFLAGS R2_LDFLAGS HAVE_PKGCFG_R_CORE USEROSTYPE HAVE_LIB_EWF EWF_CFLAGS EWF_LDFLAGS HAVE_PKGCFG_LIBEWF WANT_EWF UC_CFLAGS UC_LDFLAGS HAVE_PKGCFG_UNICORN HAVE_LIB_YARA YARA_CFLAGS YARA_LDFLAGS HAVE_PKGCFG_YARA"
create_environ
echo "checking build system type... ${BUILD}"
echo "checking host system type... ${HOST}"
echo "checking target system type... ${TARGET}"
ocho "checking build system type... ${BUILD}"
ocho "checking host system type... ${HOST}"
ocho "checking target system type... ${TARGET}"
[ "${CROSSBUILD}" = 1 ] && echo "using crosscompilation mode."
#split_host BUILD HOST TARGET
[ -n "${prefix}" ] && PREFIX="${prefix}"
echo "checking for working directories... ${WODIS}"
echo "using prefix '${PREFIX}'"
ocho "checking for working directories... ${WODIS}"
ocho "using prefix '${PREFIX}'"
ACR_RMFILES=" test.c a.out a.exe"
ochof "checking for pkg-config... "
ENVWORDS="${ENVWORDS} HAVE_PKGCONFIG"
if [ -n "$PKGCONFIG" ]; then
if [ -x "$PKGCONFIG" ]; then
_HAVE_PKGCONFIG="${PKGCONFIG}"
else
ocho "PKGCONFIG env is not executable"
PKGCONFIG=""
fi
else
IFS=:
for A in ${PATH} ; do
if [ -x "${A}/pkg-config" ]; then
PKGCONFIG="${A}/pkg-config"
elif [ -x "${A}/pkgconf" ]; then
PKGCONFIG="${A}/pkgconf"
else
continue
fi
break
done
unset IFS
fi
if [ -n "${PKGCONFIG}" ]; then
ocho ${PKGCONFIG}
HAVE_PKGCONFIG=1
else
HAVE_PKGCONFIG=0
echo "Cannot find pkg-config or pkgconf in PATH" >&2
exit 1
ocho no; fi
COMPILER=CC
printf "checking for c compiler... "
ochof "checking for c compiler... "
HAVE_LANG_C=1
if [ "${CROSSBUILD}" = 1 ]; then
(command -v ${HOST}-${CC} >/dev/null 2>&1)
if [ $? = 0 ]; then CC="${HOST}-${CC}"; fi
fi
echo "int main(int argc, char **argv){return 0;}" > test.c
(exec ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} test.c >/dev/null 2>&1)
(exec ${CC} -o a.out ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} test.c >/dev/null 2>&1)
if [ $? = 0 ]; then echo ${CC}; else
echo no ; HAVE_LANG_C=0
do_remove
echo "ERROR: ${CC} cannot create executables" >&2 ;
exit 1 ; fi
[ -z "${PKGCONFIG}" ] && PKGCONFIG=pkg-config
type ${PKGCONFIG} > /dev/null 2>&1 || echo "ERROR: Cannot find PKGCONFIG ${PKGCONFIG}"
if [ -z "${PKGCONFIG}" ]; then pkg-config --version >/dev/null 2>&1 ; if [ 0 = 0 ]; then PKGCONFIG=pkg-config ; else PKGCONFIG=pkgconf ; fi; fi
type ${PKGCONFIG} > /dev/null 2>&1 || echo "ERROR: Cannot find valid PKGCONFIG, pkg-config or pkgconf in PATH"
echo 'Using PKGCONFIG: '${PKGCONFIG}
printf 'checking pkg-config flags for r_core... '
tmp=`${PKGCONFIG} --cflags r_core 2>/dev/null`
if [ $? != 0 ]; then echo no ; HAVE_PKGCFG_R_CORE=0;
if [ $? != 0 ]; then echo no ; HAVE_PKGCFG_R_CORE=0;
R2_CFLAGS='';R2_LDFLAGS='';
echo 'This package is required'
exit 1
else
R2_CFLAGS=$tmp;
else
R2_CFLAGS=$tmp;
tmp=`${PKGCONFIG} --libs r_core 2>/dev/null`
if [ $? = 0 ]; then
echo yes; HAVE_PKGCFG_R_CORE=1;
if [ $? = 0 ]; then
echo yes; HAVE_PKGCFG_R_CORE=1;
R2_LDFLAGS=$tmp; fi; fi
check_library() {
VAR=$1
@@ -321,7 +405,7 @@ S="$"
_REQUIRED=$3
_CHKLIB_NAME=$2
_CHKLIB_LIBS=$(echo "-l${_CHKLIB_NAME}" | sed 's,+, -l,g')
printf "checking for lib${_CHKLIB_NAME} ... "
ochof "checking for lib${_CHKLIB_NAME} ... "
echo "int main(int ac, char **av){return 0;}" > test.c
eval ${S}${COMPILER} ${CFLAGS} ${CPPFLAGS} ${CXXFLAGS} ${LDFLAGS} ${_CHKLIB_LIBS} test.c >/dev/null 2>&1
if [ $? = 0 ]; then
@@ -329,17 +413,26 @@ if [ $? = 0 ]; then
echo yes
else
eval ${VAR}=0
echo no ; fi }
echo no
if [ "${_REQUIRED}" = 1 ]; then
echo "this library is required."
do_remove
exit 1
fi
fi
}
check_library HAVE_LIB_EWF ewf 0
[ -z "${PKGCONFIG}" ] && PKGCONFIG=pkg-config
if [ -z "${PKGCONFIG}" ]; then pkg-config --version >/dev/null 2>&1 ; if [ 0 = 0 ]; then PKGCONFIG=pkg-config ; else PKGCONFIG=pkgconf ; fi; fi
printf 'checking pkg-config flags for libewf... '
tmp=`${PKGCONFIG} --cflags libewf 2>/dev/null`
if [ $? != 0 ]; then echo no ; HAVE_PKGCFG_LIBEWF=0;
else
EWF_CFLAGS=$tmp;
if [ $? != 0 ]; then echo no ; HAVE_PKGCFG_LIBEWF=0;
EWF_CFLAGS='';EWF_LDFLAGS='';
else
EWF_CFLAGS=$tmp;
tmp=`${PKGCONFIG} --libs libewf 2>/dev/null`
if [ $? = 0 ]; then
echo yes; HAVE_PKGCFG_LIBEWF=1;
if [ $? = 0 ]; then
echo yes; HAVE_PKGCFG_LIBEWF=1;
EWF_LDFLAGS=$tmp; fi; fi
if [ "$HAVE_PKGCFG_LIBEWF" = "1" ]; then
HAVE_LIB_EWF="1"
@@ -347,26 +440,28 @@ else
HAVE_LIB_EWF="0"; fi
if [ "$WANT_EWF" = "0" ]; then
HAVE_LIB_EWF="0"; fi
[ -z "${PKGCONFIG}" ] && PKGCONFIG=pkg-config
if [ -z "${PKGCONFIG}" ]; then pkg-config --version >/dev/null 2>&1 ; if [ 0 = 0 ]; then PKGCONFIG=pkg-config ; else PKGCONFIG=pkgconf ; fi; fi
printf 'checking pkg-config flags for unicorn... '
tmp=`${PKGCONFIG} --cflags unicorn 2>/dev/null`
if [ $? != 0 ]; then echo no ; HAVE_PKGCFG_UNICORN=0;
else
UC_CFLAGS=$tmp;
if [ $? != 0 ]; then echo no ; HAVE_PKGCFG_UNICORN=0;
UC_CFLAGS='';UC_LDFLAGS='';
else
UC_CFLAGS=$tmp;
tmp=`${PKGCONFIG} --libs unicorn 2>/dev/null`
if [ $? = 0 ]; then
echo yes; HAVE_PKGCFG_UNICORN=1;
if [ $? = 0 ]; then
echo yes; HAVE_PKGCFG_UNICORN=1;
UC_LDFLAGS=$tmp; fi; fi
check_library HAVE_LIB_YARA yara 0
[ -z "${PKGCONFIG}" ] && PKGCONFIG=pkg-config
if [ -z "${PKGCONFIG}" ]; then pkg-config --version >/dev/null 2>&1 ; if [ 0 = 0 ]; then PKGCONFIG=pkg-config ; else PKGCONFIG=pkgconf ; fi; fi
printf 'checking pkg-config flags for yara... '
tmp=`${PKGCONFIG} --cflags yara 2>/dev/null`
if [ $? != 0 ]; then echo no ; HAVE_PKGCFG_YARA=0;
else
YARA_CFLAGS=$tmp;
if [ $? != 0 ]; then echo no ; HAVE_PKGCFG_YARA=0;
YARA_CFLAGS='';YARA_LDFLAGS='';
else
YARA_CFLAGS=$tmp;
tmp=`${PKGCONFIG} --libs yara 2>/dev/null`
if [ $? = 0 ]; then
echo yes; HAVE_PKGCFG_YARA=1;
if [ $? = 0 ]; then
echo yes; HAVE_PKGCFG_YARA=1;
YARA_LDFLAGS=$tmp; fi; fi
SEDFLAGS=" -e '"
COUNT=0
@@ -374,7 +469,14 @@ for A in ${ENVWORDS} ; do
[ "${A}" = VPATH ] && continue
[ "${A}" = srcdir ] && continue
eval "VAR=\$${A}"
VAR="`echo ${VAR} | sed -e 's/\,/\\\,/g'`"
case "" in
mingw*|cygwin*|msys*)
VAR="`echo ${VAR} | sed -e 's/\\/\\\\/g' -e 's/\,/\\\,/g'`"
;;
*)
VAR="`echo ${VAR} | sed -e 's/\,/\\\,/g'`"
;;
esac
[ $COUNT = 10 ] && COUNT=0 && SEDFLAGS="${SEDFLAGS}' -e '"
COUNT=$(($COUNT+1))
SEDFLAGS="${SEDFLAGS}s,@${A}@,${VAR},g;"
@@ -392,8 +494,8 @@ if [ -f "${VPATH}/${A}.acr" ]; then
exit 1
fi
fi
echo "creating ${SD_TARGET}"
mkdir -p $(echo ${A} | sed -e "s,/`basename ${A}`$,,g")
ocho "creating ${SD_TARGET}"
[ "${VPATH}" != '.' ] && mkdir -p $(echo ${A} | sed -e "s,/`basename ${A}`$,,g")
cat ${VPATH}/${SD_TARGET}.acr | \
eval sed -e "s,@VPATH@,${VPATH}/${A},g" ${SEDFLAGS} > ${SD_TARGET}.tmp
@@ -403,7 +505,7 @@ if [ "$VALUE" = 0 ]; then ## FALSE
MARK="##${A}##"
if [ -n "`grep \"${MARK}\" ${SD_TARGET}.tmp`" ]; then
mv ${SD_TARGET}.tmp ${SD_TARGET}.tmp2
cat ${SD_TARGET}.tmp2 | MARK=$MARK awk 'BEGIN{a=0;}{if($1==ENVIRON["MARK"]){if(a)a=0;else a=1}else{if(!a)print;}}' > ${SD_TARGET}.tmp
cat ${SD_TARGET}.tmp2 | MARK=$MARK $AWK 'BEGIN{a=0;}{if($1==ENVIRON["MARK"]){if(a)a=0;else a=1}else{if(!a)print;}}' > ${SD_TARGET}.tmp
fi
fi
done
@@ -412,10 +514,12 @@ done
done
do_remove
if [ "$QUIET" = 0 ]; then
echo
echo "Final report:"
for A in PREFIX ; do # REPORT
for A in PREFIX ; do
eval VAL="\$${A}"
[ -z "${VAL}" ] && VAL="(null)"
[ -z "${VAL}" ] && VAL="\"\""
echo " - ${A} = ${VAL}"
done
fi
+3 -1
View File
@@ -1,7 +1,9 @@
PKGNAME radare2-extras
VERSION 2.1.0
VERSION 6.0.0
CONTACT pancake ; [email protected]
USE_PKGCONFIG!
REPORT PREFIX ;
LANG_C!
+47
View File
@@ -0,0 +1,47 @@
#!/usr/bin/env node
const fs = require('fs');
if (process.argv.length > 2) {
walkTheLines(process.argv[2]);
} else {
console.error('Usage: r2crash.js [crashlog]');
process.exit(1);
}
function walkTheLines(file) {
const lines = fs.readFileSync(file).toString().split('\n');
lines.forEach(walkLine);
}
// global state is bad
var threadId = 0;
var mode = '';
function walkLine(line) {
switch (mode) {
case 'thread-state':
mode = parseThreadState(line);
break;
default:
if (line.startsWith('Crashed Thread')) {
const threadId = +line.substring(20).trim().split(/ /)[0];
console.error("# tid", threadId);
}
break;
}
if (line.startsWith('Thread ') && line.indexOf('Thread State') !== -1) {
mode = 'thread-state';
}
}
function parseThreadState(line) {
if (line.trim() === '') {
return '';
}
const regpairs = line.replace(/: /g,':').replace(/\ \ */g,' ').trim().split(/ /);
for (let rp of regpairs) {
const rv = rp.split(':');
console.log('ar', rv[0], '=', rv[1]);
}
return 'thread-state';
}
+613
View File
@@ -0,0 +1,613 @@
Process: Twitter [46000]
Path: /Applications/Twitter.app/Contents/MacOS/Twitter
Identifier: com.twitter.twitter-mac
Version: 4.3.2 (5002734)
App Item ID: 409789998
App External ID: 821012958
Code Type: X86-64 (Native)
Parent Process: ??? [1]
Responsible: Twitter [46000]
User ID: 501
Date/Time: 2018-01-28 19:26:40.932 +0100
OS Version: Mac OS X 10.13.2 (17C88)
Report Version: 12
Anonymous UUID: 824E4619-C89D-460F-CA58-EEDCCDFC4890
Sleep/Wake UUID: 312CC193-CFF9-445F-BFE8-FB4128F12753
Time Awake Since Boot: 230000 seconds
Time Since Wake: 2100 seconds
System Integrity Protection: disabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_INSTRUCTION (SIGILL)
Exception Codes: 0x0000000000000001, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Termination Signal: Illegal instruction: 4
Termination Reason: Namespace SIGNAL, Code 0x4
Terminating Process: exc handler [0]
Application Specific Information:
Crashing on exception: NSConcreteMutableAttributedString initWithString:: nil value
Application Specific Backtrace 1:
0 CoreFoundation 0x00007fff2dbd100b __exceptionPreprocess + 171
1 libobjc.A.dylib 0x00007fff547afc76 objc_exception_throw + 48
2 CoreFoundation 0x00007fff2dc62c9d +[NSException raise:format:] + 205
3 Foundation 0x00007fff2fc4d9c8 -[NSConcreteMutableAttributedString initWithString:] + 129
4 Twitter 0x000000010f70d3d6 Twitter + 431062
5 Twitter 0x000000010f70c564 Twitter + 427364
6 AppKit 0x00007fff2b9d87c8 _NSViewLayout + 587
7 AppKit 0x00007fff2b1d3323 -[NSView _layoutSubtreeWithOldSize:] + 437
8 AppKit 0x00007fff2b1d359c -[NSView _layoutSubtreeWithOldSize:] + 1070
9 AppKit 0x00007fff2b1d359c -[NSView _layoutSubtreeWithOldSize:] + 1070
10 AppKit 0x00007fff2b1d359c -[NSView _layoutSubtreeWithOldSize:] + 1070
11 AppKit 0x00007fff2b1d359c -[NSView _layoutSubtreeWithOldSize:] + 1070
12 AppKit 0x00007fff2b1d359c -[NSView _layoutSubtreeWithOldSize:] + 1070
13 AppKit 0x00007fff2b1d359c -[NSView _layoutSubtreeWithOldSize:] + 1070
14 AppKit 0x00007fff2b1d359c -[NSView _layoutSubtreeWithOldSize:] + 1070
15 AppKit 0x00007fff2b1d359c -[NSView _layoutSubtreeWithOldSize:] + 1070
16 AppKit 0x00007fff2b9df524 -[NSView _layoutSubtreeIfNeededAndAllowTemporaryEngine:] + 1380
17 AppKit 0x00007fff2b26e480 -[NSView _sendViewWillDrawInRect:clipRootView:] + 47
18 AppKit 0x00007fff2b26d301 -[NSView displayIfNeeded] + 1142
19 AppKit 0x00007fff2b3cfbb1 -[NSProgressIndicator startAnimation:] + 246
20 AppKit 0x00007fff2b3cfce1 -[NSProgressIndicator viewDidUnhide] + 169
21 AppKit 0x00007fff2b1ebc59 -[NSView _recursiveLostHiddenAncestor] + 127
i2 AppKit 0x00007fff2b1ebd0e -[NSView _recursiveLostHiddenAncestor] + 308
23 AppKit 0x00007fff2b1ebd0e -[NSView _recursiveLostHiddenAncestor] + 308
24 AppKit 0x00007fff2b164aa1 -[NSView(NSInternal) _setHidden:setNeedsDisplay:] + 326
25 AppKit 0x00007fff2b2c9b6c -[NSView prepareForReuse] + 55
26 AppKit 0x00007fff2b30ac0c -[NSTableRowView prepareForReuse] + 70
27 Foundation 0x00007fff2fc5f33a -[NSISEngine withBehaviors:performModifications:] + 131
28 AppKit 0x00007fff2b10e5a1 -[NSView(NSConstraintBasedLayout) _withAutomaticEngineOptimizationDisabled:] + 70
29 AppKit 0x00007fff2b300236 -[NSTableRowData _prepareViewForReuse:] + 81
30 AppKit 0x00007fff2b231fd1 -[NSTableRowData makeViewWithIdentifier:owner:] + 312
31 AppKit 0x00007fff2b231e70 -[NSTableView makeViewWithIdentifier:owner:] + 58
32 Twitter 0x000000010f891959 Twitter + 2021721
33 Twitter 0x000000010f835012 Twitter + 1642514
34 AppKit 0x00007fff2b2ba8da -[NSTableView(NSTableViewViewBased) _delegateRowViewForRow:] + 64
35 AppKit 0x00007fff2b2313e9 -[NSTableView(NSTableViewViewBased) makeRowViewForRow:] + 121
36 AppKit 0x00007fff2bb1e59e -[NSTableRowData _preparedRowViewForRow:storageHandler:] + 118
37 AppKit 0x00007fff2b2312e5 -[NSTableRowData _addRowViewForVisibleRow:withPriorView:] + 392
38 AppKit 0x00007fff2b2310a8 -[NSTableRowData _addRowViewForVisibleRow:withPriorRowIndex:inDictionary:withRowAnimation:] + 416
39 AppKit 0x00007fff2bb20741 -[NSTableRowData _updateVisibleRowEntries] + 1720
40 AppKit 0x00007fff2b22fda6 -[NSTableRowData updateVisibleRowViews] + 294
41 AppKit 0x00007fff2b3d924e -[NSTableRowData prepareContentInRect:] + 106
42 AppKit 0x00007fff2b3d8d46 -[NSTableView prepareContentInRect:] + 303
43 AppKit 0x00007fff2b9d9519 -[NSView _updateSuggestedContentRectToValue:] + 616
44 AppKit 0x00007fff2b32268c -[NSView _updateSuggestedContentRect] + 100
45 AppKit 0x00007fff2b36c40e -[NSView _updateSuggestedContentRectForVisibleRectChange] + 219
46 AppKit 0x00007fff2b24478b -[NSScrollView(NSRulerSupport) _handleBoundsChangeForSubview:] + 364
47 AppKit 0x00007fff2b206ca7 -[NSView _postBoundsChangeNotification] + 60
48 AppKit 0x00007fff2b206c00 -[NSView translateOriginToPoint:] + 261
49 AppKit 0x00007fff2b20679b -[NSClipView _immediateScrollToPoint:] + 536
50 AppKit 0x00007fff2b2064bf -[NSClipView scrollToPoint:] + 232
51 AppKit 0x00007fff2b241f8f -[NSScrollView scrollClipView:toPoint:] + 75
52 AppKit 0x00007fff2b1ecd49 -[NSClipView _scrollTo:animateScroll:flashScrollerKnobs:] + 1273
53 AppKit 0x00007fff2b40d149 -[NSScrollView _doScroller:hitPart:multiplier:] + 1323
54 AppKit 0x00007fff2b8c575a -[NSApplication(NSResponder) sendAction:to:from:] + 312
55 AppKit 0x00007fff2b36b933 -[NSControl sendAction:to:] + 86
56 AppKit 0x00007fff2b40cb80 -[NSScroller sendAction:to:] + 91
57 AppKit 0x00007fff2b40c995 -[NSScroller(NSScrollerPrivate) _scrollByDelta:] + 842
58 AppKit 0x00007fff2b40bd4b -[NSScrollingBehaviorLegacy _scrollView:smoothScrollWithEvent:] + 2746
59 AppKit 0x00007fff2b40ae16 -[NSScrollingBehaviorLegacy scrollView:scrollWheelWithEvent:] + 1177
60 Twitter 0x000000010f7c7e59 Twitter + 1195609
61 AppKit 0x00007fff2b40eee5 __71-[NSScrollingBehaviorLegacy _latchAcceleratedScrollEventsToScrollView:]_block_invoke + 282
62 AppKit 0x00007fff2b298366 _NSSendEventToObservers + 337
63 AppKit 0x00007fff2b8c152a -[NSApplication(NSEvent) sendEvent:] + 70
64 AppKit 0x00007fff2b122d9d -[NSApplication run] + 812
65 AppKit 0x00007fff2b0f1f1a NSApplicationMain + 804
66 libdyld.dylib 0x00007fff5539f115 start + 1
67 ??? 0x0000000000000001 0x0 + 1
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 com.apple.AppKit 0x00007fff2b458794 -[NSApplication _crashOnException:] + 109
1 com.apple.AppKit 0x00007fff2b45867c -[NSApplication reportException:] + 953
2 com.twitter.twitter-mac 0x000000010f9205fd 0x10f6a4000 + 2606589
3 com.apple.AppKit 0x00007fff2b122e2e -[NSApplication run] + 957
4 com.apple.AppKit 0x00007fff2b0f1f1a NSApplicationMain + 804
5 libdyld.dylib 0x00007fff5539f115 start + 1
Thread 1:: com.twitter.crashlytics.mac.MachExceptionServer
0 libsystem_kernel.dylib 0x00007fff554f09d2 write + 10
1 com.twitter.twitter-mac 0x000000010f91f68a 0x10f6a4000 + 2602634
2 com.twitter.twitter-mac 0x000000010f90ea54 0x10f6a4000 + 2533972
3 libsystem_pthread.dylib 0x00007fff5562a6c1 _pthread_body + 340
4 libsystem_pthread.dylib 0x00007fff5562a56d _pthread_start + 377
5 libsystem_pthread.dylib 0x00007fff55629c5d thread_start + 13
Thread 2:: com.apple.NSEventThread
0 libsystem_kernel.dylib 0x00007fff554e57c2 mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff554e4cdc mach_msg + 60
2 com.apple.CoreFoundation 0x00007fff2db4c355 __CFRunLoopServiceMachPort + 341
3 com.apple.CoreFoundation 0x00007fff2db4b6a7 __CFRunLoopRun + 1783
4 com.apple.CoreFoundation 0x00007fff2db4ad23 CFRunLoopRunSpecific + 483
5 com.apple.AppKit 0x00007fff2b26b3c8 _NSEventThread + 184
6 libsystem_pthread.dylib 0x00007fff5562a6c1 _pthread_body + 340
7 libsystem_pthread.dylib 0x00007fff5562a56d _pthread_start + 377
8 libsystem_pthread.dylib 0x00007fff55629c5d thread_start + 13
Thread 3:: com.apple.NSURLConnectionLoader
0 libsystem_kernel.dylib 0x00007fff554e57c2 mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff554e4cdc mach_msg + 60
2 com.apple.CoreFoundation 0x00007fff2db4c355 __CFRunLoopServiceMachPort + 341
3 com.apple.CoreFoundation 0x00007fff2db4b6a7 __CFRunLoopRun + 1783
4 com.apple.CoreFoundation 0x00007fff2db4ad23 CFRunLoopRunSpecific + 483
5 com.apple.CFNetwork 0x00007fff2ccc3f84 -[__CoreSchedulingSetRunnable runForever] + 722
6 com.apple.Foundation 0x00007fff2fc38e48 __NSThread__start__ + 1197
7 libsystem_pthread.dylib 0x00007fff5562a6c1 _pthread_body + 340
8 libsystem_pthread.dylib 0x00007fff5562a56d _pthread_start + 377
9 libsystem_pthread.dylib 0x00007fff55629c5d thread_start + 13
Thread 4:: com.apple.coreaudio.AQClient
0 libsystem_kernel.dylib 0x00007fff554e57c2 mach_msg_trap + 10
1 libsystem_kernel.dylib 0x00007fff554e4cdc mach_msg + 60
2 com.apple.CoreFoundation 0x00007fff2db4c355 __CFRunLoopServiceMachPort + 341
3 com.apple.CoreFoundation 0x00007fff2db4b6a7 __CFRunLoopRun + 1783
4 com.apple.CoreFoundation 0x00007fff2db4ad23 CFRunLoopRunSpecific + 483
5 com.apple.audio.toolbox.AudioToolbox 0x00007fff2c4f61aa GenericRunLoopThread::Entry(void*) + 158
6 com.apple.audio.toolbox.AudioToolbox 0x00007fff2c4f5eb9 CAPThread::Entry(CAPThread*) + 77
7 libsystem_pthread.dylib 0x00007fff5562a6c1 _pthread_body + 340
8 libsystem_pthread.dylib 0x00007fff5562a56d _pthread_start + 377
9 libsystem_pthread.dylib 0x00007fff55629c5d thread_start + 13
Thread 5:
0 libsystem_kernel.dylib 0x00007fff554ef562 __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff5562a06a _pthread_wqthread + 1035
2 libsystem_pthread.dylib 0x00007fff55629c4d start_wqthread + 13
Thread 6:
0 libsystem_kernel.dylib 0x00007fff554ef562 __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff5562a26f _pthread_wqthread + 1552
2 libsystem_pthread.dylib 0x00007fff55629c4d start_wqthread + 13
Thread 7:
0 libsystem_kernel.dylib 0x00007fff554ef562 __workq_kernreturn + 10
1 libsystem_pthread.dylib 0x00007fff5562a06a _pthread_wqthread + 1035
2 libsystem_pthread.dylib 0x00007fff55629c4d start_wqthread + 13
Thread 8:: Dispatch queue: com.apple.CFNetwork.Connection
0 libsystem_blocks.dylib 0x00007fff553ed991 _Block_release + 99
1 libdispatch.dylib 0x00007fff55365d50 _dispatch_client_callout + 8
2 libdispatch.dylib 0x00007fff5537a20c _dispatch_queue_serial_drain + 635
3 libdispatch.dylib 0x00007fff5536d0fd _dispatch_queue_invoke + 373
4 libdispatch.dylib 0x00007fff5537a06f _dispatch_queue_serial_drain + 222
5 libdispatch.dylib 0x00007fff5536d0fd _dispatch_queue_invoke + 373
6 libdispatch.dylib 0x00007fff5537af02 _dispatch_root_queue_drain_deferred_wlh + 332
7 libdispatch.dylib 0x00007fff5537ed16 _dispatch_workloop_worker_thread + 880
8 libsystem_pthread.dylib 0x00007fff5562a033 _pthread_wqthread + 980
9 libsystem_pthread.dylib 0x00007fff55629c4d start_wqthread + 13
Thread 9:
0 libsystem_pthread.dylib 0x00007fff55629c40 start_wqthread + 0
1 ??? 0xa8fafa6ba58200f2 0 + 12176319882794762482
Thread 0 crashed with X86 Thread State (64-bit):
rax: 0x00007fe8a52f2200 rbx: 0x0000600002e42c40 rcx: 0x0000000000000000 rdx: 0x0000000000001bbb
rdi: 0x0000000008000101 rsi: 0x00007fe8a54dd5a1 rbp: 0x00007ffee055b910 rsp: 0x00007ffee055b900
r8: 0x0000000000000000 r9: 0x0000000000000000 r10: 0x00007ffee055b408 r11: 0xffffffffffe167ff
r12: 0x00007ffee055b910 r13: 0x0000600000126180 r14: 0x00007fff547a1e80 r15: 0x00007ffee055b920
rip: 0x00007fff2b458794 rfl: 0x0000000000010206 cr2: 0x000070000ac9a628
Logical CPU: 2
Error Code: 0x00000000
Trap Number: 6
Binary Images:
0x10f6a4000 - 0x10fac2ff7 +com.twitter.twitter-mac (4.3.2 - 5002734) <3BC0BF69-D205-3845-9A00-492B8F015F12> /Applications/Twitter.app/Contents/MacOS/Twitter
0x10fbec000 - 0x10fc48ff7 +com.growl.growlframework (2.0.1 - 2.0.1) <6C20B93B-75B2-30A4-8267-8C81BF90872B> /Applications/Twitter.app/Contents/Frameworks/Growl.framework/Versions/A/Growl
0x113705000 - 0x113709fff com.apple.audio.AppleHDAHALPlugIn (280.12 - 280.12) <9ACA0127-E687-3885-9475-1D5E4DD83168> /System/Library/Extensions/AppleHDA.kext/Contents/PlugIns/AppleHDAHALPlugIn.bundle/Contents/MacOS/AppleHDAHALPlugIn
0x113b49000 - 0x114083ff7 com.apple.driver.AppleIntelBDWGraphicsGLDriver (10.30.12 - 10.3.0) <E227A086-C662-335C-8B36-EA875AD6478F> /System/Library/Extensions/AppleIntelBDWGraphicsGLDriver.bundle/Contents/MacOS/AppleIntelBDWGraphicsGLDriver
0x11796a000 - 0x1179b498f dyld (519.2.2) <6695F30B-4E88-3C0B-9867-7D738C44A3E6> /usr/lib/dyld
0x124585000 - 0x124af0fff com.apple.audio.codecs.Components (7.0 - 7.0) <7233F241-5DC2-38E5-9156-2D825117075B> /System/Library/Components/AudioCodecs.component/Contents/MacOS/AudioCodecs
0x124bfe000 - 0x124da4ff7 com.apple.audio.units.Components (1.14 - 1.14) <5AE65A6C-EF2F-37AC-9DDD-4ABB69E78EF2> /System/Library/Components/CoreAudio.component/Contents/MacOS/CoreAudio
0x7fff261ee000 - 0x7fff2653cff7 com.apple.RawCamera.bundle (8.02.0 - 1017.2.2) <C799730B-C745-3775-BCE7-C67B8BD97FDB> /System/Library/CoreServices/RawCamera.bundle/Contents/MacOS/RawCamera
0x7fff2781a000 - 0x7fff278a6ff7 com.apple.driver.AppleIntelBDWGraphicsMTLDriver (10.30.12 - 10.3.0) <7A1AD3EA-2D09-381F-A080-CC108AE459DB> /System/Library/Extensions/AppleIntelBDWGraphicsMTLDriver.bundle/Contents/MacOS/AppleIntelBDWGraphicsMTLDriver
0x7fff29d11000 - 0x7fff29eecff7 com.apple.avfoundation (2.0 - 1528.24) <E4CE97EA-94C7-3CC4-B768-15AA25E76A83> /System/Library/Frameworks/AVFoundation.framework/Versions/A/AVFoundation
0x7fff29eed000 - 0x7fff29fa7ff7 com.apple.audio.AVFAudio (1.0 - ???) <E7DFCDAF-97A8-314F-BBED-76B9C5041E38> /System/Library/Frameworks/AVFoundation.framework/Versions/A/Frameworks/AVFAudio.framework/Versions/A/AVFAudio
0x7fff29fa9000 - 0x7fff2a0acff3 com.apple.AVKit (1.1 - 440.5.1) <11682387-4506-3294-8355-6130128A0C68> /System/Library/Frameworks/AVKit.framework/Versions/A/AVKit
0x7fff2a0ad000 - 0x7fff2a0adfff com.apple.Accelerate (1.11 - Accelerate 1.11) <5AA750F5-D633-32BA-B7F3-4F651FB1761E> /System/Library/Frameworks/Accelerate.framework/Versions/A/Accelerate
0x7fff2a0ae000 - 0x7fff2a0c4fe3 libCGInterfaces.dylib (417) <27E09D39-51B5-3297-BE33-0DB1736B833A> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/Libraries/libCGInterfaces.dylib
0x7fff2a0c5000 - 0x7fff2a5c3fc3 com.apple.vImage (8.1 - ???) <310976EE-E12D-39D7-8F58-6EE924E08576> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vImage.framework/Versions/A/vImage
0x7fff2a5c4000 - 0x7fff2a71efcb libBLAS.dylib (1211.30.1) <0DB0D952-BCF4-3479-BA2F-785FB1A57479> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
0x7fff2a71f000 - 0x7fff2a74dfef libBNNS.dylib (37) <49EB4DBA-877C-3D41-90A2-C3D982C72A54> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBNNS.dylib
0x7fff2a74e000 - 0x7fff2ab0eff7 libLAPACK.dylib (1211.30.1) <2D4E4446-6B63-350C-BD68-A1B8FBE99539> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLAPACK.dylib
0x7fff2ab0f000 - 0x7fff2ab24ff7 libLinearAlgebra.dylib (1211.30.1) <6C68F41D-1398-3AFE-BE72-C0ECA1B24BDC> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libLinearAlgebra.dylib
0x7fff2ab25000 - 0x7fff2ab2aff3 libQuadrature.dylib (3) <3D6BF66A-55B2-3692-BAC7-DEB0C676ED29> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libQuadrature.dylib
0x7fff2ab2b000 - 0x7fff2ab89fff libSparse.dylib (79.1.1) <7AD0F8A8-FD36-36FE-B83D-58648EBD0027> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparse.dylib
0x7fff2ab8a000 - 0x7fff2ab9dfff libSparseBLAS.dylib (1211.30.1) <42506F6F-0F38-322E-9903-C1DB66E4DA05> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libSparseBLAS.dylib
0x7fff2ab9e000 - 0x7fff2ad4afc3 libvDSP.dylib (622.20.8) <6FFCA52B-7D60-326A-ADF2-601F39A8685A> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvDSP.dylib
0x7fff2ad4b000 - 0x7fff2adfbfef libvMisc.dylib (622.20.8) <54F90047-879F-3260-8604-6E453149B49E> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libvMisc.dylib
0x7fff2adfc000 - 0x7fff2adfcfff com.apple.Accelerate.vecLib (3.11 - vecLib 3.11) <8A96A8ED-7B88-3D17-8D17-41D224E0EC90> /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/vecLib
0x7fff2adfd000 - 0x7fff2ae54ff7 com.apple.Accounts (113 - 113) <02AC0AF3-D620-340E-BE52-CD31119F9CD8> /System/Library/Frameworks/Accounts.framework/Versions/A/Accounts
0x7fff2ae55000 - 0x7fff2b0ebfff com.apple.AddressBook.framework (11.0 - 1808.6) <F6D3B5FE-46C5-31E6-8D30-2DE805D883AA> /System/Library/Frameworks/AddressBook.framework/Versions/A/AddressBook
0x7fff2b0ec000 - 0x7fff2bf49fff com.apple.AppKit (6.9 - 1561.20.106) <7A71ACCF-2DF5-3557-BB22-3A9FC9F71CCF> /System/Library/Frameworks/AppKit.framework/Versions/C/AppKit
0x7fff2bf9b000 - 0x7fff2bf9bfff com.apple.ApplicationServices (48 - 50) <7627DBD6-497B-3AB7-9B63-F0532EDF09B8> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/ApplicationServices
0x7fff2bf9c000 - 0x7fff2c002fff com.apple.ApplicationServices.ATS (377 - 445) <CDF5F6D7-4E7D-3D28-9FBA-1B53AD9FA8F8> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/ATS
0x7fff2c09b000 - 0x7fff2c1bdfff libFontParser.dylib (222.1.2) <11BD5EEF-AF18-33FB-B114-DD611932E822> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontParser.dylib
0x7fff2c1be000 - 0x7fff2c208ff7 libFontRegistry.dylib (221) <A22F82C0-B4FE-3DB5-B968-79B28257DF2F> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libFontRegistry.dylib
0x7fff2c2ad000 - 0x7fff2c2e0ff7 libTrueTypeScaler.dylib (222.1.2) <33C245B4-E1AD-3C89-B735-5A5610E547C8> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ATS.framework/Versions/A/Resources/libTrueTypeScaler.dylib
0x7fff2c34a000 - 0x7fff2c34eff3 com.apple.ColorSyncLegacy (4.13.0 - 1) <42C25E85-1CF3-3DEC-A434-BE69F68F4318> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/ColorSyncLegacy.framework/Versions/A/ColorSyncLegacy
0x7fff2c3ee000 - 0x7fff2c440ff7 com.apple.HIServices (1.22 - 622) <2E83CD6F-ED98-3C29-BD0A-8525E38AB5DB> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices
0x7fff2c441000 - 0x7fff2c44ffff com.apple.LangAnalysis (1.7.0 - 1.7.0) <71A9C815-AC55-3E36-A618-F6778F5119AD> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/LangAnalysis.framework/Versions/A/LangAnalysis
0x7fff2c450000 - 0x7fff2c49cfff com.apple.print.framework.PrintCore (13 - 503) <A69E2BAD-2B66-38CC-9D3A-0A0EBC41341D> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/PrintCore
0x7fff2c49d000 - 0x7fff2c4d7fff com.apple.QD (3.12 - 403) <38D8106A-4FFA-3FE9-9999-714CADD7EE9C> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/QD.framework/Versions/A/QD
0x7fff2c4d8000 - 0x7fff2c4e4fff com.apple.speech.synthesis.framework (7.2.1 - 7.2.1) <BA7EDC49-E216-3D96-A7B7-8C76B862D484> /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/SpeechSynthesis.framework/Versions/A/SpeechSynthesis
0x7fff2c4e5000 - 0x7fff2c770ff7 com.apple.audio.toolbox.AudioToolbox (1.14 - 1.14) <71699B6E-8B94-39E2-801F-8467C2B5B621> /System/Library/Frameworks/AudioToolbox.framework/Versions/A/AudioToolbox
0x7fff2c772000 - 0x7fff2c772fff com.apple.audio.units.AudioUnit (1.14 - 1.14) <28C7FC0C-D2E5-3703-916F-866A0F823229> /System/Library/Frameworks/AudioUnit.framework/Versions/A/AudioUnit
0x7fff2ca87000 - 0x7fff2ce19fff com.apple.CFNetwork (893.13.1 - 893.13.1) <567231F4-4080-3B2D-8349-9177BD358804> /System/Library/Frameworks/CFNetwork.framework/Versions/A/CFNetwork
0x7fff2ce2e000 - 0x7fff2ce2efff com.apple.Carbon (158 - 158) <FCD7A9FF-5E53-3B0C-8A52-691C11B2A0C5> /System/Library/Frameworks/Carbon.framework/Versions/A/Carbon
0x7fff2ce2f000 - 0x7fff2ce32ffb com.apple.CommonPanels (1.2.6 - 98) <39C8EBA3-EEB2-335B-8A88-D6C64BAA112F> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/CommonPanels.framework/Versions/A/CommonPanels
0x7fff2ce33000 - 0x7fff2d138ff7 com.apple.HIToolbox (2.1.1 - 910.4) <ADBE7A1B-0402-369C-A6F3-494E8CACD619> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/HIToolbox.framework/Versions/A/HIToolbox
0x7fff2d139000 - 0x7fff2d13cffb com.apple.help (1.3.8 - 64) <18D02016-119A-33E8-AEB0-E9466BA4AD56> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Help.framework/Versions/A/Help
0x7fff2d13d000 - 0x7fff2d142fff com.apple.ImageCapture (9.0 - 9.0) <2DE590E5-DF0E-3962-A2BE-06EBC79B3D72> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/ImageCapture.framework/Versions/A/ImageCapture
0x7fff2d143000 - 0x7fff2d1d8ffb com.apple.ink.framework (10.9 - 220) <D8AECAE3-9FD2-32E3-B659-026F33650BB2> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Ink.framework/Versions/A/Ink
0x7fff2d1d9000 - 0x7fff2d1f3ff7 com.apple.openscripting (1.7 - 174) <66899B51-ADFD-360D-88E9-B52439F531B4> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/OpenScripting.framework/Versions/A/OpenScripting
0x7fff2d214000 - 0x7fff2d215fff com.apple.print.framework.Print (12 - 267) <E4CBAAFC-9045-38AC-9F93-8C931DDED9D8> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/Print.framework/Versions/A/Print
0x7fff2d216000 - 0x7fff2d218ff7 com.apple.securityhi (9.0 - 55006) <E7668200-B4CB-3612-96B8-D57E94077787> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SecurityHI.framework/Versions/A/SecurityHI
0x7fff2d219000 - 0x7fff2d21ffff com.apple.speech.recognition.framework (6.0.3 - 6.0.3) <1F10ED1F-12C7-39AC-88A0-43A1338F9316> /System/Library/Frameworks/Carbon.framework/Versions/A/Frameworks/SpeechRecognition.framework/Versions/A/SpeechRecognition
0x7fff2d32c000 - 0x7fff2d32cfff com.apple.Cocoa (6.11 - 22) <F1AED1E8-ACC2-31F0-B85E-17E41167FC88> /System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa
0x7fff2d33a000 - 0x7fff2d3f3ff7 com.apple.ColorSync (4.13.0 - 546) <A5E013D9-7305-3026-879E-4D1F038A430D> /System/Library/Frameworks/ColorSync.framework/Versions/A/ColorSync
0x7fff2d580000 - 0x7fff2d613ff7 com.apple.audio.CoreAudio (4.3.0 - 4.3.0) <4DE794D4-F018-31E8-B3CE-CF8DBE68D14E> /System/Library/Frameworks/CoreAudio.framework/Versions/A/CoreAudio
0x7fff2d67a000 - 0x7fff2d6a3ffb com.apple.CoreBluetooth (1.0 - 1) <942F88A5-AD68-3359-90D5-6F1A3311C51A> /System/Library/Frameworks/CoreBluetooth.framework/Versions/A/CoreBluetooth
0x7fff2d6a4000 - 0x7fff2d9f8fe7 com.apple.CoreData (120 - 849.2) <4407C44B-34CC-3D23-AEDF-AD866D414EBF> /System/Library/Frameworks/CoreData.framework/Versions/A/CoreData
0x7fff2d9f9000 - 0x7fff2dac5fff com.apple.CoreDisplay (1.0 - 81.7) <CE6B9237-B33D-3D8F-8C1C-4F57BD810D24> /System/Library/Frameworks/CoreDisplay.framework/Versions/A/CoreDisplay
0x7fff2dac6000 - 0x7fff2df66fff com.apple.CoreFoundation (6.9 - 1450.16) <23F8373A-FA3F-37A2-BA5B-70061BFCCD21> /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation
0x7fff2df68000 - 0x7fff2e575fef com.apple.CoreGraphics (2.0 - 1129.5) <F37BFBD2-CC21-3521-B034-9D4D36197487> /System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics
0x7fff2e577000 - 0x7fff2e866fff com.apple.CoreImage (13.0.0 - 579.2.9) <B5661FF7-7558-308E-A3B7-C280F7A1DA78> /System/Library/Frameworks/CoreImage.framework/Versions/A/CoreImage
0x7fff2e867000 - 0x7fff2e8d2ff7 com.apple.corelocation (2237.0.22) <0E78BBE7-9016-3A12-88EB-425EFE69E643> /System/Library/Frameworks/CoreLocation.framework/Versions/A/CoreLocation
0x7fff2eaf5000 - 0x7fff2ebd5ff7 com.apple.CoreMedia (1.0 - 2267.40.5) <AE634D2B-FEB5-3669-80CC-F1C238698D44> /System/Library/Frameworks/CoreMedia.framework/Versions/A/CoreMedia
0x7fff2ebd6000 - 0x7fff2ec24fff com.apple.CoreMediaIO (812.0 - 4993) <1D78D2AE-626B-3D0C-83EA-EA385682F3F3> /System/Library/Frameworks/CoreMediaIO.framework/Versions/A/CoreMediaIO
0x7fff2ec25000 - 0x7fff2ec25fff com.apple.CoreServices (822.19 - 822.19) <0C60B639-4CC4-3F57-BC5E-DB71EB75F7F4> /System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices
0x7fff2ec26000 - 0x7fff2ec9affb com.apple.AE (735.1 - 735.1) <D0C73200-90A7-3FD1-A6EC-97055AA367E2> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/AE.framework/Versions/A/AE
0x7fff2ec9b000 - 0x7fff2ef72ff7 com.apple.CoreServices.CarbonCore (1178.2 - 1178.2) <A1FE74F8-953B-371E-A8AC-E87B30FB79C6> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/CarbonCore
0x7fff2ef73000 - 0x7fff2efa7ff7 com.apple.DictionaryServices (1.2 - 284) <3FCEE280-8DD0-37C9-BFD4-7BA87AAFC8EF> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/DictionaryServices.framework/Versions/A/DictionaryServices
0x7fff2efa8000 - 0x7fff2efb0ff3 com.apple.CoreServices.FSEvents (1239 - 1239) <7BBC5CB7-DBC8-316B-99B0-781827159A2F> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/FSEvents.framework/Versions/A/FSEvents
0x7fff2efb1000 - 0x7fff2f169ff7 com.apple.LaunchServices (822.19 - 822.19) <F3AC96C3-0B52-3AA9-9DA8-288BBC523C07> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/LaunchServices.framework/Versions/A/LaunchServices
0x7fff2f16a000 - 0x7fff2f219ff7 com.apple.Metadata (10.7.0 - 1191.2.6) <FB66B298-D55D-398A-BEDB-CB7B82956AE5> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/Metadata.framework/Versions/A/Metadata
0x7fff2f21a000 - 0x7fff2f277ff7 com.apple.CoreServices.OSServices (822.19 - 822.19) <408FB1A4-58E9-34D4-8022-A9EEC8502762> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/OSServices.framework/Versions/A/OSServices
0x7fff2f278000 - 0x7fff2f2e6fff com.apple.SearchKit (1.4.0 - 1.4.0) <14053F88-2C76-35CA-9FC1-2A9BC0B63F88> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SearchKit.framework/Versions/A/SearchKit
0x7fff2f2e7000 - 0x7fff2f30bffb com.apple.coreservices.SharedFileList (71.4 - 71.4) <4AA6DCF5-BAF8-36FA-A8B0-EDF518EFEF14> /System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/SharedFileList.framework/Versions/A/SharedFileList
0x7fff2f5b5000 - 0x7fff2f703ffb com.apple.CoreText (352.0 - 578.12) <DA0BC559-277A-32BA-91EA-FD2F02EA186F> /System/Library/Frameworks/CoreText.framework/Versions/A/CoreText
0x7fff2f704000 - 0x7fff2f73eff3 com.apple.CoreVideo (1.8 - 279.2) <A8FC5325-D092-3A28-A1CF-5C94B8101F71> /System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo
0x7fff2f73f000 - 0x7fff2f7c9ffb com.apple.framework.CoreWLAN (13.0 - 1339) <FFA24EBB-75A1-3B33-9B26-96BDAF758CC0> /System/Library/Frameworks/CoreWLAN.framework/Versions/A/CoreWLAN
0x7fff2f957000 - 0x7fff2f962ff7 com.apple.DirectoryService.Framework (10.13 - 207) <79F272D7-48AE-3D1E-AC5B-3CEB5F16E7D5> /System/Library/Frameworks/DirectoryService.framework/Versions/A/DirectoryService
0x7fff2f963000 - 0x7fff2fa1dfff com.apple.DiscRecording (9.0.3 - 9030.4.5) <2094BAC4-4F37-3741-B9BD-60158A63C503> /System/Library/Frameworks/DiscRecording.framework/Versions/A/DiscRecording
0x7fff2fa44000 - 0x7fff2fa49fff com.apple.DiskArbitration (2.7 - 2.7) <44836CE9-A9ED-3017-972A-7A0A3D6B472B> /System/Library/Frameworks/DiskArbitration.framework/Versions/A/DiskArbitration
0x7fff2fc0a000 - 0x7fff2ffcffff com.apple.Foundation (6.9 - 1450.16) <7FEC6610-70EA-3A8D-8EC4-7E99BAF1E312> /System/Library/Frameworks/Foundation.framework/Versions/C/Foundation
0x7fff3003f000 - 0x7fff3006ffff com.apple.GSS (4.0 - 2.0) <3B4B4509-B5A3-396B-9C71-80BAE84476FA> /System/Library/Frameworks/GSS.framework/Versions/A/GSS
0x7fff30181000 - 0x7fff30284ff3 com.apple.Bluetooth (6.0.2 - 6.0.2f2) <AFC4A40B-AE56-3C53-A2B1-D0D9C335E21D> /System/Library/Frameworks/IOBluetooth.framework/Versions/A/IOBluetooth
0x7fff302e4000 - 0x7fff3037ffff com.apple.framework.IOKit (2.0.2 - 1445.31.1) <7556086A-EFAF-3262-9822-6F666CFC6655> /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit
0x7fff30381000 - 0x7fff30388ffb com.apple.IOSurface (209.2.2 - 209.2.2) <6D35A601-1C47-37BE-AD31-F8EB88F67573> /System/Library/Frameworks/IOSurface.framework/Versions/A/IOSurface
0x7fff30389000 - 0x7fff303deff3 com.apple.ImageCaptureCore (7.0 - 7.0) <CBE349D4-2C8B-31F5-B5ED-B8E978DA9245> /System/Library/Frameworks/ImageCaptureCore.framework/Versions/A/ImageCaptureCore
0x7fff303df000 - 0x7fff30556ff7 com.apple.ImageIO.framework (3.3.0 - 1713) <DB207AD2-06B5-3065-976B-F53C477D79C0> /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
0x7fff30557000 - 0x7fff3055bffb libGIF.dylib (1713) <C65B2846-1B94-3BB3-BBBF-5A9E5054CE1E> /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libGIF.dylib
0x7fff3055c000 - 0x7fff30643fff libJP2.dylib (1713) <8323253E-278A-3486-801A-83E143C19712> /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJP2.dylib
0x7fff30644000 - 0x7fff30667ff7 libJPEG.dylib (1713) <2D846A18-D8AF-3573-803B-BEABCBAC38D1> /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libJPEG.dylib
0x7fff30943000 - 0x7fff30969feb libPng.dylib (1713) <546F41CE-185C-31A0-B61C-1012AA932624> /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libPng.dylib
0x7fff3096a000 - 0x7fff3096cffb libRadiance.dylib (1713) <31787C46-4A2B-3CDF-95E9-EC1BD4794917> /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libRadiance.dylib
0x7fff3096d000 - 0x7fff309bafeb libTIFF.dylib (1713) <5319B2E1-83D2-30C7-A7BC-A0CE0B07885D> /System/Library/Frameworks/ImageIO.framework/Versions/A/Resources/libTIFF.dylib
0x7fff30b76000 - 0x7fff316dcff7 com.apple.JavaScriptCore (13604 - 13604.4.7.1.3) <3ACE94F3-B9B6-38FD-9CE7-7B44F374C143> /System/Library/Frameworks/JavaScriptCore.framework/Versions/A/JavaScriptCore
0x7fff316f4000 - 0x7fff3170dff7 com.apple.Kerberos (3.0 - 1) <CAF075C0-4C24-3ACE-9AE6-77BEFDEA3622> /System/Library/Frameworks/Kerberos.framework/Versions/A/Kerberos
0x7fff3170e000 - 0x7fff31743fff com.apple.LDAPFramework (2.4.28 - 194.5) <8419BDB5-12DF-3BC9-871D-7A270E080249> /System/Library/Frameworks/LDAP.framework/Versions/A/LDAP
0x7fff319c5000 - 0x7fff319ccfff com.apple.MediaAccessibility (1.0 - 114) <D72C593A-AC32-3419-AB86-6B07217EBFD5> /System/Library/Frameworks/MediaAccessibility.framework/Versions/A/MediaAccessibility
0x7fff319e2000 - 0x7fff31a6effb com.apple.MediaPlayer (1.0 - 1.0) <76758A48-DB40-3331-8517-07D9A445836D> /System/Library/Frameworks/MediaPlayer.framework/Versions/A/MediaPlayer
0x7fff31a6f000 - 0x7fff32088ff7 com.apple.MediaToolbox (1.0 - 2267.40.5) <BC84C8E1-FC56-3996-9110-E1BEF85587F7> /System/Library/Frameworks/MediaToolbox.framework/Versions/A/MediaToolbox
0x7fff3208a000 - 0x7fff32109fff com.apple.Metal (124.7 - 124.7) <C266564D-21B5-3FD9-92D5-03974F3186C4> /System/Library/Frameworks/Metal.framework/Versions/A/Metal
0x7fff32126000 - 0x7fff3213bfff com.apple.MetalPerformanceShaders.MPSCore (1.0 - 1) <D4BCBA84-AD1B-33DC-99F3-16F9E5E50906> /System/Library/Frameworks/MetalPerformanceShaders.framework/Frameworks/MPSCore.framework/Versions/A/MPSCore
0x7fff3213c000 - 0x7fff321a7fef com.apple.MetalPerformanceShaders.MPSImage (1.0 - 1) <E504EC97-FAD7-36DC-B151-6F89AB911E3A> /System/Library/Frameworks/MetalPerformanceShaders.framework/Frameworks/MPSImage.framework/Versions/A/MPSImage
0x7fff321a8000 - 0x7fff321cbfff com.apple.MetalPerformanceShaders.MPSMatrix (1.0 - 1) <A5B6F6FC-A19A-32C0-A999-98B6688760C7> /System/Library/Frameworks/MetalPerformanceShaders.framework/Frameworks/MPSMatrix.framework/Versions/A/MPSMatrix
0x7fff321cc000 - 0x7fff3224cff7 com.apple.MetalPerformanceShaders.MPSNeuralNetwork (1.0 - 1) <D0D8F13F-ACD4-3B61-BE54-121CCB05ECF4> /System/Library/Frameworks/MetalPerformanceShaders.framework/Frameworks/MPSNeuralNetwork.framework/Versions/A/MPSNeuralNetwork
0x7fff3224d000 - 0x7fff3224dff7 com.apple.MetalPerformanceShaders.MetalPerformanceShaders (1.0 - 1) <2E8723FC-AA53-3596-B6A4-220A378B7A5A> /System/Library/Frameworks/MetalPerformanceShaders.framework/Versions/A/MetalPerformanceShaders
0x7fff33256000 - 0x7fff33262ffb com.apple.NetFS (6.0 - 4.0) <81B22AE7-7094-30F2-BF41-84CA05EDB95B> /System/Library/Frameworks/NetFS.framework/Versions/A/NetFS
0x7fff333e2000 - 0x7fff33418ffb com.apple.notificationcenter (1.0 - 639.10) <EA67E1F8-9506-3336-8F84-FD3512F321B7> /System/Library/Frameworks/NotificationCenter.framework/Versions/A/NotificationCenter
0x7fff3604a000 - 0x7fff36052fef libcldcpuengine.dylib (2.8.7) <DD781325-D94E-3AD7-8D6C-817FB3068917> /System/Library/Frameworks/OpenCL.framework/Versions/A/Libraries/libcldcpuengine.dylib
0x7fff36053000 - 0x7fff360a0ffb com.apple.opencl (2.8.12 - 2.8.12) <0AACB21D-AAC4-337C-8FF6-A8F6196614EE> /System/Library/Frameworks/OpenCL.framework/Versions/A/OpenCL
0x7fff360a1000 - 0x7fff360bdffb com.apple.CFOpenDirectory (10.13 - 207) <7664F745-96E0-3F9F-964B-6014928902FB> /System/Library/Frameworks/OpenDirectory.framework/Versions/A/Frameworks/CFOpenDirectory.framework/Versions/A/CFOpenDirectory
0x7fff360be000 - 0x7fff360c9fff com.apple.OpenDirectory (10.13 - 207) <1550BB27-D605-398C-8670-48700C86D674> /System/Library/Frameworks/OpenDirectory.framework/Versions/A/OpenDirectory
0x7fff37248000 - 0x7fff3724afff libCVMSPluginSupport.dylib (16.4.2) <A967BC8B-ABB3-393F-BF34-BD32B45831F7> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCVMSPluginSupport.dylib
0x7fff3724b000 - 0x7fff3724fff7 libCoreFSCache.dylib (162.4) <B325B709-0C81-357A-B9F1-6E0027B64F9B> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreFSCache.dylib
0x7fff37250000 - 0x7fff37254fff libCoreVMClient.dylib (162.4) <B129DB84-39BA-34E4-9FB7-20A020A1BB86> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libCoreVMClient.dylib
0x7fff37255000 - 0x7fff3725dfff libGFXShared.dylib (16.4.2) <07F1D947-F79B-3608-9080-E4DBFE13AF1D> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGFXShared.dylib
0x7fff3725e000 - 0x7fff37269fff libGL.dylib (16.4.2) <97D6871A-BAF1-33DD-9ED7-BE7BB437F378> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGL.dylib
0x7fff3726a000 - 0x7fff372a5fe7 libGLImage.dylib (16.4.2) <3E2802DF-4998-31DB-B3A2-65720DE919A5> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLImage.dylib
0x7fff372a6000 - 0x7fff37412fff libGLProgrammability.dylib (16.4.2) <3505EF20-FA3D-321B-8C11-D9CA74656F30> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLProgrammability.dylib
0x7fff37413000 - 0x7fff37451ffb libGLU.dylib (16.4.2) <ECABCFAB-E400-3667-8EE1-586C07E0E214> /System/Library/Frameworks/OpenGL.framework/Versions/A/Libraries/libGLU.dylib
0x7fff37dc9000 - 0x7fff37dd7ffb com.apple.opengl (16.4.2 - 16.4.2) <C8C31EF5-8DB4-336F-A87C-5D520C7EFDC5> /System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL
0x7fff37dd8000 - 0x7fff37f6fffb GLEngine (16.4.2) <8F35484D-9C09-3D79-9825-7E73661326D4> /System/Library/Frameworks/OpenGL.framework/Versions/A/Resources/GLEngine.bundle/GLEngine
0x7fff37f70000 - 0x7fff37f98ffb GLRendererFloat (16.4.2) <463BD481-6E1A-3EFC-A93B-C7E9292F76ED> /System/Library/Frameworks/OpenGL.framework/Versions/A/Resources/GLRendererFloat.bundle/GLRendererFloat
0x7fff3814f000 - 0x7fff3829bfff com.apple.QTKit (7.7.3 - 3014) <CF2818E6-E215-3C24-A2AC-1B5F8AD7E398> /System/Library/Frameworks/QTKit.framework/Versions/A/QTKit
0x7fff3829c000 - 0x7fff38501ff7 com.apple.imageKit (3.0 - 1040) <5A1261EA-76C5-386C-9F46-06EE804E2234> /System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/ImageKit.framework/Versions/A/ImageKit
0x7fff38502000 - 0x7fff385eeff3 com.apple.PDFKit (1.0 - 677.4) <B5E41E73-0F19-3026-A30E-121F66A38019> /System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/PDFKit.framework/Versions/A/PDFKit
0x7fff385ef000 - 0x7fff38b01ff7 com.apple.QuartzComposer (5.1 - 364) <D99600D5-C066-3D49-8641-369A69300D16> /System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/QuartzComposer.framework/Versions/A/QuartzComposer
0x7fff38b02000 - 0x7fff38b25fff com.apple.quartzfilters (1.10.0 - 1.10.0) <8CBE10F3-828F-373C-B92A-A5289CBCF77A> /System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/QuartzFilters.framework/Versions/A/QuartzFilters
0x7fff38b26000 - 0x7fff38c1dff7 com.apple.QuickLookUIFramework (5.0 - 743.7) <53CAEAD9-0C1D-3CFB-866A-21F4745544D7> /System/Library/Frameworks/Quartz.framework/Versions/A/Frameworks/QuickLookUI.framework/Versions/A/QuickLookUI
0x7fff38c1e000 - 0x7fff38c1efff com.apple.quartzframework (1.5 - 21) <3F3BE91F-A032-3E92-ACEA-E2DFEC999E93> /System/Library/Frameworks/Quartz.framework/Versions/A/Quartz
0x7fff38c1f000 - 0x7fff38e67fff com.apple.QuartzCore (1.11 - 584.8.94) <8D6B5735-852F-36D3-9349-C423582F743B> /System/Library/Frameworks/QuartzCore.framework/Versions/A/QuartzCore
0x7fff38e68000 - 0x7fff38ebfff7 com.apple.QuickLookFramework (5.0 - 743.7) <0CB6717C-CCE2-3591-A31E-A8EF01DD4FC8> /System/Library/Frameworks/QuickLook.framework/Versions/A/QuickLook
0x7fff39084000 - 0x7fff3909afff com.apple.SafariServices.framework (13604 - 13604.4.7.1.3) <4DA6B5BD-0F79-3E34-9206-58A0FF3C01D2> /System/Library/Frameworks/SafariServices.framework/Versions/A/SafariServices
0x7fff396a0000 - 0x7fff399b7fff com.apple.security (7.0 - 58286.31.2) <D31B36DF-8956-3205-BFBA-98732DA715E5> /System/Library/Frameworks/Security.framework/Versions/A/Security
0x7fff399b8000 - 0x7fff39a42ff7 com.apple.securityfoundation (6.0 - 55185.30.4) <A1201529-3718-31C4-9D9E-BBD2A04B6751> /System/Library/Frameworks/SecurityFoundation.framework/Versions/A/SecurityFoundation
0x7fff39a43000 - 0x7fff39a73ff3 com.apple.securityinterface (10.0 - 55109.30.2) <B305DA7D-7866-3194-B498-F9995D232486> /System/Library/Frameworks/SecurityInterface.framework/Versions/A/SecurityInterface
0x7fff39a74000 - 0x7fff39a77ffb com.apple.xpc.ServiceManagement (1.0 - 1) <B11C3C64-6FE7-3A78-B583-D790B7CCE95A> /System/Library/Frameworks/ServiceManagement.framework/Versions/A/ServiceManagement
0x7fff39e1c000 - 0x7fff39e8cff3 com.apple.SystemConfiguration (1.17 - 1.17) <3C6B2BB9-43AB-39AD-8027-38E30A8A4186> /System/Library/Frameworks/SystemConfiguration.framework/Versions/A/SystemConfiguration
0x7fff3a041000 - 0x7fff3a3baff7 com.apple.VideoToolbox (1.0 - 2267.40.5) <CC88FFB3-5DBE-33C0-AF8D-2C915D915A24> /System/Library/Frameworks/VideoToolbox.framework/Versions/A/VideoToolbox
0x7fff3a662000 - 0x7fff3ab7bfe3 libwebrtc.dylib (7604.4.7.1.3) <777100A8-D98C-3DC1-931C-BBC689345FA2> /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/Frameworks/libwebrtc.dylib
0x7fff3ab7c000 - 0x7fff3c018fff com.apple.WebCore (13604 - 13604.4.7.1.3) <FD0252AD-1BF9-30EE-BF2E-4409722582EB> /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebCore.framework/Versions/A/WebCore
0x7fff3c019000 - 0x7fff3c20aff7 com.apple.WebKitLegacy (13604 - 13604.4.7.1.3) <91DD2BFE-AA52-38AD-920C-D21D22ECA1B3> /System/Library/Frameworks/WebKit.framework/Versions/A/Frameworks/WebKitLegacy.framework/Versions/A/WebKitLegacy
0x7fff3c20b000 - 0x7fff3c5fafff com.apple.WebKit (13604 - 13604.4.7.1.3) <E9C0A9B5-5331-3FDE-9587-968A86981D53> /System/Library/Frameworks/WebKit.framework/Versions/A/WebKit
0x7fff3ca6a000 - 0x7fff3caf6ff7 com.apple.APFS (1.0 - 1) <834EAD5F-0C4E-3C33-A654-8E1670CEC457> /System/Library/PrivateFrameworks/APFS.framework/Versions/A/APFS
0x7fff3d704000 - 0x7fff3d72cfff com.apple.framework.Apple80211 (13.0 - 1345) <BD86685B-6221-300D-9A97-119285C43DE9> /System/Library/PrivateFrameworks/Apple80211.framework/Versions/A/Apple80211
0x7fff3d72e000 - 0x7fff3d73dff7 com.apple.AppleFSCompression (96.30.2 - 1.0) <CFA90544-68EB-3CCE-A8F7-1B03974F3B85> /System/Library/PrivateFrameworks/AppleFSCompression.framework/Versions/A/AppleFSCompression
0x7fff3d73e000 - 0x7fff3d822ff7 com.apple.AppleGVAFramework (11.3.7 - 11.3.7) <EB9E64AF-AFF6-3747-8F0E-E77377328143> /System/Library/PrivateFrameworks/AppleGVA.framework/Versions/A/AppleGVA
0x7fff3d879000 - 0x7fff3d8c1ff3 com.apple.AppleJPEG (1.0 - 1) <8BBD5180-5BF9-33DB-8B91-974B1D0AECFB> /System/Library/PrivateFrameworks/AppleJPEG.framework/Versions/A/AppleJPEG
0x7fff3d8d4000 - 0x7fff3d8f2ff3 com.apple.aps.framework (4.0 - 4.0) <932274E4-DCD5-30D5-9AC7-58CEF4571EB3> /System/Library/PrivateFrameworks/ApplePushService.framework/Versions/A/ApplePushService
0x7fff3d8f3000 - 0x7fff3d8fbff3 com.apple.AppleSRP (5.0 - 1) <4CEC34CF-63E3-3023-B61B-F8D133698534> /System/Library/PrivateFrameworks/AppleSRP.framework/Versions/A/AppleSRP
0x7fff3d8fc000 - 0x7fff3d924fff com.apple.applesauce (1.0 - ???) <32FF4851-2F68-35BA-835F-91856A20C323> /System/Library/PrivateFrameworks/AppleSauce.framework/Versions/A/AppleSauce
0x7fff3d9ed000 - 0x7fff3d9f0ff3 com.apple.AppleSystemInfo (3.1.5 - 3.1.5) <A6795AC1-D528-3A2F-9C43-14EBFC57B7D6> /System/Library/PrivateFrameworks/AppleSystemInfo.framework/Versions/A/AppleSystemInfo
0x7fff3d9f1000 - 0x7fff3da41ff7 com.apple.AppleVAFramework (5.0.39 - 5.0.39) <4B830521-2A54-3116-8103-127E631FEDC8> /System/Library/PrivateFrameworks/AppleVA.framework/Versions/A/AppleVA
0x7fff3e110000 - 0x7fff3e117ff7 com.apple.coreservices.BackgroundTaskManagement (1.0 - 57.1) <47B6301F-D908-3811-BB9E-DA16D9B29A34> /System/Library/PrivateFrameworks/BackgroundTaskManagement.framework/Versions/A/BackgroundTaskManagement
0x7fff3e118000 - 0x7fff3e19fff7 com.apple.backup.framework (1.9.2 - 1.9.2) <40C6CFA8-4013-3AFB-97CE-8A09388FA343> /System/Library/PrivateFrameworks/Backup.framework/Versions/A/Backup
0x7fff3e215000 - 0x7fff3e251fff com.apple.bom (14.0 - 194.2) <ED2FFB9D-4DA4-322B-89C0-102D790649CD> /System/Library/PrivateFrameworks/Bom.framework/Versions/A/Bom
0x7fff3e86f000 - 0x7fff3e89cfff com.apple.CalendarAgentLink (8.0 - 250) <55B60B04-2EAA-3F22-88EF-1602129D5294> /System/Library/PrivateFrameworks/CalendarAgentLink.framework/Versions/A/CalendarAgentLink
0x7fff3ef63000 - 0x7fff3efb2ff3 com.apple.ChunkingLibrary (188 - 188) <84E024A0-5F95-3A30-A60B-102343AE46B7> /System/Library/PrivateFrameworks/ChunkingLibrary.framework/Versions/A/ChunkingLibrary
0x7fff3fb2e000 - 0x7fff3fb37ff3 com.apple.CommonAuth (4.0 - 2.0) <11B2D184-36B8-3624-B1AD-7B6037D76160> /System/Library/PrivateFrameworks/CommonAuth.framework/Versions/A/CommonAuth
0x7fff3fb4c000 - 0x7fff3fb61ff7 com.apple.commonutilities (8.0 - 900) <518FBC2C-0AF3-39DF-B454-526311796A49> /System/Library/PrivateFrameworks/CommonUtilities.framework/Versions/A/CommonUtilities
0x7fff3fce5000 - 0x7fff3fd45fff com.apple.AddressBook.ContactsFoundation (8.0 - ???) <9B39DF3E-5B7F-3467-AC17-23258F76A376> /System/Library/PrivateFrameworks/ContactsFoundation.framework/Versions/A/ContactsFoundation
0x7fff3fd46000 - 0x7fff3fd68fff com.apple.contacts.ContactsPersistence (1.0 - 2330.3) <B7EA2D0A-8A43-3E9C-A7D2-E9585064C328> /System/Library/PrivateFrameworks/ContactsPersistence.framework/Versions/A/ContactsPersistence
0x7fff3fdc8000 - 0x7fff401a8fff com.apple.CoreAUC (249.0.0 - 249.0.0) <7F406271-A215-3C75-BDAA-B9611BA2822E> /System/Library/PrivateFrameworks/CoreAUC.framework/Versions/A/CoreAUC
0x7fff401a9000 - 0x7fff401d9ff7 com.apple.CoreAVCHD (5.9.0 - 5900.4.1) <D0879D8F-488A-3D46-BC50-AD7B0642C0E8> /System/Library/PrivateFrameworks/CoreAVCHD.framework/Versions/A/CoreAVCHD
0x7fff401f0000 - 0x7fff4021dfff com.apple.CoreAnalytics.CoreAnalytics (1.0 - 1) <2D7C7B8C-C9C8-3F32-B43E-E792CD88A77D> /System/Library/PrivateFrameworks/CoreAnalytics.framework/Versions/A/CoreAnalytics
0x7fff403d4000 - 0x7fff403ddff7 com.apple.frameworks.CoreDaemon (1.3 - 1.3) <0A87A91C-A2CF-3BB1-9038-7F610111BC30> /System/Library/PrivateFrameworks/CoreDaemon.framework/Versions/B/CoreDaemon
0x7fff40544000 - 0x7fff40554ff7 com.apple.CoreEmoji (1.0 - 69.3) <A4357F5C-0C38-3A61-B456-D7321EB2CEE5> /System/Library/PrivateFrameworks/CoreEmoji.framework/Versions/A/CoreEmoji
0x7fff40e0f000 - 0x7fff40e25ff7 com.apple.CoreMediaAuthoring (2.2 - 956) <A5003E93-68B3-3A0E-8252-454CC4CFEC4D> /System/Library/PrivateFrameworks/CoreMediaAuthoring.framework/Versions/A/CoreMediaAuthoring
0x7fff40f67000 - 0x7fff40fc4ff7 com.apple.CoreNLP (1.0 - 130.4.1) <1F329E38-E7D0-3455-981B-48F434C9E8CC> /System/Library/PrivateFrameworks/CoreNLP.framework/Versions/A/CoreNLP
0x7fff4114d000 - 0x7fff41152ff7 com.apple.CoreOptimization (1.0 - 1) <785B622B-8F7D-3B4D-83AF-EB98CB79FFF6> /System/Library/PrivateFrameworks/CoreOptimization.framework/Versions/A/CoreOptimization
0x7fff41153000 - 0x7fff411f8ff7 com.apple.CorePDF (4.0 - 414) <353C8875-F5A0-37B0-82CF-CAFCE1A95D50> /System/Library/PrivateFrameworks/CorePDF.framework/Versions/A/CorePDF
0x7fff41298000 - 0x7fff412a0ff7 com.apple.CorePhoneNumbers (1.0 - 1) <9966298D-C45D-39FC-8CC4-58288F50D3F8> /System/Library/PrivateFrameworks/CorePhoneNumbers.framework/Versions/A/CorePhoneNumbers
0x7fff412a1000 - 0x7fff412fdfff com.apple.CorePrediction (1.0 - 1) <B1E687BA-4E62-321B-8C87-D37C540A5A68> /System/Library/PrivateFrameworks/CorePrediction.framework/Versions/A/CorePrediction
0x7fff4142a000 - 0x7fff4145bff3 com.apple.CoreServicesInternal (309.1 - 309.1) <EB09CAFC-AE9B-3257-BE45-5471D9F64AAD> /System/Library/PrivateFrameworks/CoreServicesInternal.framework/Versions/A/CoreServicesInternal
0x7fff417aa000 - 0x7fff4183bfff com.apple.CoreSymbolication (63075) <2458D96C-1C31-34F8-93F0-73DB0042CB30> /System/Library/PrivateFrameworks/CoreSymbolication.framework/Versions/A/CoreSymbolication
0x7fff418be000 - 0x7fff419f2fff com.apple.coreui (2.1 - 492.2) <FE0B32BC-958D-3445-866E-A3905626396D> /System/Library/PrivateFrameworks/CoreUI.framework/Versions/A/CoreUI
0x7fff419f3000 - 0x7fff41afeff3 com.apple.CoreUtils (5.3 - 530.57) <1DE5249E-35C5-3B13-BA5B-0C1AA4E17CDD> /System/Library/PrivateFrameworks/CoreUtils.framework/Versions/A/CoreUtils
0x7fff41b53000 - 0x7fff41bb7fff com.apple.framework.CoreWiFi (13.0 - 1339) <1741FD6D-3DF2-3D2D-9B56-92A6AA0D1146> /System/Library/PrivateFrameworks/CoreWiFi.framework/Versions/A/CoreWiFi
0x7fff41bb8000 - 0x7fff41bc7ff7 com.apple.CrashReporterSupport (10.13 - 1) <6B5B2B78-15D2-363F-BE34-8F9226E79E24> /System/Library/PrivateFrameworks/CrashReporterSupport.framework/Versions/A/CrashReporterSupport
0x7fff41c44000 - 0x7fff41c53ff7 com.apple.framework.DFRFoundation (1.0 - 191.1) <09E9A14C-E7A8-3386-8323-270FA28BFB81> /System/Library/PrivateFrameworks/DFRFoundation.framework/Versions/A/DFRFoundation
0x7fff41c56000 - 0x7fff41c5affb com.apple.DSExternalDisplay (3.1 - 380) <BEC07C7C-F3AC-3CF3-B13E-3EBFD6224C0D> /System/Library/PrivateFrameworks/DSExternalDisplay.framework/Versions/A/DSExternalDisplay
0x7fff41c9f000 - 0x7fff41cdfffb com.apple.datadetectors (5.0 - 376) <612C677D-BB71-35D2-BBF3-EA9EC51ADF12> /System/Library/PrivateFrameworks/DataDetectors.framework/Versions/A/DataDetectors
0x7fff41ce0000 - 0x7fff41d56fff com.apple.datadetectorscore (7.0 - 590.3) <792593BC-21C7-3E0C-929E-067CD725FCBD> /System/Library/PrivateFrameworks/DataDetectorsCore.framework/Versions/A/DataDetectorsCore
0x7fff41da4000 - 0x7fff41de4ff7 com.apple.DebugSymbols (141 - 141) <99562E28-0E56-3F6F-93A1-EF997A5E1F87> /System/Library/PrivateFrameworks/DebugSymbols.framework/Versions/A/DebugSymbols
0x7fff41de5000 - 0x7fff41f14fff com.apple.desktopservices (1.12.2 - 1.12.2) <8E068AF7-FB72-38E2-948E-6C13F359C69D> /System/Library/PrivateFrameworks/DesktopServicesPriv.framework/Versions/A/DesktopServicesPriv
0x7fff41f73000 - 0x7fff41f74ff7 com.apple.diagnosticlogcollection (10.0 - 1000) <DFD57FDB-CB78-3FB0-B49B-4586F9E0DFC1> /System/Library/PrivateFrameworks/DiagnosticLogCollection.framework/Versions/A/DiagnosticLogCollection
0x7fff42006000 - 0x7fff420d8ff7 com.apple.DiskImagesFramework (480.30.2 - 480.30.2) <251D047D-D79A-3300-8DFC-D6D6D4D0015D> /System/Library/PrivateFrameworks/DiskImages.framework/Versions/A/DiskImages
0x7fff420d9000 - 0x7fff42150ff7 com.apple.DiskManagement (11.2 - 1339) <0B17E79A-0BF6-3FD8-8AD0-A8498545030F> /System/Library/PrivateFrameworks/DiskManagement.framework/Versions/A/DiskManagement
0x7fff42151000 - 0x7fff4215cff7 com.apple.DisplayServicesFW (3.1 - 380) <FB1FBB24-7FD5-3B57-8D3C-39F953F8A9BB> /System/Library/PrivateFrameworks/DisplayServices.framework/Versions/A/DisplayServices
0x7fff421e4000 - 0x7fff421e6ff7 com.apple.EFILogin (2.0 - 2) <5B6E5A73-C2B2-3188-ADE9-C29CE29BB225> /System/Library/PrivateFrameworks/EFILogin.framework/Versions/A/EFILogin
0x7fff42932000 - 0x7fff4294afff com.apple.Engram (1.0 - 1) <93DC8AE3-B3F7-326E-93DB-C85A2BFD3C3F> /System/Library/PrivateFrameworks/Engram.framework/Versions/A/Engram
0x7fff42c88000 - 0x7fff430b6fff com.apple.vision.FaceCore (3.3.2 - 3.3.2) <80C97AD7-D5C2-311A-B268-4AA60CAD6CED> /System/Library/PrivateFrameworks/FaceCore.framework/Versions/A/FaceCore
0x7fff44d1e000 - 0x7fff44d1efff libmetal_timestamp.dylib (802.3.14) <D2CD48A8-5989-32AC-B64B-76E29D4E2449> /System/Library/PrivateFrameworks/GPUCompiler.framework/Versions/3802/Libraries/libmetal_timestamp.dylib
0x7fff4637e000 - 0x7fff46389ff7 libGPUSupportMercury.dylib (16.4.2) <F5BA5D7A-FD23-3416-B9B3-7EABFD4279D5> /System/Library/PrivateFrameworks/GPUSupport.framework/Versions/A/Libraries/libGPUSupportMercury.dylib
0x7fff46726000 - 0x7fff4674bff3 com.apple.GenerationalStorage (2.0 - 285) <07E7BC5F-8EF2-34FC-9EEC-B4E61EAAFA9A> /System/Library/PrivateFrameworks/GenerationalStorage.framework/Versions/A/GenerationalStorage
0x7fff46763000 - 0x7fff47087fff com.apple.GeoServices (1.0 - 1359.22.9.1.19) <0D30FD8E-BAED-3383-AF27-965D3A09B05E> /System/Library/PrivateFrameworks/GeoServices.framework/Versions/A/GeoServices
0x7fff470ca000 - 0x7fff470d9fff com.apple.GraphVisualizer (1.0 - 5) <0A93C5DE-0D28-312E-8764-6B0FB805ED91> /System/Library/PrivateFrameworks/GraphVisualizer.framework/Versions/A/GraphVisualizer
0x7fff47151000 - 0x7fff471c5fff com.apple.Heimdal (4.0 - 2.0) <ACC132E5-97F1-3B36-AD7B-4E6CC077E691> /System/Library/PrivateFrameworks/Heimdal.framework/Versions/A/Heimdal
0x7fff4725f000 - 0x7fff47371ff3 com.apple.ids (10.0 - 1000) <3BAA60B0-8F63-3570-B276-01EF45B9B4DF> /System/Library/PrivateFrameworks/IDS.framework/Versions/A/IDS
0x7fff47372000 - 0x7fff47450ff3 com.apple.idsfoundation (10.0 - 1000) <22E80DC0-4246-3B6B-903F-D1D191E615F8> /System/Library/PrivateFrameworks/IDSFoundation.framework/Versions/A/IDSFoundation
0x7fff47957000 - 0x7fff479bdff3 com.apple.imfoundation (10.0 - 1000) <32799DD1-91A2-3093-8D8C-4F4988560FC2> /System/Library/PrivateFrameworks/IMFoundation.framework/Versions/A/IMFoundation
0x7fff47a77000 - 0x7fff47a7effb com.apple.IOAccelerator (376.6 - 376.6) <A47129CC-F386-3C31-AD66-C19A70615A50> /System/Library/PrivateFrameworks/IOAccelerator.framework/Versions/A/IOAccelerator
0x7fff47a82000 - 0x7fff47a99fff com.apple.IOPresentment (1.0 - 32.1) <B95F06EA-9D5D-311D-9912-978AE42ECFCE> /System/Library/PrivateFrameworks/IOPresentment.framework/Versions/A/IOPresentment
0x7fff47e63000 - 0x7fff47e88fff com.apple.IconServices (97.4 - 97.4) <C84A6CA5-8C50-3288-8572-CC3DABF5BBCE> /System/Library/PrivateFrameworks/IconServices.framework/Versions/A/IconServices
0x7fff47f92000 - 0x7fff47f95ff3 com.apple.InternationalSupport (1.0 - 1) <5AB382FD-BF81-36A1-9565-61F1FD398ECA> /System/Library/PrivateFrameworks/InternationalSupport.framework/Versions/A/InternationalSupport
0x7fff48003000 - 0x7fff48013ffb com.apple.IntlPreferences (2.0 - 227) <0FF7209B-0E4D-3411-B325-03938B7C0938> /System/Library/PrivateFrameworks/IntlPreferences.framework/Versions/A/IntlPreferences
0x7fff4811d000 - 0x7fff48212fff com.apple.LanguageModeling (1.0 - 159.3.1) <9B08E18E-69B4-3413-A03A-EF5AE4BE6277> /System/Library/PrivateFrameworks/LanguageModeling.framework/Versions/A/LanguageModeling
0x7fff48213000 - 0x7fff48255ff7 com.apple.Lexicon-framework (1.0 - 33.2) <5CC5E8EE-62A1-3EA5-B300-A39ABD0CF12D> /System/Library/PrivateFrameworks/Lexicon.framework/Versions/A/Lexicon
0x7fff48259000 - 0x7fff48260ff7 com.apple.LinguisticData (1.0 - 238.3) <228AF7CA-649A-3E24-BBC7-8A24B39B3FC4> /System/Library/PrivateFrameworks/LinguisticData.framework/Versions/A/LinguisticData
0x7fff48347000 - 0x7fff4834cfff com.apple.LoginUICore (4.0 - 4.0) <A5F2EF2E-0999-376D-83EF-1B66171C5723> /System/Library/PrivateFrameworks/LoginUIKit.framework/Versions/A/Frameworks/LoginUICore.framework/Versions/A/LoginUICore
0x7fff48398000 - 0x7fff483b5ff3 com.apple.LookupFramework (1.2 - 239) <ACECB15D-1C21-3D3D-A4C5-F9736090E741> /System/Library/PrivateFrameworks/Lookup.framework/Versions/A/Lookup
0x7fff48a84000 - 0x7fff48a87fff com.apple.Mangrove (1.0 - 1) <13832222-8A6B-3790-8914-BE874B5ED4DD> /System/Library/PrivateFrameworks/Mangrove.framework/Versions/A/Mangrove
0x7fff48b10000 - 0x7fff48b12ff7 com.apple.marco (10.0 - 1000) <86E99D5C-D56D-3874-B465-833A9B40DE88> /System/Library/PrivateFrameworks/Marco.framework/Versions/A/Marco
0x7fff48ba0000 - 0x7fff48bd3ff7 com.apple.MediaKit (16 - 871) <47A5B872-4139-315D-A047-581F9C485D15> /System/Library/PrivateFrameworks/MediaKit.framework/Versions/A/MediaKit
0x7fff48bd4000 - 0x7fff48e18ff7 com.apple.MediaRemote (1.0 - 1) <ADDC2917-76C0-3F07-8DBF-746C9CA6A9BE> /System/Library/PrivateFrameworks/MediaRemote.framework/Versions/A/MediaRemote
0x7fff48e19000 - 0x7fff48e38ff3 com.apple.MediaServices (1.0 - 1) <2CA740A6-7E26-3865-8A5B-C2912665D01C> /System/Library/PrivateFrameworks/MediaServices.framework/Versions/A/MediaServices
0x7fff48eac000 - 0x7fff48f15ff7 com.apple.gpusw.MetalTools (1.0 - 1) <F77943BC-0466-3700-BEDF-CDD13125D36A> /System/Library/PrivateFrameworks/MetalTools.framework/Versions/A/MetalTools
0x7fff48f1d000 - 0x7fff48f32ff3 com.apple.MobileAssets (1.0 - 437.30.17) <9C014350-D76E-3143-ACFF-F3D1B2668988> /System/Library/PrivateFrameworks/MobileAsset.framework/Versions/A/MobileAsset
0x7fff49089000 - 0x7fff490a1ff3 com.apple.MobileKeyBag (2.0 - 1.0) <170AD2F3-9D3E-3FF6-BA02-60C48C1E6724> /System/Library/PrivateFrameworks/MobileKeyBag.framework/Versions/A/MobileKeyBag
0x7fff4912d000 - 0x7fff49155fff com.apple.MultitouchSupport.framework (1204.13 - 1204.13) <6C5D778D-4AB7-39A4-989B-2E8D2D57B3A0> /System/Library/PrivateFrameworks/MultitouchSupport.framework/Versions/A/MultitouchSupport
0x7fff493ba000 - 0x7fff493c5fff com.apple.NetAuth (6.2 - 6.2) <5C6F492A-28EF-3A0E-B573-6F3D60CFF0C7> /System/Library/PrivateFrameworks/NetAuth.framework/Versions/A/NetAuth
0x7fff493d2000 - 0x7fff4949fff7 com.apple.Network (1.0 - 1) <3C391F45-3801-3C27-8D89-FDE554156CDD> /System/Library/PrivateFrameworks/Network.framework/Versions/A/Network
0x7fff4abc7000 - 0x7fff4ac07ffb com.apple.PerformanceAnalysis (1.183.1 - 183.1) <2BE359F2-DCE6-3E33-BA99-964507A3F540> /System/Library/PrivateFrameworks/PerformanceAnalysis.framework/Versions/A/PerformanceAnalysis
0x7fff4ac7f000 - 0x7fff4ac7fff7 com.apple.PhoneNumbers (1.0 - 1) <DB9AC990-BA10-3BAC-8109-3C71E9D45BE2> /System/Library/PrivateFrameworks/PhoneNumbers.framework/Versions/A/PhoneNumbers
0x7fff4c66b000 - 0x7fff4c690fff com.apple.pluginkit.framework (1.0 - 1) <D627D78B-BEDA-3E53-B5F8-B3805F1C4D2A> /System/Library/PrivateFrameworks/PlugInKit.framework/Versions/A/PlugInKit
0x7fff4c98f000 - 0x7fff4c9e2fff com.apple.ProtectedCloudStorage (1.0 - 1) <8C4D5271-406F-3455-88FA-995A95D6D4A1> /System/Library/PrivateFrameworks/ProtectedCloudStorage.framework/Versions/A/ProtectedCloudStorage
0x7fff4c9e3000 - 0x7fff4ca01fff com.apple.ProtocolBuffer (1 - 259) <D047A3FE-C7A8-3CAA-9891-6232BA88C247> /System/Library/PrivateFrameworks/ProtocolBuffer.framework/Versions/A/ProtocolBuffer
0x7fff4cb6e000 - 0x7fff4cb83ff3 com.apple.QuickLookThumbnailing (1.0 - 1) <0771325B-BBAD-3865-B2A3-BE7089641C52> /System/Library/PrivateFrameworks/QuickLookThumbnailing.framework/Versions/A/QuickLookThumbnailing
0x7fff4cb84000 - 0x7fff4cb8cff3 com.apple.RTCReporting (9.32.35.1 - 9.32.35.1) <A62555BF-C5C0-3CD8-BBFA-DB6D0F25722B> /System/Library/PrivateFrameworks/RTCReporting.framework/Versions/A/RTCReporting
0x7fff4cbd5000 - 0x7fff4cbe0fff com.apple.xpc.RemoteServiceDiscovery (1.0 - 1205.30.29) <E2AEA0D7-23E6-3198-96EF-2F1F8ACD98B4> /System/Library/PrivateFrameworks/RemoteServiceDiscovery.framework/Versions/A/RemoteServiceDiscovery
0x7fff4cbe1000 - 0x7fff4cc04ffb com.apple.RemoteViewServices (2.0 - 125) <AEDBCE8C-88B7-315A-9F81-3E068F0D3EDC> /System/Library/PrivateFrameworks/RemoteViewServices.framework/Versions/A/RemoteViewServices
0x7fff4cc05000 - 0x7fff4cc16ffb com.apple.xpc.RemoteXPC (1.0 - 1205.30.29) <1FD53EC6-A9E9-3AEC-86A7-C52729D1A135> /System/Library/PrivateFrameworks/RemoteXPC.framework/Versions/A/RemoteXPC
0x7fff4e51d000 - 0x7fff4e62dff7 com.apple.Sharing (972.6 - 972.6) <2F72F828-7A05-345F-8ABA-1EDADACA4D57> /System/Library/PrivateFrameworks/Sharing.framework/Versions/A/Sharing
0x7fff4e657000 - 0x7fff4e658fff com.apple.performance.SignpostNotification (1.0 - 1) <D4C967BA-92C6-3BAB-AFB5-59F98B35F921> /System/Library/PrivateFrameworks/SignpostNotification.framework/Versions/A/SignpostNotification
0x7fff4f355000 - 0x7fff4f5effff com.apple.SkyLight (1.600.0 - 312.23.4) <390012E0-39E3-3D18-8271-D447990FDD21> /System/Library/PrivateFrameworks/SkyLight.framework/Versions/A/SkyLight
0x7fff4fda0000 - 0x7fff4fdadff7 com.apple.SpeechRecognitionCore (4.0.13 - 4.0.13) <AC026FB9-78F8-31F9-BB80-619D5378DB70> /System/Library/PrivateFrameworks/SpeechRecognitionCore.framework/Versions/A/SpeechRecognitionCore
0x7fff50246000 - 0x7fff5026dff7 com.apple.StreamingZip (1.0 - 1) <F06F4CDC-138C-3991-A987-7C7332BE4508> /System/Library/PrivateFrameworks/StreamingZip.framework/Versions/A/StreamingZip
0x7fff5093f000 - 0x7fff509c3fe7 com.apple.Symbolication (9.0 - 63079.1) <177BC9CA-E6AE-3B40-806F-0080C0CDFF29> /System/Library/PrivateFrameworks/Symbolication.framework/Versions/A/Symbolication
0x7fff50c85000 - 0x7fff50cb1fff com.apple.framework.SystemAdministration (1.0 - 1.0) <6AE03DE8-E5C1-38E5-B788-0A763CAACDC2> /System/Library/PrivateFrameworks/SystemAdministration.framework/Versions/A/SystemAdministration
0x7fff50eb4000 - 0x7fff50ebbff3 com.apple.TCC (1.0 - 1) <C807D3F0-FE20-3FC0-8D61-306477ABEBC4> /System/Library/PrivateFrameworks/TCC.framework/Versions/A/TCC
0x7fff510c8000 - 0x7fff51185ff7 com.apple.TextureIO (3.7 - 3.7) <C98BFACA-7807-3DCA-945D-58EBA2B723C8> /System/Library/PrivateFrameworks/TextureIO.framework/Versions/A/TextureIO
0x7fff511d6000 - 0x7fff511f1ffb com.apple.ToneKit (1.0 - 1) <A0242052-983B-3726-B5BD-D2E672CEFE2F> /System/Library/PrivateFrameworks/ToneKit.framework/Versions/A/ToneKit
0x7fff511f2000 - 0x7fff51219fff com.apple.ToneLibrary (1.0 - 1) <7EEABD7F-D0CB-327E-A772-ACF406B9C8F2> /System/Library/PrivateFrameworks/ToneLibrary.framework/Versions/A/ToneLibrary
0x7fff51229000 - 0x7fff5122afff com.apple.TrustEvaluationAgent (2.0 - 31) <39F533B2-211E-3635-AF47-23F27749FF4A> /System/Library/PrivateFrameworks/TrustEvaluationAgent.framework/Versions/A/TrustEvaluationAgent
0x7fff51230000 - 0x7fff513dfff3 com.apple.UIFoundation (1.0 - 546.1.1) <2B50EBBC-9221-31BC-92A9-7ED0A4A46E2D> /System/Library/PrivateFrameworks/UIFoundation.framework/Versions/A/UIFoundation
0x7fff520a8000 - 0x7fff52177ff7 com.apple.ViewBridge (343.2 - 343.2) <DD3D1ED5-DF9E-3C48-8897-0B84B0AD2377> /System/Library/PrivateFrameworks/ViewBridge.framework/Versions/A/ViewBridge
0x7fff5253c000 - 0x7fff52762ff7 libAWDSupportFramework.dylib (749.13) <B8711178-CE8C-3786-A269-E83710A1B71D> /System/Library/PrivateFrameworks/WirelessDiagnostics.framework/Versions/A/Libraries/libAWDSupportFramework.dylib
0x7fff52763000 - 0x7fff52774fff libprotobuf-lite.dylib (749.13) <9344E035-93AA-3197-8033-93348005AFF5> /System/Library/PrivateFrameworks/WirelessDiagnostics.framework/Versions/A/Libraries/libprotobuf-lite.dylib
0x7fff52775000 - 0x7fff527d7fff libprotobuf.dylib (749.13) <EA5D182D-2E4B-3DF3-BEED-ADEF1FE4EBC5> /System/Library/PrivateFrameworks/WirelessDiagnostics.framework/Versions/A/Libraries/libprotobuf.dylib
0x7fff527d8000 - 0x7fff5281bff7 com.apple.awd (1.0 - 919) <60D12A36-C579-348F-B84C-E25F20C422E0> /System/Library/PrivateFrameworks/WirelessDiagnostics.framework/Versions/A/WirelessDiagnostics
0x7fff52b22000 - 0x7fff52b24ffb com.apple.loginsupport (1.0 - 1) <5E2C4AA7-066D-3FDB-B0E1-4CDAF287392C> /System/Library/PrivateFrameworks/login.framework/Versions/A/Frameworks/loginsupport.framework/Versions/A/loginsupport
0x7fff52b25000 - 0x7fff52b3afff com.apple.login (3.0 - 3.0) <140118A7-8FB9-35C5-92FA-BD79C9C32309> /System/Library/PrivateFrameworks/login.framework/Versions/A/login
0x7fff52b65000 - 0x7fff52b92fff com.apple.contacts.vCard (1.0 - 2330.3) <02AB9DF0-0471-3FDA-8EC6-27C72E00DD75> /System/Library/PrivateFrameworks/vCard.framework/Versions/A/vCard
0x7fff52c88000 - 0x7fff52cbbfff libclosured.dylib (519.2.2) <48051216-5647-3643-B979-B77D0FD20011> /usr/lib/closure/libclosured.dylib
0x7fff52d5b000 - 0x7fff52d94ff7 libCRFSuite.dylib (41) <AB2DA745-F22C-30CF-81D4-35DD716463B8> /usr/lib/libCRFSuite.dylib
0x7fff52d95000 - 0x7fff52da0fff libChineseTokenizer.dylib (28) <D30A7DB6-058F-3286-9583-60C9EEB77A6E> /usr/lib/libChineseTokenizer.dylib
0x7fff52da1000 - 0x7fff52e2eff7 libCoreStorage.dylib (546) <B495D87B-FE21-3C14-9017-F02D9CA226D5> /usr/lib/libCoreStorage.dylib
0x7fff52e32000 - 0x7fff52e33ff3 libDiagnosticMessagesClient.dylib (104) <9712E980-76EE-3A89-AEA6-DF4BAF5C0574> /usr/lib/libDiagnosticMessagesClient.dylib
0x7fff52e6a000 - 0x7fff53034ff3 libFosl_dynamic.dylib (17.7) <B2476843-7FA7-3E62-B79F-2B15FE557E63> /usr/lib/libFosl_dynamic.dylib
0x7fff5306c000 - 0x7fff5306cfff libOpenScriptingUtil.dylib (174) <203D2C39-61BB-3713-A502-2D17B04A42AC> /usr/lib/libOpenScriptingUtil.dylib
0x7fff53195000 - 0x7fff53199ffb libScreenReader.dylib (562.13) <21638ECC-87BF-3CC5-B2D8-6F7883F5FDCA> /usr/lib/libScreenReader.dylib
0x7fff5319a000 - 0x7fff5319bff3 libSystem.B.dylib (1252) <5EDEEA85-0387-31EE-9D9B-DA1B75E7AEF3> /usr/lib/libSystem.B.dylib
0x7fff5319c000 - 0x7fff53219fff libTelephonyUtilDynamic.dylib (3086.2) <47109727-F31F-3777-BD41-1DED1B8C96DC> /usr/lib/libTelephonyUtilDynamic.dylib
0x7fff5321a000 - 0x7fff5321bfff libThaiTokenizer.dylib (2.2) <04AC7CD4-BD9A-3B1D-8CEB-9E2030B6B667> /usr/lib/libThaiTokenizer.dylib
0x7fff5322e000 - 0x7fff5322efff libapple_crypto.dylib (109.30.8) <E0162198-C97F-3286-9FF7-254D23F6FD04> /usr/lib/libapple_crypto.dylib
0x7fff5322f000 - 0x7fff53245ff7 libapple_nghttp2.dylib (1.24) <01402BC4-4822-3676-9C80-50D83F816424> /usr/lib/libapple_nghttp2.dylib
0x7fff53246000 - 0x7fff53270ff3 libarchive.2.dylib (54) <8FC28DD8-E315-3C3E-95FE-D1D2CBE49888> /usr/lib/libarchive.2.dylib
0x7fff53271000 - 0x7fff532f2fdf libate.dylib (1.13.1) <178ACDAD-DE7E-346C-A613-1CBF7929AC07> /usr/lib/libate.dylib
0x7fff532f6000 - 0x7fff532f6ff3 libauto.dylib (187) <A05C7900-F8C7-3E75-8D3F-909B40C19717> /usr/lib/libauto.dylib
0x7fff532f7000 - 0x7fff533aeff7 libboringssl.dylib (109.30.8) <E62E3E83-BA8A-3CCE-8E71-84FB184FBBB5> /usr/lib/libboringssl.dylib
0x7fff533af000 - 0x7fff533bfff3 libbsm.0.dylib (39) <770B341F-3BB7-3123-B53C-F2D58868A963> /usr/lib/libbsm.0.dylib
0x7fff533c0000 - 0x7fff533cdffb libbz2.1.0.dylib (38) <0A5086BB-4724-3C14-979D-5AD4F26B5B45> /usr/lib/libbz2.1.0.dylib
0x7fff533ce000 - 0x7fff53424fff libc++.1.dylib (400.9) <FCF5E1F6-2B04-3545-8004-F3AB32FED172> /usr/lib/libc++.1.dylib
0x7fff53425000 - 0x7fff53449ff7 libc++abi.dylib (400.7) <217656D5-BC40-37FF-B322-91CB2AAD4F34> /usr/lib/libc++abi.dylib
0x7fff5344b000 - 0x7fff5345bfff libcmph.dylib (6) <A5509EE8-7E00-3224-8814-015B077A3CF5> /usr/lib/libcmph.dylib
0x7fff5345c000 - 0x7fff53472fff libcompression.dylib (47) <E64D4416-DFBF-314B-BBB9-BED23C3A251C> /usr/lib/libcompression.dylib
0x7fff5371f000 - 0x7fff53737ff7 libcoretls.dylib (155) <DFE2454F-2FE3-3B2B-A22B-422947C34C69> /usr/lib/libcoretls.dylib
0x7fff53738000 - 0x7fff53739ffb libcoretls_cfhelpers.dylib (155) <D3F4B882-40C1-3CD4-927B-0E0ED6031D0B> /usr/lib/libcoretls_cfhelpers.dylib
0x7fff538d2000 - 0x7fff53a62fff libcrypto.35.dylib (22) <067CFC21-249D-392D-ADE1-785100BF0F83> /usr/lib/libcrypto.35.dylib
0x7fff53bfd000 - 0x7fff53c08ff7 libcsfde.dylib (546) <B6F6340A-F874-38BD-A7BB-FFADEBA54789> /usr/lib/libcsfde.dylib
0x7fff53c09000 - 0x7fff53c5fff3 libcups.2.dylib (462.1) <B78448A0-9C97-3D4A-823E-EBE37B2B7CA6> /usr/lib/libcups.2.dylib
0x7fff53c8a000 - 0x7fff53cdeffb libcurl.4.dylib (105.30.2) <DB7326B0-DE38-392D-AAFA-E81BE0EDE99E> /usr/lib/libcurl.4.dylib
0x7fff53ce1000 - 0x7fff53ce8ff3 libdscsym.dylib (183.1) <2DE012BF-CE9A-3BDF-9A2D-55D66B51AA35> /usr/lib/libdscsym.dylib
0x7fff53d9d000 - 0x7fff53d9dfff libenergytrace.dylib (16) <A92AB8B8-B986-3CE6-980D-D55090FEF387> /usr/lib/libenergytrace.dylib
0x7fff53dcf000 - 0x7fff53dd3ff7 libgermantok.dylib (17) <379C5DC6-BEDB-378D-B09C-A63D297EAA6D> /usr/lib/libgermantok.dylib
0x7fff53dd4000 - 0x7fff53dd9ff3 libheimdal-asn1.dylib (520.30.1) <14DC1451-6E22-3A48-80CB-5D33DC0F8C3B> /usr/lib/libheimdal-asn1.dylib
0x7fff53e05000 - 0x7fff53ef6ff7 libiconv.2.dylib (51) <0772997F-4109-38A1-91ED-0F3F16AE99E5> /usr/lib/libiconv.2.dylib
0x7fff53ef7000 - 0x7fff5411effb libicucore.A.dylib (59152.0.1) <281C39FD-0C9A-3EB2-A407-36D4CCE938E5> /usr/lib/libicucore.A.dylib
0x7fff5416b000 - 0x7fff5416cfff liblangid.dylib (128) <39C39393-0D05-301D-93B2-F224FC4949AA> /usr/lib/liblangid.dylib
0x7fff5416d000 - 0x7fff54186ffb liblzma.5.dylib (10) <3D419A50-961F-37D2-8A01-3DC7AB7B8D18> /usr/lib/liblzma.5.dylib
0x7fff54187000 - 0x7fff5419dff7 libmarisa.dylib (9) <D6D2D55D-1D2E-3442-B152-B18803C0ABB4> /usr/lib/libmarisa.dylib
0x7fff5419e000 - 0x7fff5424dfff libmecab.1.0.0.dylib (779.7.6) <F179766A-0448-37A6-9AD0-99E2FF2C0AD9> /usr/lib/libmecab.1.0.0.dylib
0x7fff5424e000 - 0x7fff54476ff7 libmecabra.dylib (779.7.6) <7808C544-161E-37CE-9D42-F368C82A180D> /usr/lib/libmecabra.dylib
0x7fff5464e000 - 0x7fff54725ffb libnetwork.dylib (1229.30.11) <2A9846DE-C063-3340-89D1-D5DAC2B8A08A> /usr/lib/libnetwork.dylib
0x7fff5479b000 - 0x7fff54b897e7 libobjc.A.dylib (723) <93A92316-DE1E-378C-8891-99720B50D075> /usr/lib/libobjc.A.dylib
0x7fff54b8a000 - 0x7fff54b8bff7 libodfde.dylib (24) <1BBC519E-EF89-38F3-B226-70F086670D0F> /usr/lib/libodfde.dylib
0x7fff54b9c000 - 0x7fff54ba0fff libpam.2.dylib (22) <7B4D2CE2-1438-387A-9802-5CEEFBF26F86> /usr/lib/libpam.2.dylib
0x7fff54ba3000 - 0x7fff54bd7fff libpcap.A.dylib (79.20.1) <FA13918B-A247-3181-B256-9B852C7BA316> /usr/lib/libpcap.A.dylib
0x7fff54c56000 - 0x7fff54c72ffb libresolv.9.dylib (65) <E8F3415B-4472-3202-8901-41FD87981DB2> /usr/lib/libresolv.9.dylib
0x7fff54cad000 - 0x7fff54cbffff libsasl2.2.dylib (211) <D9E281A2-D7BA-32CD-8B96-54972B1D9E66> /usr/lib/libsasl2.2.dylib
0x7fff54cc0000 - 0x7fff54cc1ff7 libspindump.dylib (248) <12E8B8BA-072F-39AE-8BC9-7D5840DA80EB> /usr/lib/libspindump.dylib
0x7fff54cc2000 - 0x7fff54e55fe7 libsqlite3.dylib (274.5) <A1DEB5AB-8FE8-332E-A7E5-F493F2223FE3> /usr/lib/libsqlite3.dylib
0x7fff54eb1000 - 0x7fff54f04ffb libssl.35.dylib (22) <4D77B502-E065-3794-90E7-39E83F9683F6> /usr/lib/libssl.35.dylib
0x7fff54fac000 - 0x7fff54fbcff7 libsystemstats.dylib (403.31.1) <9FE5E908-88F1-3593-ADCD-4BC78100DA68> /usr/lib/libsystemstats.dylib
0x7fff54fd9000 - 0x7fff5500efff libtidy.A.dylib (15.18.1) <3E33A53A-53AB-3FD5-BBAB-DFA6A3A90132> /usr/lib/libtidy.A.dylib
0x7fff55026000 - 0x7fff5505ffff libusrtcp.dylib (1229.30.11) <537F14D0-84DF-349F-8EA0-52BB7A241E60> /usr/lib/libusrtcp.dylib
0x7fff55060000 - 0x7fff55063ffb libutil.dylib (51.20.1) <216D18E5-0BAF-3EAF-A38E-F6AC37CBABD9> /usr/lib/libutil.dylib
0x7fff55064000 - 0x7fff55071fff libxar.1.dylib (400) <0316128D-3B47-3052-995D-97B4FE5491DC> /usr/lib/libxar.1.dylib
0x7fff55075000 - 0x7fff5515cfff libxml2.2.dylib (31.7) <49544596-BCF8-3765-8DC5-DB1A9A90EF92> /usr/lib/libxml2.2.dylib
0x7fff5515d000 - 0x7fff55185fff libxslt.1.dylib (15.10) <66682AF6-C2D5-374C-901F-25A3E72814DC> /usr/lib/libxslt.1.dylib
0x7fff55186000 - 0x7fff55198ffb libz.1.dylib (70) <48C67CFC-940D-3857-8DAD-857774605352> /usr/lib/libz.1.dylib
0x7fff55236000 - 0x7fff5523aff7 libcache.dylib (80) <354F3B7D-404E-3398-9EBF-65CA2CE65211> /usr/lib/system/libcache.dylib
0x7fff5523b000 - 0x7fff55245ff3 libcommonCrypto.dylib (60118.30.2) <674286D3-7744-36A3-9AAA-49DFCD97A986> /usr/lib/system/libcommonCrypto.dylib
0x7fff55246000 - 0x7fff5524dfff libcompiler_rt.dylib (62) <4487CFBA-A5D7-3282-9E6B-94CAD7BE507E> /usr/lib/system/libcompiler_rt.dylib
0x7fff5524e000 - 0x7fff55256ffb libcopyfile.dylib (146.30.2) <2C7C67D7-562B-3FFA-973D-BACF4C10E1EC> /usr/lib/system/libcopyfile.dylib
0x7fff55257000 - 0x7fff552dcfff libcorecrypto.dylib (562.30.10) <8A53EFE1-AFCA-3676-BEE1-FA5ED9F0E222> /usr/lib/system/libcorecrypto.dylib
0x7fff55364000 - 0x7fff5539dff7 libdispatch.dylib (913.30.4) <7D0E3183-282B-3FEE-A734-2C0ADC092084> /usr/lib/system/libdispatch.dylib
0x7fff5539e000 - 0x7fff553bbff7 libdyld.dylib (519.2.2) <C50D02BC-A333-3313-B787-02F255A6783F> /usr/lib/system/libdyld.dylib
0x7fff553bc000 - 0x7fff553bcffb libkeymgr.dylib (28) <6D84A96F-C65B-38EC-BDB5-21FD2C97E7B2> /usr/lib/system/libkeymgr.dylib
0x7fff553bd000 - 0x7fff553c9ff3 libkxld.dylib (4570.31.3) <C0DBCF74-E669-3AAD-934F-F07F3FE32908> /usr/lib/system/libkxld.dylib
0x7fff553ca000 - 0x7fff553caff7 liblaunch.dylib (1205.30.29) <E66F58ED-C15E-3DFB-BC22-A861E13918C6> /usr/lib/system/liblaunch.dylib
0x7fff553cb000 - 0x7fff553cfffb libmacho.dylib (900.0.1) <756F2553-07B6-3B42-ACEA-2F0F1A5E8D0F> /usr/lib/system/libmacho.dylib
0x7fff553d0000 - 0x7fff553d2ff3 libquarantine.dylib (86) <6AC8773F-3817-3D82-99C2-01BABB9C3CBB> /usr/lib/system/libquarantine.dylib
0x7fff553d3000 - 0x7fff553d4ff3 libremovefile.dylib (45) <912FA211-DD8C-3C92-8424-21B89F8B10FD> /usr/lib/system/libremovefile.dylib
0x7fff553d5000 - 0x7fff553ecfff libsystem_asl.dylib (356.1.1) <94972913-9DF0-3C78-847C-43E58919E3DA> /usr/lib/system/libsystem_asl.dylib
0x7fff553ed000 - 0x7fff553edfff libsystem_blocks.dylib (67) <F2493BB5-B1C6-3C4D-9F1F-1B402E0F1DB7> /usr/lib/system/libsystem_blocks.dylib
0x7fff553ee000 - 0x7fff55477ff7 libsystem_c.dylib (1244.30.3) <E0136C71-0648-36F0-9F84-82EA2748A8D7> /usr/lib/system/libsystem_c.dylib
0x7fff55478000 - 0x7fff5547bffb libsystem_configuration.dylib (963.30.1) <0F8D0B76-4F7D-34EC-AB6C-50F9465809DA> /usr/lib/system/libsystem_configuration.dylib
0x7fff5547c000 - 0x7fff5547fffb libsystem_coreservices.dylib (51) <21A488D0-2D07-344E-8631-CC8B2A246F35> /usr/lib/system/libsystem_coreservices.dylib
0x7fff55480000 - 0x7fff55481fff libsystem_darwin.dylib (1244.30.3) <2F750CB1-BC26-3FA3-AE59-553EE30D451B> /usr/lib/system/libsystem_darwin.dylib
0x7fff55482000 - 0x7fff55488ff7 libsystem_dnssd.dylib (878.30.4) <EB9BB165-45A4-367C-B33A-688D4F383A95> /usr/lib/system/libsystem_dnssd.dylib
0x7fff55489000 - 0x7fff554d2ff7 libsystem_info.dylib (517.30.1) <7D79E167-4B5C-3833-81EE-3AF3FB53616D> /usr/lib/system/libsystem_info.dylib
0x7fff554d3000 - 0x7fff554f8ff7 libsystem_kernel.dylib (4570.31.3) <D2E842AA-3B8D-31BF-8234-8C1BE11CFE32> /usr/lib/system/libsystem_kernel.dylib
0x7fff554f9000 - 0x7fff55544fcb libsystem_m.dylib (3146) <ABB1B85F-9FFE-31B8-AD4F-E39A30794A93> /usr/lib/system/libsystem_m.dylib
0x7fff55545000 - 0x7fff55564fff libsystem_malloc.dylib (140.1.1) <9F0745FF-B92F-330D-8812-BB74001D1D33> /usr/lib/system/libsystem_malloc.dylib
0x7fff55565000 - 0x7fff55609ff3 libsystem_network.dylib (1229.30.11) <40BAD301-8744-3AD8-A688-E7925C587B00> /usr/lib/system/libsystem_network.dylib
0x7fff5560a000 - 0x7fff55614ffb libsystem_networkextension.dylib (767.30.7) <C5ED4BAB-2480-369D-8AB6-DFB37C15A1EE> /usr/lib/system/libsystem_networkextension.dylib
0x7fff55615000 - 0x7fff5561eff3 libsystem_notify.dylib (172) <98EA3D62-7C86-30DE-8261-D020D2F1EFF3> /usr/lib/system/libsystem_notify.dylib
0x7fff5561f000 - 0x7fff55626ff7 libsystem_platform.dylib (161.20.1) <C049250F-8C35-314D-810F-4E28AEAED983> /usr/lib/system/libsystem_platform.dylib
0x7fff55627000 - 0x7fff55632fff libsystem_pthread.dylib (301.30.1) <ABA848E1-6978-3B42-A3A7-608B2C36FA93> /usr/lib/system/libsystem_pthread.dylib
0x7fff55633000 - 0x7fff55636ff3 libsystem_sandbox.dylib (765.30.4) <A51828BA-26D8-3205-AF3A-DF5C37269468> /usr/lib/system/libsystem_sandbox.dylib
0x7fff55637000 - 0x7fff55638ff3 libsystem_secinit.dylib (30) <F06ADB8F-9E94-34A7-B3C9-2C22FDD14BAD> /usr/lib/system/libsystem_secinit.dylib
0x7fff55639000 - 0x7fff55640ff7 libsystem_symptoms.dylib (820.30.7) <DC3586C2-AA56-3419-88D3-FC0DBF08E3C0> /usr/lib/system/libsystem_symptoms.dylib
0x7fff55641000 - 0x7fff55654ff7 libsystem_trace.dylib (829.30.14) <69EBF017-D40F-30D7-9B0B-BFC862D761A5> /usr/lib/system/libsystem_trace.dylib
0x7fff55656000 - 0x7fff5565bff7 libunwind.dylib (35.3) <6D4FCD49-D2A9-3233-95C7-A7635CE265F2> /usr/lib/system/libunwind.dylib
0x7fff5565c000 - 0x7fff55688ff7 libxpc.dylib (1205.30.29) <F7E5F1BC-614B-39CB-B6CE-92A9C7B7EC0B> /usr/lib/system/libxpc.dylib
External Modification Summary:
Calls made by other processes targeting this process:
task_for_pid: 1
thread_create: 0
thread_set_state: 0
Calls made by this process:
task_for_pid: 0
thread_create: 0
thread_set_state: 0
Calls made by all processes on this machine:
task_for_pid: 168737
thread_create: 0
thread_set_state: 387
VM Region Summary:
ReadOnly portion of Libraries: Total=456.2M resident=0K(0%) swapped_out_or_unallocated=456.2M(100%)
Writable regions: Total=432.3M written=0K(0%) resident=0K(0%) swapped_out=0K(0%) unallocated=432.3M(100%)
VIRTUAL REGION
REGION TYPE SIZE COUNT (non-coalesced)
=========== ======= =======
Accelerate framework 768K 7
Activity Tracing 256K 2
CG backing stores 1172K 4
CG image 1348K 106
CoreAnimation 61.6M 312
CoreGraphics 8K 2
CoreImage 44K 6
CoreUI image data 4404K 75
CoreUI image file 364K 9
Foundation 28K 3
Image IO 6476K 134
Kernel Alloc Once 8K 2
MALLOC 336.3M 94
MALLOC guard page 112K 25
Mach message 8K 3
Memory Tag 242 12K 2
Memory Tag 251 80K 4
SQLite page cache 7680K 8
STACK GUARD 56.0M 10
Stack 12.1M 11
VM_ALLOCATE 688K 22
__DATA 39.4M 347
__FONT_DATA 4K 2
__GLSLBUILTINS 2588K 2
__LINKEDIT 191.6M 9
__TEXT 264.6M 346
__UNICODE 560K 2
libnetwork 384K 16
mapped file 323.2M 46
shared memory 692K 15
=========== ======= =======
TOTAL 1.3G 1596
Model: MacBookPro12,1, BootROM MBP121.0171.B00, 2 processors, Intel Core i5, 2,9 GHz, 16 GB, SMC 2.28f7
Graphics: Intel Iris Graphics 6100, Intel Iris Graphics 6100, Built-In
Memory Module: BANK 0/DIMM0, 8 GB, DDR3, 1867 MHz, 0x02FE, 0x4544464232333241314D412D4A442D460000
Memory Module: BANK 1/DIMM0, 8 GB, DDR3, 1867 MHz, 0x02FE, 0x4544464232333241314D412D4A442D460000
AirPort: spairport_wireless_card_type_airport_extreme (0x14E4, 0x133), Broadcom BCM43xx 1.0 (7.77.37.5.1a3)
Bluetooth: Version 6.0.2f2, 3 services, 18 devices, 1 incoming serial ports
Network Service: Wi-Fi, AirPort, en0
Serial ATA Device: APPLE SSD SM0512G, 500,28 GB
USB Device: USB 3.0 Bus
USB Device: Bluetooth USB Host Controller
Thunderbolt Bus: MacBook Pro, Apple Inc., 27.1
+1 -1
View File
@@ -51,7 +51,7 @@ RUN cd /opt/code && \
tar -Jxf ${VALA_TAR}.tar.xz
RUN cd /opt/code/${VALA_TAR}; ./configure --prefix=/usr ; make && make install
# compile radare and bindings
RUN cd /opt/code; git clone https://github.com/radare/radare2.git; cd radare2; ./sys/all.sh
RUN cd /opt/code; git clone https://github.com/radareorg/radare2.git; cd radare2; ./sys/all.sh
#install Go
+1 -1
View File
@@ -28,7 +28,7 @@ RUN cd /opt/code && \
tar -Jxf ${VALA_TAR}.tar.xz
RUN cd /opt/code/${VALA_TAR}; ./configure --prefix=/usr ; make && make install
# compile radare and bindings
RUN cd /opt/code; git clone https://github.com/radare/radare2.git; cd radare2; ./sys/all.sh
RUN cd /opt/code; git clone https://github.com/radareorg/radare2.git; cd radare2; ./sys/all.sh
#install Go
+2 -2
View File
@@ -39,7 +39,7 @@ RUN apt-get install -y python-pip jython
RUN cd /opt/code; wget http://download.gnome.org/sources/vala/0.24/vala-0.24.0.tar.xz; tar -Jxf vala-0.24.0.tar.xz
RUN cd /opt/code/vala-0.24.0; ./configure --prefix=/usr ; make && make install
# compile radare
RUN cd /opt/code; git clone https://github.com/radare/radare2.git; cd radare2; ./sys/all.sh
RUN cd /opt/code; git clone https://github.com/radareorg/radare2.git; cd radare2; ./sys/all.sh
# Clean up APT when done.
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
@@ -48,7 +48,7 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN cd /opt/code; wget http://download.gnome.org/sources/vala/0.24/vala-0.24.0.tar.xz; tar -Jxf vala-0.24.0.tar.xz
RUN cd /opt/code/vala-0.24.0; ./configure --prefix=/usr ; make && make install
# compile radare
RUN cd /opt/code; git clone https://github.com/radare/radare2.git; cd radare2; ./sys/all.sh
RUN cd /opt/code; git clone https://github.com/radareorg/radare2.git; cd radare2; ./sys/all.sh
#install oracle jre stuffs
+2 -2
View File
@@ -23,7 +23,7 @@ RUN apt-get install -y python-pip jython
RUN cd /opt/code; wget http://download.gnome.org/sources/vala/0.24/vala-0.24.0.tar.xz; tar -Jxf vala-0.24.0.tar.xz
RUN cd /opt/code/vala-0.24.0; ./configure --prefix=/usr ; make && make install
# compile radare
RUN cd /opt/code; git clone https://github.com/radare/radare2.git; cd radare2; ./sys/all.sh
RUN cd /opt/code; git clone https://github.com/radareorg/radare2.git; cd radare2; ./sys/all.sh
# Clean up APT when done.
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
@@ -32,7 +32,7 @@ RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
RUN cd /opt/code; wget http://download.gnome.org/sources/vala/0.24/vala-0.24.0.tar.xz; tar -Jxf vala-0.24.0.tar.xz
RUN cd /opt/code/vala-0.24.0; ./configure --prefix=/usr ; make && make install
# compile radare
RUN cd /opt/code; git clone https://github.com/radare/radare2.git; cd radare2; ./sys/all.sh
RUN cd /opt/code; git clone https://github.com/radareorg/radare2.git; cd radare2; ./sys/all.sh
#install oracle jre stuffs
+2 -2
View File
@@ -2212,7 +2212,7 @@ static int r_cmd_dwarf_call (void *user, const char *input) {
return true;
}
static int r_cmd_dwarf_deinit () {
static int r_cmd_dwarf_fini () {
int res = DW_DLV_ERROR;
if (fd && dbg) {
@@ -2236,7 +2236,7 @@ RCorePlugin r_core_plugin_dwarf = {
.desc = "DWARF parser to analyse various structure and set flags (global variables and function declaration)",
.license = "gpl",
.call = r_cmd_dwarf_call,
.deinit = r_cmd_dwarf_deinit
.fini = r_cmd_dwarf_fini
};
#ifndef CORELIB
+10
View File
@@ -0,0 +1,10 @@
#!/bin/sh
FILE=$1
type addr2line > /dev/null 2>&1
if [ $? = 0 ]; then
ADDRS=`objdump -d "$FILE" |grep :| grep -v 0000000| grep -v Disas|cut -d : -f1`
addr2line -pa -e "$FILE" $ADDRS | sed -e 's,:,,' -e 's,^,CL ,' | grep -v '?'
else
echo "Unable to find 'addr2line' executable in PATH"
exit 1
fi
+23
View File
@@ -0,0 +1,23 @@
R2_PLUGDIR=$(shell r2 -H R2_USER_PLUGINS)
R2_LIBEXT=$(shell r2 -H R2_LIBEXT)
LDFLAGS=-L/opt/homebrew/lib
# VFLAGS+=-gc none
ifeq ($(R2_LIBEXT),)
all:
@echo Cannot find r2
else
all:
v install --once
v fmt -w pdv.v main.v east
v -o a.c -shared pdv.v
LDFLAGS=$(LDFLAGS) v -o pdv.$(R2_LIBEXT) -shared pdv.v
install -m 0755 pdv.$(R2_LIBEXT) $(R2_PLUGDIR)
v $(VFLAGS) -g main.v
./main
setup:
v install
endif
+48
View File
@@ -0,0 +1,48 @@
# VESIL
## Description
V library to provide high level analysis on top of esil
## Usage
See the `main.v` and run it with `make`.
## Known bugs
There are some r2 instances that arent killed somehow by v-r2pipe
## Random
```
paπcake, [3/29/2022 7:03 PM]
typedef struct {
char *name;
void *ref;
} Symbol;
// hook memory reads to find access to variables
// hook register names to track transfers of symbols
"0,rax,:="
:= will trigger reg_write, if 'rax' is associated to a symbol then we can name that operation
for example if rax is associated to the symbol containing the return value of a function
the esil box can create that symbol and handle the function call expression like foo = call()
symbols can be invalidated at any time and their meaning can change backwards.
using esilbox;
int main() {
Symbol *argc = r_esil_box_symbol_new ("argc", "rbp,10,-");
EsilBox *eb = r_esil_box_new ();
r_esil_box_add_symbol (eb, argc);
r_esil_box_set_address (eb, 0x8048000);
do {
r_esil_box_step (eb);
} white (r_esil_box_running (eb));
// eb := esilbox.new()
// eb.set_address(0x80488)
// eb.step()
}
```
+12
View File
@@ -0,0 +1,12 @@
# EAST
Esil Abstract Structured Tree
## Description
This is a work in progress project that aims to provide work in progress
and experimental development towards getting a decompiler on top of the
R2 intermediate language (ESIL).
The main objective of this project is to raise esil to the level where
we can use it for decompilation, type propagation and advanced analysis.
+168
View File
@@ -0,0 +1,168 @@
module east
pub enum NodeStatement {
_none
_break
_switch
_comment
_case
_block
_if
_condition
_symbol
_register
_string
_local
_operation // + - < > << || ...
_return
_function
_else
_for
_argument
_while
_dowhile
_call
_number // number
_goto // symbol or label
_label // symbol
_assign // dst, src
_oparen
_cparen
}
pub struct Node {
pub mut:
name string
typ NodeStatement
// typ EsilType
addr string
pos int
parent int
children []NodeIndex
}
type NodeIndex = int
pub fn (mut e Program) add_name(typ NodeStatement, name string, nodes []NodeIndex) NodeIndex {
ni := e.new_node(name)
mut n := e.node(ni)
n.typ = typ
n.children = nodes
return ni
}
pub fn (mut e Program) add(typ NodeStatement, nodes []NodeIndex) NodeIndex {
return e.add_name(typ, '?', nodes)
}
pub fn (mut e Program) add_operation(name string) NodeIndex {
ni := e.new_node(name)
mut n := e.node(ni)
n.typ = ._operation
return ni
}
pub fn (mut e Program) add_block(addr string) NodeIndex {
ni := e.new_node(addr)
mut n := e.node(ni)
n.typ = ._block
return ni
}
pub fn (mut e Program) add_goto(addr string) NodeIndex {
ni := e.new_node(addr)
mut n := e.node(ni)
n.typ = ._goto
return ni
}
pub fn (mut e Program) add_return(arg string) NodeIndex {
ni := e.new_node(arg)
mut n := e.node(ni)
n.typ = ._return
return ni
}
pub fn (mut e Program) add_label(addr string) NodeIndex {
ni := e.new_node(addr)
mut n := e.node(ni)
n.typ = ._label
return ni
}
pub fn (mut e Program) add_number(addr u64) NodeIndex {
ni := e.new_node('$addr')
mut n := e.node(ni)
n.typ = ._number
return ni
}
pub fn (mut e Program) add_argument(addr u64, name string) NodeIndex {
ni := e.new_node('$name')
mut n := e.node(ni)
n.typ = ._argument
return ni
}
pub fn (mut e Program) add_symbol(addr u64, name string) NodeIndex {
ni := e.new_node('$name')
mut n := e.node(ni)
n.typ = ._symbol
return ni
}
pub fn (mut e Program) add_string(addr u64, name string) NodeIndex {
ni := e.new_node('$name')
mut n := e.node(ni)
n.typ = ._string
return ni
}
pub fn (mut e Program) new_local(addr u64, name string) NodeIndex {
ni := e.new_node('$name')
mut n := e.node(ni)
n.typ = ._local
// f := e.node(e.state().in_function)
return ni
}
pub fn (mut e Program) new_node(name string) NodeIndex {
mut n := &Node{}
n.parent = e.state().last_node
n.name = name
n.addr = e.pc()
n.pos = e.state().pos
e.ast.nodes << n
return e.ast.nodes.len - 1
}
pub fn (mut e Program) node(n int) &Node {
return &e.ast.nodes[n]
}
// XXX not working as expected
pub fn (mut e Program) del_child(n int, c int) {
if n < 0 || n >= e.ast.nodes.len {
return
}
for i, _ in e.node(n).children {
cn := e.node(n).children[int(i)]
if cn == c {
eprintln('$cn vs $c')
mut nn := e.node(n)
if nn.children.len < 1 {
eprintln('delete')
// nn.children.delete(idx)
}
// dump(e.node(e.ast.nodes[n].children)
// break
}
}
}
pub fn (mut e Program) add_child(n int, c int) {
e.ast.nodes[n].children << c
}
pub fn (mut e Program) new_node_condition(name string, a int, b int) {
}
+347
View File
@@ -0,0 +1,347 @@
module east
/*
struct EsilOperation {
name string
}
*/
type EsilOperationCallback = fn (e Program) bool
struct EsilOperation {
mut:
cb EsilOperationCallback
}
enum EsilType {
number
register
command
}
struct EsilState {
mut:
// esil
pos int
last_node int
tokens []string
}
struct East {
pub mut:
// ast
nodes []Node
in_function int
find_type NodeStatement
}
pub interface R2PipeInterface {
cmd(a string) string
}
// TODO: rename to Program
struct Program {
a int
r2 R2PipeInterface
mut:
deep int
stack []string
stack_index []NodeIndex
states []EsilState
ops map[string]EsilOperation
// codegen
ast East
indent_level int
}
pub fn new_program(r2 R2PipeInterface) Program {
mut e := Program{0, r2, 0, []string{}, []NodeIndex{}, []EsilState{}, map[string]EsilOperation{}, East{}, 0}
// XXX unused ops
e.ops['+'] = EsilOperation{fn (e Program) bool {
// pop 2
println('add')
return true
}}
e.ops['-'] = EsilOperation{fn (e Program) bool {
// pop 2
println('sub')
return true
}}
return e
}
pub fn (mut e Program) load_instruction(ni NodeIndex, addr string, expr string) NodeIndex {
// add label
return e.eval(ni, expr)
}
pub fn (mut program Program) new_statement(addr string, esil string) NodeIndex {
block := program.add_name(._block, addr, [])
program.add_child(block, program.add_name(._comment, esil, []))
program.add_child(block, program.add_label(addr))
return program.load_instruction(block, addr, esil)
}
pub fn (mut e Program) new_function(name string, statements []NodeIndex) NodeIndex {
return e.add_name(._function, name, statements)
}
pub fn (mut e Program) load_function(name string) NodeIndex {
e.load_at(name)
mut statements := []NodeIndex{}
for expr in e.r2.cmd('pief').split('\n') {
addr := expr.split(' ')
esil := if addr.len > 1 { addr[1] } else { '' }
statements << e.new_statement(addr[0], esil)
}
return e.new_function(name, statements)
}
pub fn (mut e Program) load_function2(name string) NodeIndex {
mut statements := []NodeIndex{}
e.load_at(name)
bbs := e.r2.cmd('afb@$name').trim_space()
for bb in bbs.split('\n') {
bbw := bb.split(' ')
addr := bbw[0]
mut addr_j := ''
mut addr_f := ''
for j in 0 .. bbw.len {
if bbw[j] == 'j' {
addr_j = bbw[j + 1]
}
if bbw[j] == 'f' {
addr_f = bbw[j + 1]
}
}
println('$addr -> $addr_j -> $addr_f ')
ni := e.add_block(addr)
if addr_j == '' {
// return basic block
e.add_child(ni, e.add_return(''))
} else if addr_f == '' {
// only true jump
e.add_child(ni, e.add_goto(addr_j))
} else {
// have true and false jumps
e.add_child(ni, e.add_goto(addr_j))
e.add_child(ni, e.add_goto(addr_f))
}
statements << ni
}
eprintln(statements)
return e.new_function(name, statements)
}
pub fn (mut e Program) load_at(a string) bool {
e.r2.cmd('aeim;ar0;aei')
e.r2.cmd('s $a;af;aepc $$')
return true
}
pub fn (mut e Program) is_operation(op string) ?EsilOperation {
if op in e.ops {
return e.ops[op]
}
return error('no op')
}
pub fn (mut e Program) step() bool {
expr := e.r2.cmd('aoeq@r:PC')
for tok in expr.split(',') {
println('$tok')
op := e.is_operation(tok) or {
eprintln('oops')
eprintln(err)
break
}
eprintln(op)
}
e.r2.cmd('ar PC=PC+\$l@r:PC')
// e.r2.cmd('aes')
return true
}
pub fn (mut e Program) expr(addr string) string {
return e.r2.cmd('aoeq@$addr').trim_space()
}
pub fn (mut e Program) find_type() EsilType {
s := e.state().tokens[e.state().pos]
// b := if s.len > 0 { s[0] } else { 0 }
if s != '' && s[0] >= `0` && s[0] <= `9` {
return .number
}
return match s {
'+', '-' {
.command
}
else {
.register
}
}
}
pub fn (mut e Program) find_statement_type() NodeStatement {
s := e.state().tokens[e.state().pos]
// b := if s.len > 0 { s[0] } else { 0 }
if s != '' && s[0] >= `0` && s[0] <= `9` {
return ._number
}
return match s {
'+', '+=', '!', '-', '|', '&', '&=', '-=', '*', '*=', '/', '%', '^', '^=', '<<', '>>',
'<<<', '<<<<', '>>>', '>>>>' {
._operation
}
'=[8]', '=[4]', '=[2]', '=[1]' {
._operation
}
'[8]', '[4]', '[2]', '[1]' {
._assign
}
'=', ':=' {
._assign
}
'GOTO' {
._goto
}
'==', '!=' {
._condition
}
else {
._symbol
}
}
}
pub fn (mut e Program) push_state() {
e.states << EsilState{}
}
pub fn (mut e Program) pop_state() {
e.states.pop()
}
pub fn (mut e Program) pop_index() NodeIndex {
if e.stack_index.len == 0 {
return 0
}
return e.stack_index.pop()
}
pub fn (mut e Program) pop() string {
if e.stack.len == 0 {
return ''
}
return e.stack.pop()
}
pub fn (mut e Program) push_index(s NodeIndex) {
e.stack_index << s
}
pub fn (mut e Program) push(s string) {
e.stack << s
}
pub fn (mut e Program) state() &EsilState {
if e.states.len == 0 {
e.push_state()
}
return &e.states[e.states.len - 1]
}
pub fn (mut e Program) eval(ni NodeIndex, esil string) NodeIndex {
e.push_state()
e.state().pos = 0
e.stack = []
e.state().tokens = esil.split(',')
pc := e.pc().u64()
for pos in 0 .. e.state().tokens.len {
e.state().pos = pos
// create node for token nth
node := e.cur_node()
// dump(node)
match node.typ {
._operation {
if false {
dst := e.pop_index()
src := e.pop_index()
// pc := '${e.pc()}.$e.state().pos'.u64()
eqop := e.add_name(._operation, node.name, [
dst,
src,
])
// e.add_symbol(pc, dst), e.add_symbol(pc, src), ])
e.add_child(ni, eqop)
} else {
dst := e.pop()
src := e.pop()
// pc := '${e.pc()}.$e.state().pos'.u64()
eqop := e.add_name(._operation, node.name, [
e.add_symbol(pc, dst),
e.add_symbol(pc, src),
])
// e.add_symbol(pc, dst), e.add_symbol(pc, src), ])
e.add_child(ni, eqop)
}
}
._condition {}
._assign {
dst := e.pop()
src := e.pop()
// eprintln('assign $src $dst')
if false {
_ := e.add_name(._register, dst, [])
_ := e.add_name(._register, src, [])
var_res := e.new_local(4, 'res')
var_rus := e.new_local(4, 'rus')
res_byebye := e.add(._assign, [var_res, var_rus])
e.add_child(ni, res_byebye)
}
eqop := e.add(._assign, [
e.add_symbol(pc, dst),
e.add_symbol(pc, src),
])
e.add_child(ni, eqop)
}
._symbol {
//
e.push(node.name)
e.push_index(pos)
}
._goto {
// process and convert
}
._number {
//
e.push(node.name)
e.push_index(pos)
}
else {
eprintln('unk $node.name')
}
}
// dump(node)
e.state().pos++
}
e.pop_state()
return ni
}
pub fn (mut e Program) cur_node() &Node {
mut n := &Node{}
n.typ = e.find_statement_type()
/*
e.state().push('')
e.state().pop()
*/
n.addr = e.pc()
n.pos = e.state().pos
n.name = e.state().tokens[n.pos]
return n
}
pub fn (e Program) pc() string {
return e.r2.cmd('ar?PC').trim_space()
}
+28
View File
@@ -0,0 +1,28 @@
module east
pub fn (mut e Program) optimize(ni NodeIndex) {
// run different levels of optimizations starting on given node
// this function must replicate the code in print() to walk the ast
// and find optimizations and modify the ast accordingly
e.optimize_const(ni)
// e.optimize_empty(ni)
}
pub fn (mut e Program) optimize_const(ni NodeIndex) {
// propagate constant values and fold unnecessary nodes
}
pub fn (mut e Program) optimize_empty(ni NodeIndex) {
mut n := e.node(ni)
mut children := []NodeIndex{}
for c in n.children {
cn := e.node(c)
if cn.children.len >= 0 {
e.del_child(ni, c)
// children << c
children << c
}
// e.optimize_empty(c)
}
n.children = children
}
+265
View File
@@ -0,0 +1,265 @@
module east
pub fn (mut e Program) str() string {
return e.str_node(0)
}
pub fn (mut e Program) incdent(inc int) {
e.indent_level += inc
}
pub fn (mut e Program) indent() string {
mut s := []string{}
for _ in 0 .. e.indent_level {
s << ''
}
return s.join(' ')
}
pub fn (mut e Program) str_args(idx int) string {
e.ast.find_type = ._argument
s := e.str_code(idx)
e.ast.find_type = ._none
return s.trim_space().split('\n').join(', ')
}
pub fn (mut e Program) str_locals(idx int) string {
e.ast.find_type = ._local
s := e.str_code(idx)
e.ast.find_type = ._none
return s
}
pub fn (mut e Program) str_code(idx int) string {
e.deep++
if e.deep > 10 {
eprintln('yamete kudasai')
e.deep--
return ''
}
mut s := []string{}
n := e.node(idx)
typ := e.ast.find_type
match n.typ {
._call {
sym := e.str_code(n.children[0]).trim_space()
arg := e.str_code(n.children[1]).trim_space()
if typ == ._none {
// s << e.indent()
s << '$sym ($arg)'
} else {
s << sym
s << arg
}
}
._block {
if n.children.len == 0 {
// nothing
} else if typ == ._none {
s << '{\n'
e.incdent(2)
for c in n.children {
e.indent()
s << e.str_code(c) + '\n'
}
e.incdent(-2)
s << e.indent() + '}\n'
} else {
for c in n.children {
s << e.str_code(c)
}
}
}
._function {
if typ == ._none {
args := e.str_args(idx)
s << 'fn ${n.name}($args) {\n'
e.incdent(2)
mut locals := []string{}
for loc in e.str_locals(idx).split('\n') {
if loc !in locals {
if loc != '' {
// TODO: use r2 to resolve type for this variable
locals << loc
}
}
}
for loc in locals {
s << e.indent()
s << 'var $loc\n'
}
for c in n.children {
s << e.indent()
s << e.str_code(c) + '\n'
}
e.incdent(-2)
s << '}\n'
} else {
for c in n.children {
s << e.str_code(c)
}
}
}
._if {
if typ == ._none {
s << 'if '
s << e.str_code(n.children[0])
s << ' {\n'
e.incdent(2)
s << e.str_code(n.children[1])
if n.children.len > 2 {
// TODO: handle else if
e.incdent(-2)
s << e.indent()
s << '} else {\n'
e.incdent(2)
s << e.str_code(n.children[2])
e.incdent(-2)
s << e.indent()
s << '}\n'
} else {
e.incdent(-2)
s << e.indent()
s << '}\n'
}
} else {
s << e.str_code(n.children[0])
s << e.str_code(n.children[1])
if n.children.len > 2 {
s << e.str_code(n.children[2])
}
}
}
._comment {
if typ == ._none {
if n.name != '' {
s << e.indent()
s << '// $n.name '
}
}
}
._operation {
if typ == ._none {
s << e.indent()
if _ := n.name.index('=') {
s << e.str_code(n.children[0])
s << ' $n.name '
s << 'tmp'
} else {
s << 'tmp = '
s << e.str_code(n.children[0])
s << ' $n.name '
// nn := e.node(n.children[1])
// s << ' ($nn) '
dos := e.str_code(n.children[1])
if dos == '' {
s << 'tmp'
} else {
s << dos
}
}
}
}
._condition {
if typ != ._none {
for c in n.children {
s << e.str_code(c)
}
} else {
s << '('
for c in n.children {
s << e.str_code(c).trim_space()
}
s << ')'
}
}
._while {
if typ == ._none {
s << 'while $n.name {\n'
e.incdent(2)
for c in n.children {
s << e.indent()
s << e.str_code(c) + '\n'
}
e.incdent(-2)
s << '}\n'
} else {
for c in n.children {
s << e.str_code(c)
}
}
}
._argument {
if typ == ._none || typ == ._argument {
s << '$n.name\n'
}
}
._assign {
if typ == ._none {
s << e.indent()
s << e.str_code(n.children[0]).trim_space()
s << ' = '
s << e.str_code(n.children[1]).trim_space()
} else {
s << e.str_code(n.children[0])
s << e.str_code(n.children[1])
}
}
._register, ._symbol {
if typ == ._none {
s << '$n.name'
}
}
._number {
if typ == ._none {
s << '$n.name'
}
}
._label {
if typ == ._none && n.name != '' {
s << e.indent() + '$n.name:\n'
}
}
._string {
if typ == ._none {
s << '"$n.name"'
}
}
._local {
if typ == ._none || typ == ._local {
name := '$n.name\n'
if name !in s {
s << name
}
}
}
else {
// eprintln('Unhandled node $n')
}
}
e.deep--
return s.join('')
}
pub fn (mut e Program) str_node(idx int) string {
n := e.node(idx)
mut s := []string{}
/*
s << 'node_name: $n.name\n'
for c in n.children {
s << '- $c\n'
}
s << '## Nodes\n'
for c in e.state().nodes {
s << '- $c\n'
}
s << '## Decompilation\n'
*/
if n.typ == ._function {
//
s << e.str_code(idx)
} else {
eprintln('We can only start decompiling from a function')
}
return s.join('')
}
+194
View File
@@ -0,0 +1,194 @@
import east
import os
import cli { Command, Flag }
import radare.r2pipe
struct Options {
esil string
file string
arch string
}
fn pdvtool() Options {
mut cmd := Command{
name: 'east'
description: 'esil-ast based decompiler on top of r2'
version: '0.0.1'
}
cmd.add_flag(Flag{
flag: .string
name: 'file'
abbrev: 'f'
description: 'program file to open'
})
cmd.add_flag(Flag{
flag: .string
name: 'esil'
abbrev: 'e'
description: 'esil expression to decompile'
})
/*
mut test_cmd := Command{
name: 'test'
description: 'decompile an esil expression'
}
cmd.add_command(test_cmd)
*/
cmd.setup()
cmd.parse(os.args)
if os.args.len == 1 {
exit(1)
}
mut arch := ''
if e := cmd.flags.get_string('arch') {
if e != '' {
arch = e
}
}
mut file := '-'
if e := cmd.flags.get_string('file') {
if e != '' {
file = e
}
}
mut esil := ''
if e := cmd.flags.get_string('esil') {
if e != '' {
esil = e
}
}
return Options{
arch: arch
esil: esil
file: file
}
}
fn main() {
mut opt := pdvtool()
println(opt)
if opt.esil != '' {
main_hello(opt)
} else {
main_hello(opt)
main_hello2()
main_hello3()
}
}
fn main_hello(opt Options) {
r2 := r2pipe.spawn(opt.file, '') or {
eprintln('r2pipe.spawn: $err')
exit(1)
}
if opt.arch != '' {
r2.cmd('e asm.arch=$opt.arch')
}
esil := if opt.esil == '' { '1,eax,:=' } else { opt.esil }
mut program := east.new_program(r2)
mut statements := []east.NodeIndex{}
statements << program.new_statement('0x1000', esil)
mut function := program.new_function('test', statements)
kode := program.str_node(function)
println(kode)
}
fn main_hello2() {
r2 := r2pipe.spawn('test/bins/hello', '') or {
eprintln('r2pipe.spawn: $err')
exit(1)
}
mut program := east.new_program(r2)
func := program.load_function('main')
// test adding node
{
var_res := program.new_local(4, 'res')
var_rus := program.new_local(4, 'rus')
res_byebye := program.add(._assign, [var_res, var_rus])
program.add_child(func, res_byebye)
}
kode := program.str_node(func)
println(kode)
exit(0)
}
fn main_hello3() {
r2 := r2pipe.spawn('test/bins/hello', '') or {
eprintln('r2pipe.spawn: $err')
exit(1)
}
mut e := east.new_program(r2)
// e.on('reg_read', fn (name) => { if name == 'PC' { } })
/*
e.add_symbol('esi', 'arg0')
e.add_symbol('rsi', 'arg0')
e.add_symbol('esi', 'arg1')
e.add_symbol('rsi', 'arg1')
if s := e.find_symbol('rsi') {
println('arg0 is accessed')
// e.propagate_symbol()
}
*/
for _ in 0 .. 10 {
pc := e.pc()
e.step()
expr := e.expr(pc)
e.eval(0, expr)
eprintln('before($pc) now($e.pc()) $expr')
}
/*
e.add_type('int', 'int')
e.add_type('hello_t', 'struct { int msg; }')
*/
sym_puts := e.add_symbol(0x808080, 'puts')
sym_win := e.add_string(0, 'win')
sym_fail := e.add_string(0, 'fail')
cn_bb_true := e.add(._block, [
e.add(._call, [sym_puts, sym_win]),
])
cn_bb_false := e.add(._block, [
e.add(._call, [sym_puts, sym_fail]),
])
arg_argc := e.add_argument(0, 'argc')
cn_cmp := e.add(._condition, [
arg_argc,
e.add_operation('<'),
e.add_number(10),
])
ifelse := e.add(._if, [
cn_cmp,
cn_bb_true,
cn_bb_false,
])
sym_byebye := e.add_string(0, 'byebye')
call_byebye := e.add(._call, [sym_puts, sym_byebye])
var_res := e.new_local(4, 'tmp')
res_byebye := e.add(._assign, [var_res, call_byebye])
sym_exit := e.add_symbol(0, 'exit')
call_exit := e.add(._call, [sym_exit, var_res])
n_func := e.add(._function, [
ifelse,
res_byebye,
call_exit,
])
e.node(n_func).name = 'main'
// optimize function
e.optimize(n_func)
code := e.str_node(n_func)
println(code)
r2.cmd('q')
}
+75
View File
@@ -0,0 +1,75 @@
module pdv
import east
import json
import radare.r2
struct R2ijcore {
file string
size int
fd int
}
struct R2ij {
core R2ijcore
}
pub struct RCore {}
fn plugin_call(coreptr voidptr, cmd &char) int {
// eprintln('cal')
core := r2.cast(coreptr)
c := unsafe { cmd.vstring() }
if c.starts_with('pdv') {
core.cmd('?E decompiler not yet integrated')
ij := core.cmd('ij')
a := json.decode(R2ij, ij) or {
eprintln('failed to decode ij JSON')
return 0
}
eprintln(a.core.file)
//
r2p := r2.cast(core)
mut e := east.new_program(r2p)
fname := r2p.cmd('afi.')
if fname.len > 0 {
func := e.load_function(fname)
e.optimize(func)
kode := e.str_node(func)
println(kode)
} else {
eprintln('No function?')
}
// e.free ()
return 1
}
return 0
}
// definition
// ignored
[export: 'radare_plugin_function']
[manual_free]
fn radare_plugin_function() &C.r_lib_struct_t {
pdv_plugin := &C.r_core_plugin_t{
name: 'pdv'.str
desc: 'the v decompiler for r2'.str
license: 'MIT'.str
call: plugin_call
}
unsafe {
pp := C.malloc(1024) // too large
C.memcpy(pp, pdv_plugin, 1024)
p := &C.r_lib_struct_t{
@type: C.R_LIB_TYPE_CORE
data: pp // &pdv_plugin
pkgname: 'pdv'.str
}
ppp := C.malloc(1024) // too large
C.memcpy(ppp, p, 1024)
return ppp
}
// C.fprintf(C.stderr, '%p\n'.str, p)
// return p
}
BIN
View File
Binary file not shown.
+19
View File
@@ -0,0 +1,19 @@
#include <stdio.h>
void fn_hello(void) {
puts ("Hello World");
}
int fn_ifelse(int argc) {
if (argc < 3) {
puts ("one");
return 1;
}
return 0;
}
int main(int argc) {
fn_hello ();
int res = fn_ifelse (argc);
return res;
}
BIN
View File
Binary file not shown.
+9
View File
@@ -0,0 +1,9 @@
Module {
name: 'east'
description: 'An ESIL-based decommpiler for r2 written in V'
version: '0.1.0'
author: 'pancake'
license: 'MIT'
repo_url: 'https://github.com/vlang/v'
dependencies: ['radare.r2', 'radare.r2pipe']
}
+1 -1
View File
@@ -1,5 +1,5 @@
NAME=mycpu
R2_PLUGIN_PATH=$(shell r2 -hh|grep LIBR_PLUGINS|awk '{print $$2}')
R2_PLUGIN_PATH=$(shell r2 -hh|grep R2_LIBR_PLUGINS|awk '{print $$2}')
CFLAGS=-g -fPIC $(shell pkg-config --cflags r_asm)
LDFLAGS=-shared $(shell pkg-config --libs r_asm)
OBJS=$(NAME).o
+5 -5
View File
@@ -30,10 +30,10 @@ static int disassemble (RAsm *a, RAsmOp *op, const ut8 *b, int l) {
int idx = (b[0]&0xf)*2;
op->size = 2;
if (idx>=(OPS*2)) {
strcpy (op->buf_asm, "invalid");
r_strbuf_set (&op->buf_asm, "invalid");
return -1;
}
strcpy (op->buf_asm, ops[idx]);
r_strbuf_set (&op->buf_asm, ops[idx]);
if (ops[idx+1]) {
const char *p = ops[idx+1];
arg[0] = 0;
@@ -50,8 +50,8 @@ static int disassemble (RAsm *a, RAsmOp *op, const ut8 *b, int l) {
sprintf (arg, "r%d, %d", b[1]>>4, (char)b[1]&0xf);
}
if (*arg) {
strcat (op->buf_asm, " ");
strcat (op->buf_asm, arg);
r_strbuf_append (&op->buf_asm, " ");
r_strbuf_append (&op->buf_asm, arg);
}
}
return op->size;
@@ -67,7 +67,7 @@ RAsmPlugin r_asm_plugin_mycpu = {
};
#ifndef CORELIB
struct r_lib_struct_t radare_plugin = {
RLibStruct radare_plugin = {
.type = R_LIB_TYPE_ASM,
.data = &r_asm_plugin_mycpu
};
+29
View File
@@ -0,0 +1,29 @@
D=$(DESTDIR)/$(shell r2 -H R2_USER_PLUGINS)/iref-db
BINDIR=$(shell r2pm -H R2PM_BINDIR)
B=$(DESTDIR)/$(BINDIR)/
all:
clean:
install: user-install
user-uninstall uninstall:
rm -f "$(B)/iref"
rm -rf "$(D)"
user-install:
mkdir -p "$(B)"
cp iref.sh $(B)/iref
chmod +x $(B)/iref
mkdir -p "$(D)"
tar xJvf iref-db.txz -C $(D)
sync: cutterref
rm -rf iref-db
cd cutterref/archs && tar cJvf ../../iref-db.txz *.sql
cutterref:
git clone https://github.com/yossizap/cutterref
.PHONY: sync all install user-install user-uninstall uninstall clean
+24
View File
@@ -0,0 +1,24 @@
iref
====
This is a commandline version of the cutterref tool.
Installation
------------
```
$ r2pm -ci iref
```
Usage
-----
See this video demo: [https://youtu.be/jne9e_kBS8E](https://youtu.be/jne9e_kBS8E)
```
$ r2 /bin/ls
> "$a=!!iref x86-64 `ao~mnemonic[1]`"
> $a
> !iref x86-64 nop
```
BIN
View File
Binary file not shown.
+28
View File
@@ -0,0 +1,28 @@
#!/bin/sh
A="$1"
M="`echo $2 |tr '[a-z]' '[A-Z]'`"
R2_USER_PLUGINS=$(r2 -H R2_USER_PLUGINS)
if [ -z "$A" ]; then
echo "Usage: iref [arch] ([insn])"
if [ ! -d iref-db ]; then
cd "$R2_USER_PLUGINS" || exit 1
fi
cd iref-db
ls |sed -e 's,.sql,,'
exit 1
fi
if [ ! -f "iref-db/$A.sql" ]; then
cd "$R2_USER_PLUGINS" || exit 1
if [ ! -f "iref-db/$A.sql" ]; then
echo "Cannot load $A"
exit 1
fi
fi
if [ -z "$M" ]; then
echo "select mnem from instructions" | sqlite3 -init iref-db/$A.sql | tr 'A-Z' 'a-z'
else
echo "select description from instructions where mnem = '$M'" | sqlite3 -init iref-db/$A.sql
fi
+21
View File
@@ -0,0 +1,21 @@
NAME=jaguar-gpu
R2_PLUGIN_PATH=$(shell r2 -hh|grep R2_LIBR_PLUGINS|awk '{print $$2}')
CFLAGS=-g -fPIC $(shell pkg-config --cflags r_asm)
LDFLAGS=-shared $(shell pkg-config --libs r_asm)
OBJS=$(NAME).o
SO_EXT=$(shell uname|grep -q Darwin && echo dylib || echo so)
LIB=$(NAME).$(SO_EXT)
all: $(LIB)
clean:
rm -f $(LIB) $(OBJS)
$(LIB): $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $(LIB)
install:
cp -f $(LIB) $(R2_PLUGIN_PATH)
uninstall:
rm -f $(R2_PLUGIN_PATH)/$(LIB)
+222
View File
@@ -0,0 +1,222 @@
/*
* Disassembler for the Jaguar GPU/DSP
* Copyright (C) 2018 - Sebastien Alaiwan
*/
#include <r_asm.h>
#include <r_lib.h>
static int read16_BE (const ut8** b)
{
int val = ((*b)[0] << 8) | ((*b)[1] << 0);
(*b) += 2;
return val;
}
static const char* condition (int code)
{
switch (code)
{
case 0: return "mp"; /* always */
case 1: return "nz";
case 2: return "z";
case 4: return "nc";
case 5: return "nc/nz";
case 6: return "nc/z";
case 8: return "c";
case 9: return "c/nz";
case 10: return "c/z";
case 20: return "nn";
case 21: return "nn/nz";
case 22: return "nn/z";
case 24: return "n";
case 25: return "n/nz";
case 26: return "n/z";
case 31: return "never";
default: return "?";
}
};
static int notZero (int val)
{
return val == 0 ? 32 : val;
}
static int disassemble (RAsm *a, RAsmOp *op, const ut8 *b, int l) {
const ut8* p = b; /* read pointer */
const uint word = read16_BE (&p);
const uint opCode = (word >> 10) & 63;
const uint reg1 = (word >> 5) & 31;
const uint reg2 = (word >> 0) & 31;
uint pc = a->pc;
pc += 2;
switch (opCode)
{
case 0: r_strbuf_setf (&op->buf_asm, "add r%d, r%d", reg1, reg2);
break;
case 1: r_strbuf_setf (&op->buf_asm, "addc r%d, r%d", reg1, reg2);
break;
case 2: r_strbuf_setf (&op->buf_asm, "addq 0x%x, r%d", notZero (reg1), reg2);
break;
case 3: r_strbuf_setf (&op->buf_asm, "addqt 0x%x, r%d", notZero (reg1), reg2);
break;
case 4: r_strbuf_setf (&op->buf_asm, "sub r%d, r%d", reg1, reg2);
break;
case 5: r_strbuf_setf (&op->buf_asm, "subc r%d, r%d", reg1, reg2);
break;
case 6: r_strbuf_setf (&op->buf_asm, "subq 0x%x, r%d", notZero (reg1), reg2);
break;
case 7: r_strbuf_setf (&op->buf_asm, "subqt 0x%x, r%d", notZero (reg1), reg2);
break;
case 8: r_strbuf_setf (&op->buf_asm, "neg r%d", reg2);
break;
case 9: r_strbuf_setf (&op->buf_asm, "and r%d, r%d", reg1, reg2);
break;
case 10: r_strbuf_setf (&op->buf_asm, "or r%d, r%d", reg1, reg2);
break;
case 11: r_strbuf_setf (&op->buf_asm, "xor r%d, r%d", reg1, reg2);
break;
case 12: r_strbuf_setf (&op->buf_asm, "not r%d", reg2);
break;
case 13: r_strbuf_setf (&op->buf_asm, "btst 0x%x, r%d", reg1, reg2);
break;
case 14: r_strbuf_setf (&op->buf_asm, "bset 0x%x, r%d", reg1, reg2);
break;
case 15: r_strbuf_setf (&op->buf_asm, "bclr 0x%x, r%d", reg1, reg2);
break;
case 16: r_strbuf_setf (&op->buf_asm, "mult r%d, r%d", reg1, reg2);
break;
case 17: r_strbuf_setf (&op->buf_asm, "imult r%d, r%d", reg1, reg2);
break;
case 18: r_strbuf_setf (&op->buf_asm, "imultn r%d, r%d", reg1, reg2);
break;
case 19: r_strbuf_setf (&op->buf_asm, "resmac r%d", reg2);
break;
case 20: r_strbuf_setf (&op->buf_asm, "imacn r%d, r%d", reg1, reg2);
break;
case 21: r_strbuf_setf (&op->buf_asm, "div r%d, r%d", reg1, reg2);
break;
case 22: r_strbuf_setf (&op->buf_asm, "abs r%d", reg2);
break;
case 23: r_strbuf_setf (&op->buf_asm, "sh r%d, r%d", reg1, reg2);
break;
case 24: r_strbuf_setf (&op->buf_asm, "shlq 0x%x, r%d", 32 - notZero (reg1), reg2);
break;
case 25: r_strbuf_setf (&op->buf_asm, "shrq 0x%x, r%d", notZero (reg1), reg2);
break;
case 26: r_strbuf_setf (&op->buf_asm, "sha r%d, r%d", reg1, reg2);
break;
case 27: r_strbuf_setf (&op->buf_asm, "sharq 0x%x, r%d", notZero (reg1), reg2);
break;
case 28: r_strbuf_setf (&op->buf_asm, "ror r%d, r%d", reg1, reg2);
break;
case 29: r_strbuf_setf (&op->buf_asm, "rorq 0x%x, r%d", notZero (reg1), reg2);
break;
case 30: r_strbuf_setf (&op->buf_asm, "cmp r%d, r%d", reg1, reg2);
break;
case 31: r_strbuf_setf (&op->buf_asm, "cmpq 0x%x, r%d", reg1, reg2);
break;
case 32: r_strbuf_setf (&op->buf_asm, "sat8 r%d", reg2);
break;
case 33: r_strbuf_setf (&op->buf_asm, "sat16 r%d", reg2);
break;
case 34: r_strbuf_setf (&op->buf_asm, "move r%d, r%d", reg1, reg2);
break;
case 35: r_strbuf_setf (&op->buf_asm, "moveq 0x%x, r%d", reg1, reg2);
break;
case 36: r_strbuf_setf (&op->buf_asm, "moveta r%d, r%d", reg1, reg2);
break;
case 37: r_strbuf_setf (&op->buf_asm, "movefa r%d, r%d", reg1, reg2);
break;
case 38:
{
uint low = read16_BE (&p);
uint high = read16_BE (&p);
r_strbuf_setf (&op->buf_asm, "movei 0x%x, r%d", low | (high << 16), reg2);
break;
}
case 39: r_strbuf_setf (&op->buf_asm, "loadb [r%d], r%d", reg1, reg2);
break;
case 40: r_strbuf_setf (&op->buf_asm, "loadw [r%d], r%d", reg1, reg2);
break;
case 41: r_strbuf_setf (&op->buf_asm, "load [r%d], r%d", reg1, reg2);
break;
case 42: r_strbuf_setf (&op->buf_asm, "loadp [r%d], r%d", reg1, reg2);
break;
case 43: r_strbuf_setf (&op->buf_asm, "load [r14+0x%x], r%d", notZero (reg1)*4, reg2);
break;
case 44: r_strbuf_setf (&op->buf_asm, "load [r15+0x%x], r%d", notZero (reg1)*4, reg2);
break;
case 45: r_strbuf_setf (&op->buf_asm, "storeb r%d, [r%d]", reg2, reg1);
break;
case 46: r_strbuf_setf (&op->buf_asm, "storew r%d, [r%d]", reg2, reg1);
break;
case 47: r_strbuf_setf (&op->buf_asm, "store r%d, [r%d]", reg2, reg1);
break;
case 48: r_strbuf_setf (&op->buf_asm, "storep r%d, [r%d]", reg2, reg1);
break;
case 49: r_strbuf_setf (&op->buf_asm, "store r%d, [r14+0x%x]", reg2, notZero (reg1)*4);
break;
case 50: r_strbuf_setf (&op->buf_asm, "store r%d, [r15+0x%x]", reg2, notZero (reg1)*4);
break;
case 51: r_strbuf_setf (&op->buf_asm, "move pc, r%d", reg2);
break;
case 52: r_strbuf_setf (&op->buf_asm, "j%s [r%d]", condition(reg2), reg1);
break;
case 53: r_strbuf_setf (&op->buf_asm, "j%s 0x%.8X", condition(reg2), pc + ((int8_t)(reg1 << 3) >> 2));
break;
case 54: r_strbuf_setf (&op->buf_asm, "mmult r%d, r%d", reg1, reg2);
break;
case 55: r_strbuf_setf (&op->buf_asm, "mtoi r%d, r%d", reg1, reg2);
break;
case 56: r_strbuf_setf (&op->buf_asm, "normi r%d, r%d", reg1, reg2);
break;
case 57: r_strbuf_setf (&op->buf_asm, "nop");
break;
case 58: r_strbuf_setf (&op->buf_asm, "load [r14+r%d], r%d", reg1, reg2);
break;
case 59: r_strbuf_setf (&op->buf_asm, "load [r15+r%d], r%d", reg1, reg2);
break;
case 60: r_strbuf_setf (&op->buf_asm, "store r%d, [r14+r%d]", reg2, reg1);
break;
case 61: r_strbuf_setf (&op->buf_asm, "store r%d, [r15+r%d]", reg2, reg1);
break;
case 62: r_strbuf_setf (&op->buf_asm, "sat24 r%d", reg2);
break;
case 63:
{
if (reg1 == 0)
r_strbuf_setf (&op->buf_asm, "pack r%d", reg2);
else if (reg1 == 1)
r_strbuf_setf (&op->buf_asm, "unpack r%d", reg2);
else
r_strbuf_setf (&op->buf_asm, "invalid");
break;
}
}
op->size = p - b;
r_strbuf_setbin (&op->buf_hex, b, op->size);
return op->size;
}
RAsmPlugin r_asm_plugin_jaguar_gpu = {
.name = "jaguar-gpu",
.arch = "jaguar-gpu",
.author = "Sebastien Alaiwan",
.bits = 32,
.desc = "Disassembler for the Jaguar GPU",
.license = "LGPL3",
.disassemble = &disassemble,
};
#ifndef CORELIB
RLibStruct radare_plugin = {
.type = R_LIB_TYPE_ASM,
.data = &r_asm_plugin_jaguar_gpu
};
#endif
+11 -8
View File
@@ -1,8 +1,8 @@
include build.mk
PLUGINS=arm x86 mips sparc ppc hexagon sysz
PLUGINS=arm x86 mips sparc ppc hexagon s390x evm
LIBS=$(addsuffix _ks.$(SO_EXT),$(addprefix asm_,${PLUGINS}))
LIBS=$(addsuffix _ks.$(SO_EXT),$(addprefix arch_,${PLUGINS}))
#R2PM_PLUGDIR?=${LIBDIR}/radare2/last/
R2PM_PLUGDIR?=~/.config/radare2/plugins
R2PM_PREFIX?=~/.config/radare2/prefix
@@ -23,27 +23,30 @@ all: $(PLUGINS)
define kscc
$(CC) -c -fPIC -Wall\
$(R2_CFLAGS) $(KS_CFLAGS)\
-o asm_$(1)_ks.$(O_EXT) asm_$(1)_ks.c
-o arch_$(1)_ks.$(O_EXT) arch_$(1)_ks.c
$(CXX) $(LDFLAGS_SHARED)\
$(R2_LDFLAGS) $(KS_LDFLAGS)\
-o asm_$(1)_ks.$(SO_EXT) asm_$(1)_ks.$(O_EXT) $(KS_LINK)
rm asm_$(1)_ks.$(O_EXT)
-o arch_$(1)_ks.$(SO_EXT) arch_$(1)_ks.$(O_EXT) $(KS_LINK)
rm arch_$(1)_ks.$(O_EXT)
endef
define ksmake
asm_$(1)_ks.$(SO_EXT): asm_$(1)_ks.c keystone.c
arch_$(1)_ks.$(SO_EXT): arch_$(1)_ks.c keystone.c
$$(call kscc,$(1))
endef
$(foreach lib,$(PLUGINS),$(eval $(call ksmake,$(lib))))
$(PLUGINS):
$(MAKE) asm_$@_ks.$(SO_EXT)
$(MAKE) arch_$@_ks.$(SO_EXT)
install:
$(foreach lib,$(LIBS),$(INSTALL_LIB) $(lib) $(R2PM_PLUGDIR);)
uninstall:
user-install:
$(foreach lib,$(LIBS),$(INSTALL_LIB) $(lib) $(R2PM_PLUGDIR);)
user-uninstall uninstall:
rm -rf $(R2PM_PLUGDIR)/*_ks.*
test:
+46
View File
@@ -0,0 +1,46 @@
/* radare2-keystone - GPL - Copyright 2016-2023 - pancake */
#include <r_arch.h>
#include <r_lib.h>
#include <keystone/keystone.h>
#include <keystone/arm.h>
#include "keystone.c"
static bool assemble(RArchSession *a, RAnalOp *ao, RArchEncodeMask mask) {
ks_arch arch = KS_ARCH_ARM;
ks_mode mode = KS_MODE_ARM;
switch (a->config->bits) {
case 16:
mode = KS_MODE_THUMB;
break;
case 64:
arch = KS_ARCH_ARM64;
mode = KS_MODE_LITTLE_ENDIAN;
a->config->big_endian = false;
break;
}
if (a->config->big_endian) {
mode = (ks_mode)((int)mode | KS_MODE_BIG_ENDIAN);
}
return keystone_assemble (a, ao, ao->mnemonic, arch, mode);
}
RArchPlugin r_arch_plugin_arm_ks = {
.meta = {
.name = "arm.ks",
.desc = "ARM keystone assembler",
.license = "GPL",
},
.arch = "arm",
.bits = R_SYS_BITS_PACK3 (16, 32, 64),
.encode = &assemble,
.decode = NULL,
};
#ifndef CORELIB
RLibStruct radare_plugin = {
.type = R_LIB_TYPE_ARCH,
.data = &r_arch_plugin_arm_ks,
.version = R2_VERSION
};
#endif
+34
View File
@@ -0,0 +1,34 @@
/* radare2-keystone - GPL - Copyright 2016-2023 - pancake */
#include <r_arch.h>
#include <r_lib.h>
#include <keystone/keystone.h>
#include <keystone/evm.h>
#include "keystone.c"
static bool assemble(RArchSession *a, RAnalOp *ao, RArchEncodeMask mask) {
ks_mode mode = (ks_mode)0;
if (a->config->big_endian) {
mode = (ks_mode)((int)mode | KS_MODE_BIG_ENDIAN);
}
return keystone_assemble (a, ao, ao->mnemonic, KS_ARCH_SYSTEMZ, mode);
}
RArchPlugin r_arch_plugin_evm_ks = {
.meta = {
.name = "evm.ks",
.desc = "EVM keystone assembler",
.license = "GPL",
},
.arch = "evm",
.bits = 32,
.encode = &assemble,
};
#ifndef CORELIB
RLibStruct radare_plugin = {
.type = R_LIB_TYPE_ARCH,
.data = &r_arch_plugin_evm_ks,
.version = R2_VERSION
};
#endif
+34
View File
@@ -0,0 +1,34 @@
/* radare2-keystone - GPL - Copyright 2016 - pancake */
#include <r_arch.h>
#include <r_lib.h>
#include <keystone/keystone.h>
#include <keystone/hexagon.h>
#include "keystone.c"
static bool assemble(RArchSession *a, RAnalOp *ao, RArchEncodeMask mask) {
ks_mode mode = (ks_mode)0;
if (a->config->big_endian) {
mode = (ks_mode)((int)mode | KS_MODE_BIG_ENDIAN);
}
return keystone_assemble (a, ao, ao->mnemonic, KS_ARCH_HEXAGON, mode);
}
RArchPlugin r_arch_plugin_hexagon_ks = {
.meta = {
.name = "hexagon.ks",
.desc = "Hexagon keystone assembler",
.license = "GPL",
},
.arch = "hexagon",
.bits = 32,
.encode = &assemble,
};
#ifndef CORELIB
RLibStruct radare_plugin = {
.type = R_LIB_TYPE_ARCH,
.data = &r_arch_plugin_hexagon_ks,
.version = R2_VERSION
};
#endif
+45
View File
@@ -0,0 +1,45 @@
/* radare2-keystone - GPL - Copyright 2016-2023 - pancake */
#include <r_arch.h>
#include <r_lib.h>
#include <keystone/keystone.h>
#include <keystone/mips.h>
#include "keystone.c"
static bool assemble(RArchSession *a, RAnalOp *ao, RArchEncodeMask mask) {
ks_mode mode;
switch (a->config->bits) {
case 16:
mode = KS_MODE_MICRO; // micromips mode
break;
case 32:
mode = KS_MODE_MIPS32;
break;
case 64:
mode = KS_MODE_MIPS64;
break;
}
if (a->config->big_endian) {
mode = (ks_mode)((int)mode | KS_MODE_BIG_ENDIAN);
}
return keystone_assemble (a, ao, ao->mnemonic, KS_ARCH_MIPS, mode);
}
RArchPlugin r_arch_plugin_mips_ks = {
.meta = {
.name = "mips.ks",
.desc = "MIPS keystone assembler",
.license = "GPL",
},
.arch = "mips",
.bits = R_SYS_BITS_PACK3 (16, 32, 64),
.encode = &assemble,
};
#ifndef CORELIB
struct r_lib_struct_t radare_plugin = {
.type = R_LIB_TYPE_ARCH,
.data = &r_arch_plugin_mips_ks,
.version = R2_VERSION
};
#endif
+42
View File
@@ -0,0 +1,42 @@
/* radare2-keystone - GPL - Copyright 2016-2023 - pancake */
#include <r_arch.h>
#include <r_lib.h>
#include <keystone/keystone.h>
#include <keystone/ppc.h>
#include "keystone.c"
static bool assemble(RArchSession *a, RAnalOp *ao, RArchEncodeMask mask) {
ks_mode mode = (ks_mode)0;
switch (a->config->bits) {
case 32:
mode = KS_MODE_PPC32;
break;
case 64:
mode = KS_MODE_PPC64;
break;
}
if (a->config->big_endian) {
mode = (ks_mode)((int)mode | KS_MODE_BIG_ENDIAN);
}
return keystone_assemble (a, ao, ao->mnemonic, KS_ARCH_PPC, mode);
}
RArchPlugin r_arch_plugin_ppc_ks = {
.meta = {
.name = "ppc.ks",
.desc = "powerpc keystone assembler",
.license = "GPL",
},
.arch = "ppc",
.bits = R_SYS_BITS_PACK2 (32,64),
.encode = &assemble,
};
#ifndef CORELIB
RLibStruct radare_plugin = {
.type = R_LIB_TYPE_ARCH,
.data = &r_arch_plugin_ppc_ks,
.version = R2_VERSION
};
#endif
+34
View File
@@ -0,0 +1,34 @@
/* radare2-keystone - GPL - Copyright 2016-2023 - pancake */
#include <r_arch.h>
#include <r_lib.h>
#include <keystone/keystone.h>
#include <keystone/systemz.h>
#include "keystone.c"
static bool assemble(RArchSession *a, RAnalOp *ao, RArchEncodeMask mask) {
ks_mode mode = (ks_mode)0;
if (a->config->big_endian) {
mode = (ks_mode)((int)mode | KS_MODE_BIG_ENDIAN);
}
return keystone_assemble (a, ao, ao->mnemonic, KS_ARCH_SYSTEMZ, mode);
}
RArchPlugin r_arch_plugin_s390x_ks = {
.meta = {
.name = "s390x.ks",
.desc = "SystemZ keystone assembler (S390X)",
.license = "GPL",
},
.arch = "s390x",
.bits = 32,
.encode = &assemble,
};
#ifndef CORELIB
RLibStruct radare_plugin = {
.type = R_LIB_TYPE_ARCH,
.data = &r_arch_plugin_s390x_ks,
.version = R2_VERSION
};
#endif
+42
View File
@@ -0,0 +1,42 @@
/* radare2-keystone - GPL - Copyright 2016 - pancake */
#include <r_arch.h>
#include <r_lib.h>
#include <keystone/keystone.h>
#include <keystone/sparc.h>
#include "keystone.c"
static bool assemble(RArchSession *a, RAnalOp *ao, RArchEncodeMask mask) {
ks_mode mode = (ks_mode)0;
switch (a->config->bits) {
case 32:
mode = KS_MODE_SPARC32;
break;
case 64:
mode = KS_MODE_SPARC64;
break;
}
if (a->config->big_endian) {
mode = (ks_mode)((int)mode | KS_MODE_BIG_ENDIAN);
}
return keystone_assemble (a, ao, ao->mnemonic, KS_ARCH_SPARC, mode);
}
RArchPlugin r_arch_plugin_sparc_ks = {
.meta = {
.name = "sparc.ks",
.desc = "sparc keystone assembler",
.license = "GPL",
},
.arch = "sparc",
.bits = R_SYS_BITS_PACK2 (32, 64),
.encode = &assemble,
};
#ifndef CORELIB
RLibStruct radare_plugin = {
.type = R_LIB_TYPE_ARCH,
.data = &r_arch_plugin_sparc_ks,
.version = R2_VERSION
};
#endif
+42
View File
@@ -0,0 +1,42 @@
/* radare2-keystone - GPL - Copyright 2016-2023 - pancake */
#include <r_arch.h>
#include <r_lib.h>
#include <keystone/keystone.h>
#include <keystone/x86.h>
#include "keystone.c"
static bool assemble(RArchSession *a, RAnalOp *ao, RArchEncodeMask mask) {
ks_mode mode = (ks_mode)0;
switch (a->config->bits) {
case 16:
mode = KS_MODE_16;
break;
case 32:
mode = KS_MODE_32;
break;
case 64:
mode = KS_MODE_64;
break;
}
return keystone_assemble (a, ao, ao->mnemonic, KS_ARCH_X86, mode);
}
RArchPlugin r_arch_plugin_x86_ks = {
.meta = {
.name = "x86.ks",
.desc = "x86 keystone assembler",
.license = "GPL",
},
.arch = "x86",
.bits = R_SYS_BITS_PACK3 (16, 32, 64),
.encode = &assemble,
};
#ifndef CORELIB
RLibStruct radare_plugin = {
.type = R_LIB_TYPE_ARCH,
.data = &r_arch_plugin_x86_ks,
.version = R2_VERSION
};
#endif
-43
View File
@@ -1,43 +0,0 @@
/* radare2-keystone - GPL - Copyright 2016 - pancake */
#include <r_asm.h>
#include <r_lib.h>
#include <keystone/keystone.h>
#include <keystone/arm.h>
#include "keystone.c"
static int assemble(RAsm *a, RAsmOp *ao, const char *str) {
ks_arch arch = KS_ARCH_ARM;
ks_mode mode = KS_MODE_ARM;
switch (a->bits) {
case 16:
mode = KS_MODE_THUMB;
break;
case 64:
arch = KS_ARCH_ARM64;
mode = KS_MODE_LITTLE_ENDIAN;
a->big_endian = false;
break;
}
if (a->big_endian) {
mode = (ks_mode)((int)mode | KS_MODE_BIG_ENDIAN);
}
return keystone_assemble (a, ao, str, arch, mode);
}
RAsmPlugin r_asm_plugin_arm_ks = {
.name = "arm.ks",
.desc = "ARM keystone assembler",
.license = "GPL",
.arch = "arm",
.bits = 16|32|64,
.assemble = &assemble,
};
#ifndef CORELIB
RLibStruct radare_plugin = {
.type = R_LIB_TYPE_ASM,
.data = &r_asm_plugin_arm_ks,
.version = R2_VERSION
};
#endif
-32
View File
@@ -1,32 +0,0 @@
/* radare2-keystone - GPL - Copyright 2016 - pancake */
#include <r_asm.h>
#include <r_lib.h>
#include <keystone/keystone.h>
#include <keystone/hexagon.h>
#include "keystone.c"
static int assemble(RAsm *a, RAsmOp *ao, const char *str) {
ks_mode mode = (ks_mode)0;
if (a->big_endian) {
mode = (ks_mode)((int)mode | KS_MODE_BIG_ENDIAN);
}
return keystone_assemble (a, ao, str, KS_ARCH_HEXAGON, mode);
}
RAsmPlugin r_asm_plugin_hexagon_ks = {
.name = "hexagon.ks",
.desc = "Hexagon keystone assembler",
.license = "GPL",
.arch = "hexagon",
.bits = 32,
.assemble = &assemble,
};
#ifndef CORELIB
struct r_lib_struct_t radare_plugin = {
.type = R_LIB_TYPE_ASM,
.data = &r_asm_plugin_hexagon_ks,
.version = R2_VERSION
};
#endif
-43
View File
@@ -1,43 +0,0 @@
/* radare2-keystone - GPL - Copyright 2016 - pancake */
#include <r_asm.h>
#include <r_lib.h>
#include <keystone/keystone.h>
#include <keystone/mips.h>
#include "keystone.c"
static int assemble(RAsm *a, RAsmOp *ao, const char *str) {
ks_mode mode;
switch (a->bits) {
case 16:
mode = KS_MODE_MICRO; // micromips mode
break;
case 32:
mode = KS_MODE_MIPS32;
break;
case 64:
mode = KS_MODE_MIPS64;
break;
}
if (a->big_endian) {
mode = (ks_mode)((int)mode | KS_MODE_BIG_ENDIAN);
}
return keystone_assemble (a, ao, str, KS_ARCH_MIPS, mode);
}
RAsmPlugin r_asm_plugin_mips_ks = {
.name = "mips.ks",
.desc = "MIPS keystone assembler",
.license = "GPL",
.arch = "mips",
.bits = 16|32|64,
.assemble = &assemble,
};
#ifndef CORELIB
struct r_lib_struct_t radare_plugin = {
.type = R_LIB_TYPE_ASM,
.data = &r_asm_plugin_mips_ks,
.version = R2_VERSION
};
#endif
-40
View File
@@ -1,40 +0,0 @@
/* radare2-keystone - GPL - Copyright 2016 - pancake */
#include <r_asm.h>
#include <r_lib.h>
#include <keystone/keystone.h>
#include <keystone/ppc.h>
#include "keystone.c"
static int assemble(RAsm *a, RAsmOp *ao, const char *str) {
ks_mode mode = (ks_mode)0;
switch (a->bits) {
case 32:
mode = KS_MODE_PPC32;
break;
case 64:
mode = KS_MODE_PPC64;
break;
}
if (a->big_endian) {
mode = (ks_mode)((int)mode | KS_MODE_BIG_ENDIAN);
}
return keystone_assemble (a, ao, str, KS_ARCH_PPC, mode);
}
RAsmPlugin r_asm_plugin_ppc_ks = {
.name = "ppc.ks",
.desc = "powerpc keystone assembler",
.license = "GPL",
.arch = "ppc",
.bits = 32|64,
.assemble = &assemble,
};
#ifndef CORELIB
struct r_lib_struct_t radare_plugin = {
.type = R_LIB_TYPE_ASM,
.data = &r_asm_plugin_ppc_ks,
.version = R2_VERSION
};
#endif
-40
View File
@@ -1,40 +0,0 @@
/* radare2-keystone - GPL - Copyright 2016 - pancake */
#include <r_asm.h>
#include <r_lib.h>
#include <keystone/keystone.h>
#include <keystone/sparc.h>
#include "keystone.c"
static int assemble(RAsm *a, RAsmOp *ao, const char *str) {
ks_mode mode = (ks_mode)0;
switch (a->bits) {
case 32:
mode = KS_MODE_SPARC32;
break;
case 64:
mode = KS_MODE_SPARC64;
break;
}
if (a->big_endian) {
mode = (ks_mode)((int)mode | KS_MODE_BIG_ENDIAN);
}
return keystone_assemble (a, ao, str, KS_ARCH_SPARC, mode);
}
RAsmPlugin r_asm_plugin_sparc_ks = {
.name = "sparc.ks",
.desc = "sparc keystone assembler",
.license = "GPL",
.arch = "sparc",
.bits = 32|64,
.assemble = &assemble,
};
#ifndef CORELIB
struct r_lib_struct_t radare_plugin = {
.type = R_LIB_TYPE_ASM,
.data = &r_asm_plugin_sparc_ks,
.version = R2_VERSION
};
#endif
-32
View File
@@ -1,32 +0,0 @@
/* radare2-keystone - GPL - Copyright 2016 - pancake */
#include <r_asm.h>
#include <r_lib.h>
#include <keystone/keystone.h>
#include <keystone/systemz.h>
#include "keystone.c"
static int assemble(RAsm *a, RAsmOp *ao, const char *str) {
ks_mode mode = (ks_mode)0;
if (a->big_endian) {
mode = (ks_mode)((int)mode | KS_MODE_BIG_ENDIAN);
}
return keystone_assemble (a, ao, str, KS_ARCH_SYSTEMZ, mode);
}
RAsmPlugin r_asm_plugin_sysz_ks = {
.name = "sysz.ks",
.desc = "SystemZ keystone assembler (S390X)",
.license = "GPL",
.arch = "sysz",
.bits = 32,
.assemble = &assemble,
};
#ifndef CORELIB
struct r_lib_struct_t radare_plugin = {
.type = R_LIB_TYPE_ASM,
.data = &r_asm_plugin_sysz_ks,
.version = R2_VERSION
};
#endif
-40
View File
@@ -1,40 +0,0 @@
/* radare2-keystone - GPL - Copyright 2016 - pancake */
#include <r_asm.h>
#include <r_lib.h>
#include <keystone/keystone.h>
#include <keystone/x86.h>
#include "keystone.c"
static int assemble(RAsm *a, RAsmOp *ao, const char *str) {
ks_mode mode = (ks_mode)0;
switch (a->bits) {
case 16:
mode = KS_MODE_16;
break;
case 32:
mode = KS_MODE_32;
break;
case 64:
mode = KS_MODE_64;
break;
}
return keystone_assemble (a, ao, str, KS_ARCH_X86, mode);
}
RAsmPlugin r_asm_plugin_x86_ks = {
.name = "x86.ks",
.desc = "x86 keystone assembler",
.license = "GPL",
.arch = "x86",
.bits = 16 | 32 | 64,
.assemble = &assemble,
};
#ifndef CORELIB
struct r_lib_struct_t radare_plugin = {
.type = R_LIB_TYPE_ASM,
.data = &r_asm_plugin_x86_ks,
.version = R2_VERSION
};
#endif
+2 -2
View File
@@ -4,8 +4,8 @@ LDFLAGS=@LDFLAGS@
R2_CFLAGS=@R2_CFLAGS@
R2_LDFLAGS=@R2_LDFLAGS@
HAVE_LIB_KEYSTONE=@HAVE_LIB_KEYSTONE@
KS_CFLAGS=@KS_CFLAGS@
KS_LDFLAGS=@KS_LDFLAGS@
BUILD_OS=@BUILD_OS@
+142 -60
View File
@@ -1,9 +1,10 @@
#!/bin/sh
# This script was automatically generated by ACR v1.3
# This script was automatically generated by ACR v2.2.4
# @author: pancake <nopcode.org>
# @url: http://www.nopcode.org
# @repo: git clone https://github.com/radare/acr
[ -z "${AWK}" ] && AWK=awk
do_remove() {
if [ "${ACR_RMFILES}" ]; then
printf "cleaning temporally files... "
@@ -23,7 +24,7 @@ while : ; do
ENVWORDS="${ENVWORDS} $1_CPU $1_OS"
STR=`eval "echo ${S}$1"`
SPLIT_CPU="`echo "$STR" | cut -d - -f 1`"
SPLIT_OS="`echo "$STR" | awk -F - '{
SPLIT_OS="`echo "$STR" | $AWK -F - '{
if ($2=="unknown"){
if (NF<3) { print $2; } else { print $3; }
} else {
@@ -38,6 +39,11 @@ shift
done
}
QUIET=0
be_quiet() {
QUIET=1
}
VPATH=`dirname ${0}`
if [ "${VPATH}" = "." ]; then
WODIS=current
@@ -59,12 +65,27 @@ if [ -e "${VPATH}/config.guess" ]; then
sh ${VPATH}/config.guess
return
fi
CPU="`uname -m|sed -e 's, ,,g'|cut -d - -f 1`"
CPU="`uname -m | tr 'A-Z' 'a-z' | sed -e 's, ,,g' | cut -d - -f 1`"
OS="`uname -s|tr A-Z a-z`"
uname -r | grep -qE "(Microsoft|WSL)" 2>/dev/null && OS="wsl"
GNU="`uname --help 2>&1 | grep gnu`"
[ "${GNU}" ] && OS="${OS}-gnu"
[ "${CPU}" = ppc ] && CPU="powerpc"
echo "${CPU}-unknown-${OS}"
# normalize CPU
case "${CPU}" in
ppc*|powermac*|powermacintosh*|powerpc*)
if echo "${CPU}" | grep -q '64'; then
CPU=powerpc64
else
CPU=powerpc
fi
;;
*) ;;
esac
VENDOR="unknown"
if [ "${OS}" = "darwin" ]; then
VENDOR=apple
fi
echo "${CPU}-${VENDOR}-${OS}"
}
SEARCHPATH="/usr /usr/local /usr/pkg /sw"
@@ -74,15 +95,19 @@ CROSSBUILD=0
BUILD=`guess_os`
HOST="${BUILD}"
TARGET="${HOST}"
ETCDIR="/etc"
SYSCONFDIR=""
DESCRIPTION=""
create_environ() {
: ${EPREFIX:="${PREFIX}"}
: ${SPREFIX:="${PREFIX}"}
: ${BINDIR:="${SPREFIX}/bin"}
: ${SBINDIR:="${PREFIX}/sbin"}
: ${SYSCONFDIR:="${SPREFIX}/etc"}
: ${ETCDIR:="${SPREFIX}/etc"}
: ${LIBDIR:="${SPREFIX}/lib"}
: ${PKGCFG_LIBDIR:='${exec_prefix}/lib'}
: ${PKGCFG_INCDIR:='${prefix}/include'}
: ${LIBEXECDIR:="${SPREFIX}/libexec"}
: ${INCLUDEDIR:="${SPREFIX}/include"}
: ${DATADIR:="${SPREFIX}/share"}
@@ -101,12 +126,12 @@ done
: ${INSTALL_PROGRAM_STRIP:=${INSTALL} -m 755 -s}
: ${INSTALL_MAN:=${INSTALL} -m 444}
: ${INSTALL_LIB:=${INSTALL} -m 755 -c}
PKGNAME='radare2-keystone' ; VERSION='0.1' ; CONTACT_MAIL="[email protected]" ; CONTACT_NAME="pancake" ; CONTACT="pancake <[email protected]>" ;
PKGNAME='radare2-keystone' ; VERSION='0.2' ; VERSION_MAJOR=0; VERSION_MINOR=2; VERSION_PATCH=0; VERSION_NUMBER=00200; CONTACT_MAIL="[email protected]" ; CONTACT_NAME="pancake" ; CONTACT="pancake <[email protected]>" ;
}
show_usage() {
cat <<EOF2
'configure' configures radare2-keystone-0.1 to adapt to many kinds of systems.
'configure' configures radare2-keystone-0.2 to adapt to many kinds of systems.
Usage: ./configure [OPTION]... [VAR=VALUE]...
@@ -118,6 +143,7 @@ Defaults for the options are specified in brackets.
Configuration:
-h, --help display this help and exit
-r, --report show what libs/programs require to work
-q, --quiet be quiet, less verbose (see ./configure -qV)
-V, --version display version information and exit
Installation directories:
@@ -137,6 +163,7 @@ Fine tuning of the installation directories:
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
--mandir=DIR man documentation [DATADIR/man]
--sbindir=DIR system admin executables [EPREFIX/sbin]
--etcdir=DIR same as --sysconfdir (/etc)
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
@@ -150,7 +177,6 @@ printf "
Some influential environment variables:
CC C compiler command
CFLAGS C compiler flags
CPPFLAGS C preprocessor flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have
@@ -170,12 +196,26 @@ take_environ() {
: ${CPP:=cpp}
: ${CC:=gcc}
: ${CPP:=cpp}
: ${CXX:=g++}
: ${CXX:=c++}
: ${PREFIX:=/usr/local/}
}
ochof() {
[ "$QUIET" = 1 ] && return
printf "$*"
}
ocho() {
[ "$QUIET" = 1 ] && return
echo "$*"
}
show_version() {
echo "radare2-keystone-0.1 configuration script done with acr v1.3.
if [ "$QUIET" = 1 ]; then
echo "0.2"
exit 0
fi
echo "radare2-keystone-0.2 configuration script done with acr v2.2.4.
The 'Free Software Foundation' message is only for autodetection.
Originally written by pancake <nopcode.org>."
exit 0
@@ -183,7 +223,7 @@ exit 0
parse_options() {
flag=`echo $1| cut -d = -f 1`
value=`echo $1| awk 'BEGIN{FS="=";}{print $2}'`
value=`echo $1| $AWK 'BEGIN{FS="=";}{print $2}'`
flag2=`echo $flag|cut -f2- -d -| sed -e 's,-,_,g' -e 's,^_,,g'|tr '[a-z]' '[A-Z]'`
if [ "${TARGET_OS}" = "darwin" ]; then
@@ -195,14 +235,20 @@ fi
case $flag in
-h|--help|--hel|--h|--he|-help)
show_usage ; ;;
-qV|-quiet-version|--quiet-version)
be_quiet
show_version ; ;;
-q|-quiet|--quiet)
be_quiet ; ;;
-V|-version|--version)
show_version ; ;;
-r|--r|--report)
echo "PKGNAME: radare2-keystone"
echo "VERSION: 0.1"
echo "LANGS: c c++"
echo "REQUIRED: libkeystone"
echo "PKG-CONFIG: r_asm"
echo "PKGNAME: radare2-keystone"
echo "VERSION: 0.2"
echo "AUTHOR: pancake"
echo "EMAIL: [email protected]"
echo "LANGS: c c++"
echo "PKGCONFIG: r_asm keystone"
exit 0
;;
--cache-file)
@@ -232,16 +278,22 @@ echo "PKG-CONFIG: r_asm"
--datadir)
DATADIR="$value"; ;;
--sysconfdir)
SYSCONFDIR="$value"; ;;
SYSCONFDIR="$value"
ETCDIR="$value"; ;;
--etcdir)
SYSCONFDIR="$value"
ETCDIR="$value"; ;;
--sharedstatedir)
SHAREDSTATEDIR="$value"; ;;
--localstatedir)
LOCALSTATEDIR="$value"; ;;
--libdir)
LIBDIR="$value"; ;;
LIBDIR="$value"
PKGCFG_LIBDIR="$value"; ;;
--libpath)
LDFLAGS="${LDFLAGS} ${LIBPATH}$value"; ;;
--includedir)
PKGCFG_INCDIR="$value"
INCLUDEDIR="$value"; CFLAGS="${CFLAGS} -I$value"; ;;
--infodir)
INFODIR="$value"; ;;
@@ -265,33 +317,30 @@ parse_options "$1"
shift
done
ENVWORDS="MANDIR INFODIR LIBDIR INCLUDEDIR LOCALSTATEDIR SYSCONFDIR DATADIR DOCDIR LIBEXECDIR SBINDIR BINDIR EPREFIX PREFIX SPREFIX TARGET HOST BUILD INSTALL INSTALL_LIB INSTALL_MAN INSTALL_PROGRAM INSTALL_PROGRAM_STRIP INSTALL_DIR INSTALL_SCRIPT INSTALL_DATA HOST_OS HOST_CPU BUILD_OS BUILD_CPU TARGET_OS TARGET_CPU PKGNAME VPATH VERSION CONTACT CONTACT_NAME CONTACT_MAIL CC CFLAGS CPPFLAGS LDFLAGS HAVE_LANG_C CXX CXXFLAGS HAVE_LANG_CXX HAVE_LIB_KEYSTONE R2_CFLAGS R2_LDFLAGS HAVE_PKGCFG_R_ASM"
ENVWORDS="MANDIR DESCRIPTION INFODIR LIBDIR INCLUDEDIR LOCALSTATEDIR ETCDIR SYSCONFDIR DATADIR DOCDIR LIBEXECDIR SBINDIR BINDIR EPREFIX PREFIX SPREFIX TARGET HOST BUILD INSTALL INSTALL_LIB INSTALL_MAN INSTALL_PROGRAM INSTALL_PROGRAM_STRIP INSTALL_DIR INSTALL_SCRIPT INSTALL_DATA HOST_OS HOST_CPU BUILD_OS BUILD_CPU TARGET_OS TARGET_CPU VERSION VERSION_MAJOR VERSION_MINOR VERSION_PATCH VERSION_NUMBER PKGCFG_LIBDIR PKGCFG_INCDIR PKGNAME VPATH CONTACT CONTACT_NAME CONTACT_MAIL CC CFLAGS CPPFLAGS LDFLAGS HAVE_LANG_C CXX CXXFLAGS HAVE_LANG_CXX PKGCONFIG R2_CFLAGS R2_LDFLAGS HAVE_PKGCFG_R_ASM KS_CFLAGS KS_LDFLAGS HAVE_PKGCFG_KEYSTONE"
create_environ
echo "checking build system type... ${BUILD}"
echo "checking host system type... ${HOST}"
echo "checking target system type... ${TARGET}"
ocho "checking build system type... ${BUILD}"
ocho "checking host system type... ${HOST}"
ocho "checking target system type... ${TARGET}"
[ "${CROSSBUILD}" = 1 ] && echo "using crosscompilation mode."
#split_host BUILD HOST TARGET
[ -n "${prefix}" ] && PREFIX="${prefix}"
echo "checking for working directories... ${WODIS}"
echo "using prefix '${PREFIX}'"
ocho "checking for working directories... ${WODIS}"
ocho "using prefix '${PREFIX}'"
ACR_RMFILES=" test.c a.out a.exe test.c test.cxx a.out a.exe"
COMPILER=CC
printf "checking for c compiler... "
ochof "checking for c compiler... "
HAVE_LANG_C=1
if [ "${CROSSBUILD}" = 1 ]; then
(command -v ${HOST}-${CC} >/dev/null 2>&1)
if [ $? = 0 ]; then CC="${HOST}-${CC}"; fi
fi
echo "int main(int argc, char **argv){return 0;}" > test.c
(exec ${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} test.c >/dev/null 2>&1)
(exec ${CC} -o a.out ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} test.c >/dev/null 2>&1)
if [ $? = 0 ]; then echo ${CC}; else
echo no ; HAVE_LANG_C=0
do_remove
@@ -299,7 +348,7 @@ echo "ERROR: ${CC} cannot create executables" >&2 ;
exit 1 ; fi
COMPILER=CXX
HAVE_LANG_CXX=1
printf "checking for c++ compiler... "
ochof "checking for c++ compiler... "
if [ "${CROSSBUILD}" = 1 ]; then
(command -v ${HOST}-${CXX} 2>&1 >/dev/null)
if [ "$?" = 0 ]; then CXX="${HOST}-${CXX}"; fi
@@ -315,46 +364,79 @@ echo "ERROR: ${CXX} cannot create executables" >&2 ;
do_remove
exit 1
fi
check_library() {
VAR=$1
S="$"
_REQUIRED=$3
_CHKLIB_NAME=$2
_CHKLIB_LIBS=$(echo "-l${_CHKLIB_NAME}" | sed 's,+, -l,g')
printf "checking for lib${_CHKLIB_NAME} ... "
echo "int main(int ac, char **av){return 0;}" > test.c
eval ${S}${COMPILER} ${CFLAGS} ${CPPFLAGS} ${CXXFLAGS} ${LDFLAGS} ${_CHKLIB_LIBS} test.c >/dev/null 2>&1
if [ $? = 0 ]; then
eval ${VAR}=1
echo yes
ochof "checking for pkg-config... "
ENVWORDS="${ENVWORDS} HAVE_PKGCONFIG"
if [ -n "$PKGCONFIG" ]; then
if [ -x "$PKGCONFIG" ]; then
_HAVE_PKGCONFIG="${PKGCONFIG}"
else
ocho "PKGCONFIG env is not executable"
PKGCONFIG=""
fi
else
eval ${VAR}=0
echo no
echo "this library is required."
do_remove
exit 1 ; fi }
check_library HAVE_LIB_KEYSTONE keystone 1
[ -z "${PKGCONFIG}" ] && PKGCONFIG=pkg-config
type ${PKGCONFIG} > /dev/null 2>&1 || echo "ERROR: Cannot find PKGCONFIG ${PKGCONFIG}"
IFS=:
for A in ${PATH} ; do
if [ -x "${A}/pkg-config" ]; then
PKGCONFIG="${A}/pkg-config"
elif [ -x "${A}/pkgconf" ]; then
PKGCONFIG="${A}/pkgconf"
else
continue
fi
break
done
unset IFS
fi
if [ -n "${PKGCONFIG}" ]; then
ocho ${PKGCONFIG}
HAVE_PKGCONFIG=1
else
HAVE_PKGCONFIG=0
echo "Cannot find pkg-config or pkgconf in PATH" >&2
exit 1
ocho no; fi
if [ -z "${PKGCONFIG}" ]; then pkg-config --version >/dev/null 2>&1 ; if [ 0 = 0 ]; then PKGCONFIG=pkg-config ; else PKGCONFIG=pkgconf ; fi; fi
type ${PKGCONFIG} > /dev/null 2>&1 || echo "ERROR: Cannot find valid PKGCONFIG, pkg-config or pkgconf in PATH"
echo 'Using PKGCONFIG: '${PKGCONFIG}
printf 'checking pkg-config flags for r_asm... '
tmp=`${PKGCONFIG} --cflags r_asm 2>/dev/null`
if [ $? != 0 ]; then echo no ; HAVE_PKGCFG_R_ASM=0;
if [ $? != 0 ]; then echo no ; HAVE_PKGCFG_R_ASM=0;
R2_CFLAGS='';R2_LDFLAGS='';
echo 'This package is required'
exit 1
else
R2_CFLAGS=$tmp;
else
R2_CFLAGS=$tmp;
tmp=`${PKGCONFIG} --libs r_asm 2>/dev/null`
if [ $? = 0 ]; then
echo yes; HAVE_PKGCFG_R_ASM=1;
if [ $? = 0 ]; then
echo yes; HAVE_PKGCFG_R_ASM=1;
R2_LDFLAGS=$tmp; fi; fi
if [ -z "${PKGCONFIG}" ]; then pkg-config --version >/dev/null 2>&1 ; if [ 0 = 0 ]; then PKGCONFIG=pkg-config ; else PKGCONFIG=pkgconf ; fi; fi
printf 'checking pkg-config flags for keystone... '
tmp=`${PKGCONFIG} --cflags keystone 2>/dev/null`
if [ $? != 0 ]; then echo no ; HAVE_PKGCFG_KEYSTONE=0;
KS_CFLAGS='';KS_LDFLAGS='';
echo 'This package is required'
exit 1
else
KS_CFLAGS=$tmp;
tmp=`${PKGCONFIG} --libs keystone 2>/dev/null`
if [ $? = 0 ]; then
echo yes; HAVE_PKGCFG_KEYSTONE=1;
KS_LDFLAGS=$tmp; fi; fi
SEDFLAGS=" -e '"
COUNT=0
for A in ${ENVWORDS} ; do
[ "${A}" = VPATH ] && continue
[ "${A}" = srcdir ] && continue
eval "VAR=\$${A}"
VAR="`echo ${VAR} | sed -e 's/\,/\\\,/g'`"
case "" in
mingw*|cygwin*|msys*)
VAR="`echo ${VAR} | sed -e 's/\\/\\\\/g' -e 's/\,/\\\,/g'`"
;;
*)
VAR="`echo ${VAR} | sed -e 's/\,/\\\,/g'`"
;;
esac
[ $COUNT = 10 ] && COUNT=0 && SEDFLAGS="${SEDFLAGS}' -e '"
COUNT=$(($COUNT+1))
SEDFLAGS="${SEDFLAGS}s,@${A}@,${VAR},g;"
@@ -372,8 +454,8 @@ if [ -f "${VPATH}/${A}.acr" ]; then
exit 1
fi
fi
echo "creating ${SD_TARGET}"
mkdir -p $(echo ${A} | sed -e "s,/`basename ${A}`$,,g")
ocho "creating ${SD_TARGET}"
[ "${VPATH}" != '.' ] && mkdir -p $(echo ${A} | sed -e "s,/`basename ${A}`$,,g")
cat ${VPATH}/${SD_TARGET}.acr | \
eval sed -e "s,@VPATH@,${VPATH}/${A},g" ${SEDFLAGS} > ${SD_TARGET}.tmp
@@ -383,7 +465,7 @@ if [ "$VALUE" = 0 ]; then ## FALSE
MARK="##${A}##"
if [ -n "`grep \"${MARK}\" ${SD_TARGET}.tmp`" ]; then
mv ${SD_TARGET}.tmp ${SD_TARGET}.tmp2
cat ${SD_TARGET}.tmp2 | MARK=$MARK awk 'BEGIN{a=0;}{if($1==ENVIRON["MARK"]){if(a)a=0;else a=1}else{if(!a)print;}}' > ${SD_TARGET}.tmp
cat ${SD_TARGET}.tmp2 | MARK=$MARK $AWK 'BEGIN{a=0;}{if($1==ENVIRON["MARK"]){if(a)a=0;else a=1}else{if(!a)print;}}' > ${SD_TARGET}.tmp
fi
fi
done
+4 -3
View File
@@ -1,12 +1,13 @@
PKGNAME radare2-keystone
VERSION 0.1
VERSION 0.2
CONTACT pancake ; [email protected]
LANG_C!
LANG_CXX!
USE_PKGCONFIG!
CHKLIB! keystone
(( CHKLIB! keystone ))
PKGCFG! R2_CFLAGS R2_LDFLAGS r_asm
PKGCFG! KS_CFLAGS KS_LDFLAGS keystone
SUBDIRS ./config.mk ;
+24 -15
View File
@@ -1,22 +1,30 @@
/* radare2-keystone - GPL - Copyright 2016 - pancake */
static void *oldcur = NULL;
static ks_engine *ks = NULL;
static int oldbit = 0;
#if R2_VERSION_NUMBER >= 50709
#define ATTSYNTAX R_ARCH_SYNTAX_ATT
#else
#define ATTSYNTAX R_ASM_SYNTAX_ATT
#endif
static int keystone_assemble(RAsm *a, RAsmOp *ao, const char *str, ks_arch arch, ks_mode mode) {
#include <r_th.h>
static R_TH_LOCAL void *oldcur = NULL;
static R_TH_LOCAL ks_engine *ks = NULL;
static R_TH_LOCAL int oldbit = 0;
static bool keystone_assemble(RArchSession *a, RAnalOp *ao, const char *str, ks_arch arch, ks_mode mode) {
ks_err err = KS_ERR_ARCH;
bool must_init = false;
size_t count, size;
ut8 *insn = NULL;
if (!ks_arch_supported (arch)) {
return -1;
return false;
}
must_init = true; //!oldcur || (a->cur != oldcur || oldbit != a->bits);
oldcur = a->cur;
oldbit = a->bits;
// oldcur = a->cur;
oldbit = a->config->bits;
if (must_init) {
if (ks) {
@@ -25,13 +33,13 @@ static int keystone_assemble(RAsm *a, RAsmOp *ao, const char *str, ks_arch arch,
}
err = ks_open (arch, mode, &ks);
if (err || !ks) {
eprintf ("Cannot initialize keystone\n");
R_LOG_ERROR ("Cannot initialize keystone");
ks_free (insn);
if (ks) {
ks_close (ks);
ks = NULL;
}
return -1;
return false;
}
}
@@ -41,14 +49,14 @@ static int keystone_assemble(RAsm *a, RAsmOp *ao, const char *str, ks_arch arch,
ks_close (ks);
ks = NULL;
}
return -1;
return false;
}
if (a->syntax == R_ASM_SYNTAX_ATT) {
if (a->config->syntax == ATTSYNTAX) {
ks_option (ks, KS_OPT_SYNTAX, KS_OPT_SYNTAX_ATT);
} else {
ks_option (ks, KS_OPT_SYNTAX, KS_OPT_SYNTAX_NASM);
}
int rc = ks_asm (ks, str, a->pc, &insn, &size, &count);
int rc = ks_asm (ks, str, ao->addr, &insn, &size, &count);
if (rc) {
eprintf ("ks_asm: (%s) %s\n", str, ks_strerror ((ks_err)ks_errno (ks)));
ks_free (insn);
@@ -56,13 +64,14 @@ static int keystone_assemble(RAsm *a, RAsmOp *ao, const char *str, ks_arch arch,
ks_close (ks);
ks = NULL;
}
return -1;
return false;
}
memcpy (ao->buf, insn, R_MIN (size, sizeof (ao->buf) -1));
ao->size = size;
ao->bytes = r_mem_dup (insn, size);
ks_free (insn);
if (ks) {
ks_close (ks);
ks = NULL;
}
return size;
return size > 0;
}
+41
View File
@@ -4,12 +4,28 @@ bea:
$(MAKE) -C asm bea
$(MAKE) -C anal bea
atombios:
$(MAKE) -C asm atombios
$(MAKE) -C anal atombios
$(MAKE) -C bin atombios
ba2:
$(MAKE) -C asm ba2
$(MAKE) -C anal ba2
blackfin:
$(MAKE) -C asm blackfin
tab:
$(MAKE) -C asm tab
olly:
$(MAKE) -C asm olly
udis udis86:
$(MAKE) -C asm x86_udis
$(MAKE) -C anal x86_udis
m68k:
$(MAKE) -C asm m68k_net
$(MAKE) -C anal m68k_net
@@ -17,14 +33,32 @@ m68k:
zyan:
$(MAKE) -C asm zyan
evm:
$(MAKE) -C io evm
nios:
$(MAKE) -C anal nios
clean:
$(MAKE) -C asm clean
$(MAKE) -C anal clean
atombios-install:
cp -f asm/p/asm_atombios.$(LIBEXT) $(R2PM_PLUGDIR)
cp -f anal/p/anal_atombios.$(LIBEXT) $(R2PM_PLUGDIR)
cp -f bin/p/bin_atombios.$(LIBEXT) $(R2PM_PLUGDIR)
ba2-install:
cp -f asm/p/asm_ba2.$(LIBEXT) $(R2PM_PLUGDIR)
cp -f anal/p/anal_ba2.$(LIBEXT) $(R2PM_PLUGDIR)
bea-install:
cp -f asm/p/asm_x86_bea.$(LIBEXT) $(R2PM_PLUGDIR)
cp -f anal/p/anal_x86_bea.$(LIBEXT) $(R2PM_PLUGDIR)
udis86-install udis-install:
cp -f asm/p/asm_x86_udis.$(LIBEXT) $(R2PM_PLUGDIR)
cp -f anal/p/anal_x86_udis.$(LIBEXT) $(R2PM_PLUGDIR)
tab-install:
cp -f asm/p/asm_x86_tab.$(LIBEXT) $(R2PM_PLUGDIR)
@@ -38,4 +72,11 @@ m68k-install:
zyan-install:
cp -f asm/p/asm_x86_zyan.$(LIBEXT) $(R2PM_PLUGDIR)
evm-install:
cp -f io/p/io_evm.$(LIBEXT) $(R2PM_PLUGDIR)
nios-install:
cp -f asm/p/asm_nios.$(LIBEXT) $(R2PM_PLUGDIR)
cp -f anal/p/anal_nios.$(LIBEXT) $(R2PM_PLUGDIR)
include ../options.mk
+20
View File
@@ -1,10 +1,30 @@
rl78:
$(MAKE) -C p anal_rl78.$(LIBEXT)
cp -f p/anal_rl78.$(LIBEXT) $(shell r2 -H R2_USER_PLUGINS)
ba2:
cd p ; $(MAKE) anal_ba2.$(LIBEXT)
bea:
cd p ; $(MAKE) anal_x86_bea.$(LIBEXT)
x86_udis udis udis86:
cd p ; $(MAKE) anal_x86_udis.$(LIBEXT)
m68k_net:
cd p ; $(MAKE) anal_m68k_net.$(LIBEXT)
atombios:
cd p ; $(MAKE) anal_atombios.$(LIBEXT)
nios:
cd p ; $(MAKE) anal_nios.$(LIBEXT)
clean:
rm -f p/anal_ba2.$(LIBEXT)
rm -f p/anal_x86_bea.$(LIBEXT)
rm -f p/anal_m68k_net.$(LIBEXT)
rm -f p/anal_atombios.{$(LIBEXT),o}
rm -f p/anal_nios.$(LIBEXT)
include ../../options.mk
File diff suppressed because it is too large. Load diff
+433
View File
@@ -0,0 +1,433 @@
/* Disassembler code for Renesas RL78.
Copyright (C) 2011-2022 Free Software Foundation, Inc.
Contributed by Red Hat.
Written by DJ Delorie.
This file is part of the GNU opcodes library.
This library is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3, or (at your option)
any later version.
It is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public
License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston,
MA 02110-1301, USA. */
#include "sysdep.h"
#include <stdio.h>
#include "bfd.h"
#include "elf-bfd.h"
#include "dis-asm.h"
#include "opcode/rl78.h"
// #include "elf/rl78.h"
#include <setjmp.h>
#define DEBUG_SEMANTICS 0
typedef struct
{
bfd_vma pc;
disassemble_info * dis;
} RL78_Data;
#if 0
struct private
{
OPCODES_SIGJMP_BUF bailout;
};
#endif
static int
rl78_get_byte (void * vdata)
{
bfd_byte buf[1];
RL78_Data *rl78_data = (RL78_Data *) vdata;
int status;
status = rl78_data->dis->read_memory_func (rl78_data->pc,
buf,
1,
rl78_data->dis);
#if 0
if (status != 0)
{
struct private *priv = (struct private *) rl78_data->dis->private_data;
rl78_data->dis->memory_error_func (status, rl78_data->pc,
rl78_data->dis);
OPCODES_SIGLONGJMP (priv->bailout, 1);
}
#endif
rl78_data->pc ++;
return buf[0];
}
static char const *
register_names[] =
{
"",
"x", "a", "c", "b", "e", "d", "l", "h",
"ax", "bc", "de", "hl",
"sp", "psw", "cs", "es", "pmc", "mem"
};
static char const *
condition_names[] =
{
"t", "f", "c", "nc", "h", "nh", "z", "nz"
};
static int
indirect_type (int t)
{
switch (t)
{
case RL78_Operand_Indirect:
case RL78_Operand_BitIndirect:
case RL78_Operand_PostInc:
case RL78_Operand_PreDec:
return 1;
default:
return 0;
}
}
static int
print_insn_rl78_common (bfd_vma addr, disassemble_info * dis, RL78_Dis_Isa isa)
{
int rv;
RL78_Data rl78_data;
RL78_Opcode_Decoded opcode;
const char * s;
#if DEBUG_SEMANTICS
static char buf[200];
#endif
// struct private priv;
// dis->private_data = (PTR) &priv;
rl78_data.pc = addr;
rl78_data.dis = dis;
#if 0
if (OPCODES_SIGSETJMP (priv.bailout) != 0)
{
/* Error return. */
return -1;
}
#endif
rv = rl78_decode_opcode (addr, &opcode, rl78_get_byte, &rl78_data, isa);
dis->bytes_per_line = 10;
#define PR (dis->fprintf_func)
#define PS (dis->stream)
#define PC(c) PR (PS, "%c", c)
s = opcode.syntax;
#if DEBUG_SEMANTICS
switch (opcode.id)
{
case RLO_unknown: s = "uknown"; break;
case RLO_add: s = "add: %e0%0 += %e1%1"; break;
case RLO_addc: s = "addc: %e0%0 += %e1%1 + CY"; break;
case RLO_and: s = "and: %e0%0 &= %e1%1"; break;
case RLO_branch: s = "branch: pc = %e0%0"; break;
case RLO_branch_cond: s = "branch_cond: pc = %e0%0 if %c1 / %e1%1"; break;
case RLO_branch_cond_clear: s = "branch_cond_clear: pc = %e0%0 if %c1 / %e1%1, %e1%1 = 0"; break;
case RLO_call: s = "call: pc = %e1%0"; break;
case RLO_cmp: s = "cmp: %e0%0 - %e1%1"; break;
case RLO_mov: s = "mov: %e0%0 = %e1%1"; break;
case RLO_or: s = "or: %e0%0 |= %e1%1"; break;
case RLO_rol: s = "rol: %e0%0 <<= %e1%1"; break;
case RLO_rolc: s = "rol: %e0%0 <<= %e1%1,CY"; break;
case RLO_ror: s = "ror: %e0%0 >>= %e1%1"; break;
case RLO_rorc: s = "ror: %e0%0 >>= %e1%1,CY"; break;
case RLO_sar: s = "sar: %e0%0 >>= %e1%1 signed"; break;
case RLO_sel: s = "sel: rb = %1"; break;
case RLO_shr: s = "shr: %e0%0 >>= %e1%1 unsigned"; break;
case RLO_shl: s = "shl: %e0%0 <<= %e1%1"; break;
case RLO_skip: s = "skip: if %c1"; break;
case RLO_sub: s = "sub: %e0%0 -= %e1%1"; break;
case RLO_subc: s = "subc: %e0%0 -= %e1%1 - CY"; break;
case RLO_xch: s = "xch: %e0%0 <-> %e1%1"; break;
case RLO_xor: s = "xor: %e0%0 ^= %e1%1"; break;
}
sprintf(buf, "%s%%W%%f\t\033[32m%s\033[0m", s, opcode.syntax);
s = buf;
#endif
for (; *s; s++)
{
if (*s != '%')
{
PC (*s);
}
else
{
RL78_Opcode_Operand * oper;
int do_hex = 0;
int do_addr = 0;
int do_es = 0;
int do_sfr = 0;
int do_cond = 0;
int do_bang = 0;
while (1)
{
s ++;
switch (*s)
{
case 'x':
do_hex = 1;
break;
case '!':
do_bang = 1;
break;
case 'e':
do_es = 1;
break;
case 'a':
do_addr = 1;
break;
case 's':
do_sfr = 1;
break;
case 'c':
do_cond = 1;
break;
default:
goto no_more_modifiers;
}
}
no_more_modifiers:;
switch (*s)
{
case '%':
PC ('%');
break;
#if DEBUG_SEMANTICS
case 'W':
if (opcode.size == RL78_Word)
PR (PS, " \033[33mW\033[0m");
break;
case 'f':
if (opcode.flags)
{
char *comma = "";
PR (PS, " \033[35m");
if (opcode.flags & RL78_PSW_Z)
{ PR (PS, "Z"); comma = ","; }
if (opcode.flags & RL78_PSW_AC)
{ PR (PS, "%sAC", comma); comma = ","; }
if (opcode.flags & RL78_PSW_CY)
{ PR (PS, "%sCY", comma); comma = ","; }
PR (PS, "\033[0m");
}
break;
#endif
case '0':
case '1':
oper = *s == '0' ? &opcode.op[0] : &opcode.op[1];
if (do_es)
{
if (oper->use_es && indirect_type (oper->type))
PR (PS, "es:");
}
if (do_bang)
{
/* If we are going to display SP by name, we must omit the bang. */
if ((oper->type == RL78_Operand_Indirect
|| oper->type == RL78_Operand_BitIndirect)
&& oper->reg == RL78_Reg_None
&& do_sfr
&& ((oper->addend == 0xffff8 && opcode.size == RL78_Word)
|| (oper->addend == 0x0fff8 && do_es && opcode.size == RL78_Word)))
;
else
PC ('!');
}
if (do_cond)
{
PR (PS, "%s", condition_names[oper->condition]);
break;
}
switch (oper->type)
{
case RL78_Operand_Immediate:
if (do_addr)
dis->print_address_func (oper->addend, dis);
else if (do_hex
|| oper->addend > 999
|| oper->addend < -999)
PR (PS, "%#x", oper->addend);
else
PR (PS, "%d", oper->addend);
break;
case RL78_Operand_Register:
PR (PS, "%s", register_names[oper->reg]);
break;
case RL78_Operand_Bit:
PR (PS, "%s.%d", register_names[oper->reg], oper->bit_number);
break;
case RL78_Operand_Indirect:
case RL78_Operand_BitIndirect:
switch (oper->reg)
{
case RL78_Reg_None:
if (oper->addend == 0xffffa && do_sfr && opcode.size == RL78_Byte)
PR (PS, "psw");
else if (oper->addend == 0xffff8 && do_sfr && opcode.size == RL78_Word)
PR (PS, "sp");
else if (oper->addend == 0x0fff8 && do_sfr && do_es && opcode.size == RL78_Word)
PR (PS, "sp");
else if (oper->addend == 0xffff8 && do_sfr && opcode.size == RL78_Byte)
PR (PS, "spl");
else if (oper->addend == 0xffff9 && do_sfr && opcode.size == RL78_Byte)
PR (PS, "sph");
else if (oper->addend == 0xffffc && do_sfr && opcode.size == RL78_Byte)
PR (PS, "cs");
else if (oper->addend == 0xffffd && do_sfr && opcode.size == RL78_Byte)
PR (PS, "es");
else if (oper->addend == 0xffffe && do_sfr && opcode.size == RL78_Byte)
PR (PS, "pmc");
else if (oper->addend == 0xfffff && do_sfr && opcode.size == RL78_Byte)
PR (PS, "mem");
else if (oper->addend >= 0xffe20)
PR (PS, "%#x", oper->addend);
else
{
int faddr = oper->addend;
if (do_es && ! oper->use_es)
faddr += 0xf0000;
dis->print_address_func (faddr, dis);
}
break;
case RL78_Reg_B:
case RL78_Reg_C:
case RL78_Reg_BC:
PR (PS, "%d[%s]", oper->addend, register_names[oper->reg]);
break;
default:
PR (PS, "[%s", register_names[oper->reg]);
if (oper->reg2 != RL78_Reg_None)
PR (PS, "+%s", register_names[oper->reg2]);
if (oper->addend || do_addr)
PR (PS, "+%d", oper->addend);
PC (']');
break;
}
if (oper->type == RL78_Operand_BitIndirect)
PR (PS, ".%d", oper->bit_number);
break;
#if DEBUG_SEMANTICS
/* Shouldn't happen - push and pop don't print
[SP] directly. But we *do* use them for
semantic debugging. */
case RL78_Operand_PostInc:
PR (PS, "[%s++]", register_names[oper->reg]);
break;
case RL78_Operand_PreDec:
PR (PS, "[--%s]", register_names[oper->reg]);
break;
#endif
default:
/* If we ever print this, that means the
programmer tried to print an operand with a
type we don't expect. Print the line and
operand number from rl78-decode.opc for
them. */
PR (PS, "???%d.%d", opcode.lineno, *s - '0');
break;
}
}
}
}
#if DEBUG_SEMANTICS
PR (PS, "\t\033[34m(line %d)\033[0m", opcode.lineno);
#endif
return rv;
}
int
print_insn_rl78 (bfd_vma addr, disassemble_info * dis)
{
return print_insn_rl78_common (addr, dis, RL78_ISA_DEFAULT);
}
int
print_insn_rl78_g10 (bfd_vma addr, disassemble_info * dis)
{
return print_insn_rl78_common (addr, dis, RL78_ISA_G10);
}
int
print_insn_rl78_g13 (bfd_vma addr, disassemble_info * dis)
{
return print_insn_rl78_common (addr, dis, RL78_ISA_G13);
}
int
print_insn_rl78_g14 (bfd_vma addr, disassemble_info * dis)
{
return print_insn_rl78_common (addr, dis, RL78_ISA_G14);
}
#if 0
disassembler_ftype
rl78_get_disassembler (bfd *abfd)
{
int cpu = E_FLAG_RL78_ANY_CPU;
if (abfd != NULL)
cpu = abfd->tdata.elf_obj_data->elf_header->e_flags & E_FLAG_RL78_CPU_MASK;
switch (cpu)
{
case E_FLAG_RL78_G10:
return print_insn_rl78_g10;
case E_FLAG_RL78_G13:
return print_insn_rl78_g13;
case E_FLAG_RL78_G14:
return print_insn_rl78_g14;
default:
return print_insn_rl78;
}
}
#endif
+5
View File
@@ -1,8 +1,13 @@
ARCHS=
ARCHS+=ba2.mk
ARCHS+=x86_bea.mk
#ARCHS+=x86_im.mk
ARCHS+=x86_simple.mk
ARCHS+=x86_udis.mk
ARCHS+=m68k_net.mk
ARCHS+=atombios.mk
ARCHS+=rl78.mk
ARCHS+=nios.mk
include ../../plugs.mk
File diff suppressed because it is too large. Load diff
+129
View File
@@ -0,0 +1,129 @@
/* radare - LGPL - Copyright 2020 - Jerome-PS */
#include <r_lib.h>
#include <r_anal.h>
#include "../../asm/arch/ba2/ba2_disas.c"
static int ba2_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *buf, int len, RAnalOpMask mask) {
struct op_cmd cmd = {
.instr = "",
.operands = ""
};
op->cycles = 0;
op->failcycles = 0;
op->nopcode = 1;
// op->size = ;
// op->type = ;
op->family = R_ANAL_OP_FAMILY_CPU; // maybe also FAMILY_IO...
// op->id = ;
int ret = ba2_decode_opcode (addr, buf, len, &cmd, &op->esil, op);
if((len < ret) || (!ret && len<6)){
op->size = 0;
return 0;
}
if (ret <= 0) {
return -1;
}
return op->size = ret;
}
static bool set_reg_profile(RAnal *anal) {
const char *p =
"=PC pc\n"
"=SP r1\n"
"=BP r2\n"
"=A0 r0\n"
"=A1 r1\n"
"=A2 r2\n"
"=A3 r3\n"
"=A4 r4\n"
"=A5 r5\n"
"=A6 r6\n"
"=A7 r7\n"
"=A8 r8\n"
"=SN r8\n" ///! TODO: ??? Which register ???
"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"
"gpr r18 .32 72 0\n"
"gpr r19 .32 76 0\n"
"gpr r20 .32 80 0\n"
"gpr r21 .32 84 0\n"
"gpr r22 .32 88 0\n"
"gpr r23 .32 92 0\n"
"gpr r24 .32 96 0\n"
"gpr r25 .32 100 0\n"
"gpr r26 .32 104 0\n"
"gpr r27 .32 108 0\n"
"gpr r28 .32 112 0\n"
"gpr r29 .32 116 0\n"
"gpr r30 .32 120 0\n"
"gpr r31 .32 124 0\n"
"gpr sp .32 4 0\n"
"gpr fp .32 8 0\n"
"gpr lr .32 36 0\n"
"gpr pc .32 128 0\n"
"gpr fl .1 132 0\n"
"gpr mac .64 136 0\n";
return r_reg_set_profile_string (anal->reg, p);
}
static int archinfo(RAnal *anal, int q) {
// fprintf(stderr, "archinfo:%d\r\n", q);
if (q == R_ANAL_ARCHINFO_ALIGN) {
return 0;
}
if (q == R_ANAL_ARCHINFO_MAX_OP_SIZE) {
return 6;
}
if (q == R_ANAL_ARCHINFO_MIN_OP_SIZE) {
return 2;
}
// if (q == R_ANAL_ARCHINFO_DATA_ALIGN) {
// return 0;
// }
return 0; // XXX
}
RAnalPlugin r_anal_plugin_ba2 = {
.name = "ba2",
.arch = "ba2",
.esil = true,
.bits = 32,
.desc = "Beyond Architecture 2 CPU code analysis plugin",
.license = "LGPL3",
.archinfo = archinfo,
.op = &ba2_op,
.set_reg_profile = &set_reg_profile,
// .esil_init = esil_ba2_init,
// .esil_fini = esil_ba2_fini
};
#ifndef R2_PLUGIN_INCORE
R_API RLibStruct radare_plugin = {
.type = R_LIB_TYPE_ANAL,
.data = &r_anal_plugin_ba2,
.version = R2_VERSION
};
#endif
-331
View File
@@ -1,331 +0,0 @@
#include <string.h>
#include <r_types.h>
#include <r_lib.h>
#include <r_asm.h>
#include <r_anal.h>
#include <r_util.h>
#include "evm.h"
static unsigned opcodes_types[] = {
[EVM_OP_STOP] = R_ANAL_OP_TYPE_TRAP,
[EVM_OP_ADD] = R_ANAL_OP_TYPE_ADD,
[EVM_OP_MUL] = R_ANAL_OP_TYPE_MUL,
[EVM_OP_SUB] = R_ANAL_OP_TYPE_SUB,
[EVM_OP_DIV] = R_ANAL_OP_TYPE_DIV,
[EVM_OP_SDIV] = R_ANAL_OP_TYPE_DIV,
[EVM_OP_MOD] = R_ANAL_OP_TYPE_MOD,
[EVM_OP_SMOD] = R_ANAL_OP_TYPE_MOD,
[EVM_OP_ADDMOD] = R_ANAL_OP_TYPE_ADD,
[EVM_OP_MULMOD] = R_ANAL_OP_TYPE_MUL,
[EVM_OP_EXP] = R_ANAL_OP_TYPE_MUL,
[EVM_OP_SIGNEXTEND] = R_ANAL_OP_TYPE_CAST,
[EVM_OP_LT] = R_ANAL_OP_TYPE_COND,
[EVM_OP_GT] = R_ANAL_OP_TYPE_COND,
[EVM_OP_SLT] = R_ANAL_OP_TYPE_COND,
[EVM_OP_SGT] = R_ANAL_OP_TYPE_COND,
[EVM_OP_EQ] = R_ANAL_OP_TYPE_CMP,
[EVM_OP_ISZERO] = R_ANAL_OP_TYPE_CMP,
[EVM_OP_AND] = R_ANAL_OP_TYPE_AND,
[EVM_OP_OR] = R_ANAL_OP_TYPE_OR,
[EVM_OP_XOR] = R_ANAL_OP_TYPE_XOR,
[EVM_OP_NOT] = R_ANAL_OP_TYPE_NOT,
[EVM_OP_BYTE] = R_ANAL_OP_TYPE_MOV,
[EVM_OP_SHA3] = R_ANAL_OP_TYPE_CRYPTO,
[EVM_OP_ADDRESS] = R_ANAL_OP_TYPE_CRYPTO,
[EVM_OP_BALANCE] = R_ANAL_OP_TYPE_CRYPTO,
[EVM_OP_ORIGIN] = R_ANAL_OP_TYPE_CRYPTO,
[EVM_OP_CALLER] = R_ANAL_OP_TYPE_CRYPTO,
[EVM_OP_CALLVALUE] = R_ANAL_OP_TYPE_CRYPTO,
[EVM_OP_CALLDATALOAD] = R_ANAL_OP_TYPE_CRYPTO,
[EVM_OP_CALLDATASIZE] = R_ANAL_OP_TYPE_CRYPTO,
[EVM_OP_CALLDATACOPY] = R_ANAL_OP_TYPE_CRYPTO,
[EVM_OP_CODESIZE] = R_ANAL_OP_TYPE_CRYPTO,
[EVM_OP_CODECOPY] = R_ANAL_OP_TYPE_CRYPTO,
[EVM_OP_GASPRICE] = R_ANAL_OP_TYPE_CRYPTO,
[EVM_OP_EXTCODESIZE] = R_ANAL_OP_TYPE_CRYPTO,
[EVM_OP_EXTCODECOPY] = R_ANAL_OP_TYPE_CRYPTO,
[EVM_OP_BLOCKHASH] = R_ANAL_OP_TYPE_CRYPTO,
[EVM_OP_COINBASE] = R_ANAL_OP_TYPE_CRYPTO,
[EVM_OP_TIMESTAMP] = R_ANAL_OP_TYPE_CRYPTO,
[EVM_OP_NUMBER] = R_ANAL_OP_TYPE_CRYPTO,
[EVM_OP_DIFFICULTY] = R_ANAL_OP_TYPE_CRYPTO,
[EVM_OP_GASLIMIT] = R_ANAL_OP_TYPE_CRYPTO,
[EVM_OP_POP] = R_ANAL_OP_TYPE_POP,
[EVM_OP_MLOAD] = R_ANAL_OP_TYPE_LOAD,
[EVM_OP_MSTORE] = R_ANAL_OP_TYPE_STORE,
[EVM_OP_MSTORE8] = R_ANAL_OP_TYPE_STORE,
[EVM_OP_SLOAD] = R_ANAL_OP_TYPE_LOAD,
[EVM_OP_SSTORE] = R_ANAL_OP_TYPE_STORE,
[EVM_OP_JUMP] = R_ANAL_OP_TYPE_JMP,
[EVM_OP_JUMPI] = R_ANAL_OP_TYPE_JMP,
[EVM_OP_PC] = R_ANAL_OP_TYPE_MOV,
[EVM_OP_MSIZE] = R_ANAL_OP_TYPE_MOV,
[EVM_OP_GAS] = R_ANAL_OP_TYPE_MOV,
[EVM_OP_JUMPDEST] = R_ANAL_OP_TYPE_NOP,
[EVM_OP_PUSH1] = R_ANAL_OP_TYPE_PUSH,
[EVM_OP_PUSH2] = R_ANAL_OP_TYPE_PUSH,
[EVM_OP_PUSH3] = R_ANAL_OP_TYPE_PUSH,
[EVM_OP_PUSH4] = R_ANAL_OP_TYPE_PUSH,
[EVM_OP_PUSH5] = R_ANAL_OP_TYPE_PUSH,
[EVM_OP_PUSH6] = R_ANAL_OP_TYPE_PUSH,
[EVM_OP_PUSH7] = R_ANAL_OP_TYPE_PUSH,
[EVM_OP_PUSH8] = R_ANAL_OP_TYPE_PUSH,
[EVM_OP_PUSH9] = R_ANAL_OP_TYPE_PUSH,
[EVM_OP_PUSH10] = R_ANAL_OP_TYPE_PUSH,
[EVM_OP_PUSH11] = R_ANAL_OP_TYPE_PUSH,
[EVM_OP_PUSH12] = R_ANAL_OP_TYPE_PUSH,
[EVM_OP_PUSH13] = R_ANAL_OP_TYPE_PUSH,
[EVM_OP_PUSH14] = R_ANAL_OP_TYPE_PUSH,
[EVM_OP_PUSH15] = R_ANAL_OP_TYPE_PUSH,
[EVM_OP_PUSH16] = R_ANAL_OP_TYPE_PUSH,
[EVM_OP_PUSH17] = R_ANAL_OP_TYPE_PUSH,
[EVM_OP_PUSH18] = R_ANAL_OP_TYPE_PUSH,
[EVM_OP_PUSH19] = R_ANAL_OP_TYPE_PUSH,
[EVM_OP_PUSH20] = R_ANAL_OP_TYPE_PUSH,
[EVM_OP_PUSH21] = R_ANAL_OP_TYPE_PUSH,
[EVM_OP_PUSH22] = R_ANAL_OP_TYPE_PUSH,
[EVM_OP_PUSH23] = R_ANAL_OP_TYPE_PUSH,
[EVM_OP_PUSH24] = R_ANAL_OP_TYPE_PUSH,
[EVM_OP_PUSH25] = R_ANAL_OP_TYPE_PUSH,
[EVM_OP_PUSH26] = R_ANAL_OP_TYPE_PUSH,
[EVM_OP_PUSH27] = R_ANAL_OP_TYPE_PUSH,
[EVM_OP_PUSH28] = R_ANAL_OP_TYPE_PUSH,
[EVM_OP_PUSH29] = R_ANAL_OP_TYPE_PUSH,
[EVM_OP_PUSH30] = R_ANAL_OP_TYPE_PUSH,
[EVM_OP_PUSH31] = R_ANAL_OP_TYPE_PUSH,
[EVM_OP_PUSH32] = R_ANAL_OP_TYPE_PUSH,
[EVM_OP_DUP1] = R_ANAL_OP_TYPE_MOV,
[EVM_OP_DUP2] = R_ANAL_OP_TYPE_MOV,
[EVM_OP_DUP3] = R_ANAL_OP_TYPE_MOV,
[EVM_OP_DUP4] = R_ANAL_OP_TYPE_MOV,
[EVM_OP_DUP5] = R_ANAL_OP_TYPE_MOV,
[EVM_OP_DUP6] = R_ANAL_OP_TYPE_MOV,
[EVM_OP_DUP7] = R_ANAL_OP_TYPE_MOV,
[EVM_OP_DUP8] = R_ANAL_OP_TYPE_MOV,
[EVM_OP_DUP9] = R_ANAL_OP_TYPE_MOV,
[EVM_OP_DUP10] = R_ANAL_OP_TYPE_MOV,
[EVM_OP_DUP11] = R_ANAL_OP_TYPE_MOV,
[EVM_OP_DUP12] = R_ANAL_OP_TYPE_MOV,
[EVM_OP_DUP13] = R_ANAL_OP_TYPE_MOV,
[EVM_OP_DUP14] = R_ANAL_OP_TYPE_MOV,
[EVM_OP_DUP15] = R_ANAL_OP_TYPE_MOV,
[EVM_OP_DUP16] = R_ANAL_OP_TYPE_MOV,
[EVM_OP_SWAP1] = R_ANAL_OP_TYPE_MOV,
[EVM_OP_SWAP2] = R_ANAL_OP_TYPE_MOV,
[EVM_OP_SWAP3] = R_ANAL_OP_TYPE_MOV,
[EVM_OP_SWAP4] = R_ANAL_OP_TYPE_MOV,
[EVM_OP_SWAP5] = R_ANAL_OP_TYPE_MOV,
[EVM_OP_SWAP6] = R_ANAL_OP_TYPE_MOV,
[EVM_OP_SWAP7] = R_ANAL_OP_TYPE_MOV,
[EVM_OP_SWAP8] = R_ANAL_OP_TYPE_MOV,
[EVM_OP_SWAP9] = R_ANAL_OP_TYPE_MOV,
[EVM_OP_SWAP10] = R_ANAL_OP_TYPE_MOV,
[EVM_OP_SWAP11] = R_ANAL_OP_TYPE_MOV,
[EVM_OP_SWAP12] = R_ANAL_OP_TYPE_MOV,
[EVM_OP_SWAP13] = R_ANAL_OP_TYPE_MOV,
[EVM_OP_SWAP14] = R_ANAL_OP_TYPE_MOV,
[EVM_OP_SWAP15] = R_ANAL_OP_TYPE_MOV,
[EVM_OP_SWAP16] = R_ANAL_OP_TYPE_MOV,
[EVM_OP_LOG0] = R_ANAL_OP_TYPE_TRAP,
[EVM_OP_LOG1] = R_ANAL_OP_TYPE_TRAP,
[EVM_OP_LOG2] = R_ANAL_OP_TYPE_TRAP,
[EVM_OP_LOG3] = R_ANAL_OP_TYPE_TRAP,
[EVM_OP_LOG4] = R_ANAL_OP_TYPE_TRAP,
[EVM_OP_CREATE] = R_ANAL_OP_TYPE_CRYPTO,
[EVM_OP_CALL] = R_ANAL_OP_TYPE_CRYPTO,
[EVM_OP_CALLCODE] = R_ANAL_OP_TYPE_CRYPTO,
[EVM_OP_RETURN] = R_ANAL_OP_TYPE_CRYPTO,
[EVM_OP_DELEGATECALL] = R_ANAL_OP_TYPE_CRYPTO,
[EVM_OP_REVERT] = R_ANAL_OP_TYPE_CRYPTO,
[EVM_OP_SELFDESTRUCT] = R_ANAL_OP_TYPE_CRYPTO,
};
static int evm_oplen(ut8 opcode) {
int ret;
EvmOpDef *opdef = &opcodes[opcode];
if (opdef->txt) {
return opdef->len;
}
switch (opcode) {
case EVM_OP_PUSH1:
case EVM_OP_PUSH2:
case EVM_OP_PUSH3:
case EVM_OP_PUSH4:
case EVM_OP_PUSH5:
case EVM_OP_PUSH6:
case EVM_OP_PUSH7:
case EVM_OP_PUSH8:
case EVM_OP_PUSH9:
case EVM_OP_PUSH10:
case EVM_OP_PUSH11:
case EVM_OP_PUSH12:
case EVM_OP_PUSH13:
case EVM_OP_PUSH14:
case EVM_OP_PUSH15:
case EVM_OP_PUSH16:
case EVM_OP_PUSH17:
case EVM_OP_PUSH18:
case EVM_OP_PUSH19:
case EVM_OP_PUSH20:
case EVM_OP_PUSH21:
case EVM_OP_PUSH22:
case EVM_OP_PUSH23:
case EVM_OP_PUSH24:
case EVM_OP_PUSH25:
case EVM_OP_PUSH26:
case EVM_OP_PUSH27:
case EVM_OP_PUSH28:
case EVM_OP_PUSH29:
case EVM_OP_PUSH30:
case EVM_OP_PUSH31:
case EVM_OP_PUSH32:
{
int i, pushSize = opcode - EVM_OP_PUSH1;
/*
op->imm = 0;
for (i = 0; i < pushSize + 1; i++) {
op->imm <<= 8;
op->imm |= buf[i + 1];
}
settxtf (op, "push%d 0x%x", pushSize + 1, op->imm);
*/
ret = 2 + pushSize;
}
break;
case EVM_OP_DUP1:
case EVM_OP_DUP2:
case EVM_OP_DUP3:
case EVM_OP_DUP4:
case EVM_OP_DUP5:
case EVM_OP_DUP6:
case EVM_OP_DUP7:
case EVM_OP_DUP8:
case EVM_OP_DUP9:
case EVM_OP_DUP10:
case EVM_OP_DUP11:
case EVM_OP_DUP12:
case EVM_OP_DUP13:
case EVM_OP_DUP14:
case EVM_OP_DUP15:
case EVM_OP_DUP16:
{
int dupSize = opcode - EVM_OP_DUP1 + 1;
// settxtf (op, "dup%d", dupSize);
ret = dupSize + 1;
}
break;
case EVM_OP_SWAP1:
case EVM_OP_SWAP2:
case EVM_OP_SWAP3:
case EVM_OP_SWAP4:
case EVM_OP_SWAP5:
case EVM_OP_SWAP6:
case EVM_OP_SWAP7:
case EVM_OP_SWAP8:
case EVM_OP_SWAP9:
case EVM_OP_SWAP10:
case EVM_OP_SWAP11:
case EVM_OP_SWAP12:
case EVM_OP_SWAP13:
case EVM_OP_SWAP14:
case EVM_OP_SWAP15:
case EVM_OP_SWAP16:
{
int swapSize = opcode - EVM_OP_SWAP1 + 1;
// settxtf (op, "swap%d", swapSize);
ret = 1;
}
break;
case EVM_OP_LOG0:
case EVM_OP_LOG1:
case EVM_OP_LOG2:
case EVM_OP_LOG3:
case EVM_OP_LOG4:
{
int logSize = opcode - EVM_OP_LOG0;
// settxtf (op, "log%d", logSize);
ret = 1;
}
break;
default:
// settxtf (op, "invalid");
ret = 1;
break;
}
return ret;
}
static int evm_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *buf, int len) {
static ut16 a = 0;
int ret;
ut8 opcode;
opcode = buf[0];
anal->addrmy = op->addr;
memset (op, 0, sizeof(RAnalOp));
op->type = opcodes_types[opcode];
if (!op->type) {
op->type = R_ANAL_OP_TYPE_UNK;
}
op->addr = addr;
op->jump = op->fail = -1;
op->ptr = op->val = -1;
r_strbuf_init (&op->esil);
switch (opcode) {
case EVM_OP_JUMP:
op->fail = addr + 1;
op->jump = buf[-1];
op->type = R_ANAL_OP_TYPE_JMP;
break;
case EVM_OP_JUMPI:
op->fail = addr + 1;
op->jump = buf[-1];
op->type = R_ANAL_OP_TYPE_JMP;
break;
case EVM_OP_PC:
break;
case EVM_OP_MSIZE:
break;
case EVM_OP_GAS:
break;
case EVM_OP_JUMPDEST:
break;
case EVM_OP_PUSH1:
a = buf[1];
break;
case EVM_OP_PUSH2:
a = buf[1] << 8 | buf[2];
break;
default:
break;
}
op->size = evm_oplen (opcode);
return evm_oplen (opcode);
}
RAnalPlugin r_anal_plugin_evm = {
.name = "evm",
.desc = "ETHEREUM VM code analysis plugin",
.license = "LGPL3",
.arch = "evm",
.bits = 8,
.op = evm_op,
.esil = false,
};
+799
View File
@@ -0,0 +1,799 @@
/* nios plugin by hewittc at 2018-2020 */
#include <string.h>
#include <r_types.h>
#include <r_lib.h>
#include <r_asm.h>
#include <r_anal.h>
#include <sdb.h>
#include "dis-asm.h"
#include "nios/gnu/nios-desc.h"
#define f_op11(i) ((i >> 5))
#define f_op9(i) ((i >> 7))
#define f_op8(i) ((i >> 8))
#define f_op6(i) ((i >> 10))
#define f_op5w(i) ((i >> 5) & 0x001f)
#define f_op5(i) ((i >> 11))
#define f_op4(i) ((i >> 12))
#define f_op3u(i) ((i >> 7) & 0x0007)
#define f_op3(i) ((i >> 13))
#define f_op2v(i) ((i >> 8) & 0x0003)
#define f_IMM11(i) ((i >> 0) & 0x07ff)
#define f_IMM10(i) ((i >> 0) & 0x03ff)
#define f_IMM9(i) ((i >> 1) & 0x01ff)
#define f_IMM8v(i) ((i >> 0) & 0x00ff)
#define f_IMM8(i) ((i >> 5) & 0x00ff)
#define f_IMM6v(i) ((i >> 0) & 0x003f)
#define f_IMM6(i) ((i >> 5) & 0x003f)
#define f_IMM5(i) ((i >> 5) & 0x001f)
#define f_IMM4w(i) ((i >> 0) & 0x00ff)
#define f_IMM4(i) ((i >> 5) & 0x000f)
#define f_IMM2u(i) ((i >> 5) & 0x0003)
#define f_IMM1u(i) ((i >> 6) & 0x0001)
#define f_P(i) ((i >> 10) & 0x0003)
#define f_B(i) ((i >> 5) & 0x001f)
#define f_A(i) ((i >> 0) & 0x001f)
enum insn_format {
FMT_RR,
FMT_Ri5,
FMT_Ri4,
FMT_RPi5,
FMT_Ri6,
FMT_Ri8,
FMT_i9,
FMT_i10,
FMT_i11,
FMT_Ri1u,
FMT_Ri2u,
FMT_i8v,
FMT_i6v,
FMT_Rw,
FMT_i4w,
FMT_w
};
enum insn_type {
TYPE_OP6,
TYPE_OP9,
TYPE_OP8,
TYPE_OP11,
TYPE_OP5,
TYPE_OP4,
TYPE_OP3,
TYPE_OPS
};
struct insn_fields {
ut16 op11 : 11;
ut16 op9 : 9;
ut16 op8 : 8;
ut16 op6 : 6;
ut16 op5w : 5;
ut16 op5 : 5;
ut16 op4 : 4;
ut16 op3u : 3;
ut16 op3 : 3;
ut16 op2v : 2;
st16 IMM11 : 11;
st16 IMM10 : 10;
st16 IMM9 : 9;
st16 IMM8v : 8;
st16 IMM8 : 8;
st16 IMM6v : 6;
st16 IMM6 : 6;
st16 IMM5 : 5;
st16 IMM4w : 4;
st16 IMM4 : 4;
st16 IMM2u : 2;
st16 IMM1u : 1;
st16 P : 2;
st16 B : 5;
st16 A : 5;
};
struct insn_op {
enum mach_attr mach;
enum insn_type type;
ut16 opcode;
enum insn_format format;
_RAnalOpType r_op_type;
};
#define INSN_OPS_MAX 131
static const struct insn_op insn_ops[INSN_OPS_MAX] = {
{ MACH_NIOS16, TYPE_OP6, OP_ADD, FMT_RR, R_ANAL_OP_TYPE_ADD },
{ MACH_NIOS16, TYPE_OP6, OP_ADDI, FMT_Ri5, R_ANAL_OP_TYPE_ADD },
{ MACH_NIOS16, TYPE_OP6, OP_SUB, FMT_RR, R_ANAL_OP_TYPE_SUB },
{ MACH_NIOS16, TYPE_OP6, OP_SUBI, FMT_Ri5, R_ANAL_OP_TYPE_SUB },
{ MACH_NIOS16, TYPE_OP6, OP_CMP, FMT_RR, R_ANAL_OP_TYPE_CMP },
{ MACH_NIOS16, TYPE_OP6, OP_CMPI, FMT_Ri5, R_ANAL_OP_TYPE_CMP },
{ MACH_NIOS16, TYPE_OP6, OP_LSL, FMT_RR, R_ANAL_OP_TYPE_SHL },
{ MACH_NIOS16, TYPE_OP6, OP_LSLI, FMT_Ri4, R_ANAL_OP_TYPE_SHL },
{ MACH_NIOS16, TYPE_OP6, OP_LSR, FMT_RR, R_ANAL_OP_TYPE_SHR },
{ MACH_NIOS16, TYPE_OP6, OP_LSRI, FMT_Ri4, R_ANAL_OP_TYPE_SHR },
{ MACH_NIOS16, TYPE_OP6, OP_ASR, FMT_RR, R_ANAL_OP_TYPE_SAR },
{ MACH_NIOS16, TYPE_OP6, OP_ASRI, FMT_Ri4, R_ANAL_OP_TYPE_SAR },
{ MACH_NIOS16, TYPE_OP6, OP_MOV, FMT_RR, R_ANAL_OP_TYPE_MOV },
{ MACH_NIOS16, TYPE_OP6, OP_MOVI, FMT_Ri5, R_ANAL_OP_TYPE_MOV },
{ MACH_NIOS16, TYPE_OP6, OP_AND, FMT_RR, R_ANAL_OP_TYPE_AND },
{ MACH_NIOS16, TYPE_OP6, OP_ANDN, FMT_RR, R_ANAL_OP_TYPE_AND },
{ MACH_NIOS16, TYPE_OP6, OP_OR, FMT_RR, R_ANAL_OP_TYPE_OR },
{ MACH_NIOS16, TYPE_OP6, OP_XOR, FMT_RR, R_ANAL_OP_TYPE_XOR },
{ MACH_NIOS16, TYPE_OP6, OP_BGEN, FMT_Ri4, R_ANAL_OP_TYPE_MUL },
{ MACH_NIOS16, TYPE_OP6, OP_EXT8D, FMT_RR, R_ANAL_OP_TYPE_MOV },
{ MACH_NIOS16, TYPE_OP6, OP_SKP0, FMT_Ri4, R_ANAL_OP_TYPE_CJMP },
{ MACH_NIOS16, TYPE_OP6, OP_SKP1, FMT_Ri4, R_ANAL_OP_TYPE_CJMP },
{ MACH_NIOS16, TYPE_OP6, OP_LD, FMT_RR, R_ANAL_OP_TYPE_LOAD },
{ MACH_NIOS16, TYPE_OP6, OP_ST, FMT_RR, R_ANAL_OP_TYPE_STORE },
{ MACH_NIOS16, TYPE_OP6, OP_STS8S, FMT_i10, R_ANAL_OP_TYPE_STORE },
{ MACH_NIOS16, TYPE_OP6, OP_ADDC, FMT_RR, R_ANAL_OP_TYPE_MOV },
{ MACH_NIOS16, TYPE_OP6, OP_SUBC, FMT_Ri5, R_ANAL_OP_TYPE_MOV },
{ MACH_NIOS16, TYPE_OP6, OP_USR0, FMT_RR, R_ANAL_OP_TYPE_IO },
{ MACH_NIOS16, TYPE_OP3, OP_STS, FMT_Ri8, R_ANAL_OP_TYPE_STORE },
{ MACH_NIOS16, TYPE_OP3, OP_LDS, FMT_Ri8, R_ANAL_OP_TYPE_LOAD },
{ MACH_NIOS16, TYPE_OP4, OP_STP, FMT_RPi5, R_ANAL_OP_TYPE_STORE },
{ MACH_NIOS16, TYPE_OP4, OP_LDP, FMT_RPi5, R_ANAL_OP_TYPE_LOAD },
{ MACH_NIOS16, TYPE_OP5, OP_BR, FMT_i11, R_ANAL_OP_TYPE_JMP },
{ MACH_NIOS16, TYPE_OP5, OP_BSR, FMT_i11, R_ANAL_OP_TYPE_JMP },
{ MACH_NIOS16, TYPE_OP5, OP_PFX, FMT_i11, R_ANAL_OP_TYPE_MOV },
{ MACH_NIOS16, TYPE_OP8, OP_SAVE, FMT_i8v, R_ANAL_OP_TYPE_PUSH },
{ MACH_NIOS16, TYPE_OP8, OP_TRAP, FMT_i6v, R_ANAL_OP_TYPE_TRAP },
{ MACH_NIOS16, TYPE_OP9, OP_EXT8S, FMT_Ri1u, R_ANAL_OP_TYPE_MOV },
{ MACH_NIOS16, TYPE_OP9, OP_ST8S, FMT_Ri1u, R_ANAL_OP_TYPE_STORE },
{ MACH_NIOS16, TYPE_OP11, OP_NOT, FMT_Rw, R_ANAL_OP_TYPE_NOT },
{ MACH_NIOS16, TYPE_OP11, OP_NEG, FMT_Rw, R_ANAL_OP_TYPE_SUB },
{ MACH_NIOS16, TYPE_OP11, OP_ABS, FMT_Rw, R_ANAL_OP_TYPE_ABS },
{ MACH_NIOS16, TYPE_OP11, OP_SEXT8, FMT_Rw, R_ANAL_OP_TYPE_MOV },
{ MACH_NIOS16, TYPE_OP11, OP_RLC, FMT_Rw, R_ANAL_OP_TYPE_ROL },
{ MACH_NIOS16, TYPE_OP11, OP_RRC, FMT_Rw, R_ANAL_OP_TYPE_ROR },
{ MACH_NIOS16, TYPE_OP11, OP_TRET, FMT_Rw, R_ANAL_OP_TYPE_UJMP },
{ MACH_NIOS16, TYPE_OP11, OP_RESTORE, FMT_w, R_ANAL_OP_TYPE_POP },
{ MACH_NIOS16, TYPE_OP11, OP_ST8D, FMT_Rw, R_ANAL_OP_TYPE_STORE },
{ MACH_NIOS16, TYPE_OP11, OP_FILL8, FMT_Rw, R_ANAL_OP_TYPE_MOV },
{ MACH_NIOS16, TYPE_OP11, OP_SKPRZ, FMT_Rw, R_ANAL_OP_TYPE_CJMP },
{ MACH_NIOS16, TYPE_OP11, OP_SKPS, FMT_Rw, R_ANAL_OP_TYPE_CJMP },
{ MACH_NIOS16, TYPE_OP11, OP_WRCTL, FMT_Rw, R_ANAL_OP_TYPE_MOV },
{ MACH_NIOS16, TYPE_OP11, OP_RDCTL, FMT_Rw, R_ANAL_OP_TYPE_MOV },
{ MACH_NIOS16, TYPE_OP11, OP_SKPRNZ, FMT_Rw, R_ANAL_OP_TYPE_CJMP },
{ MACH_NIOS16, TYPE_OP11, OP_JMP, FMT_Rw, R_ANAL_OP_TYPE_JMP },
{ MACH_NIOS16, TYPE_OP11, OP_CALL, FMT_Rw, R_ANAL_OP_TYPE_CALL },
{ MACH_NIOS16, TYPE_OP11, OP_SWAP, FMT_Rw, R_ANAL_OP_TYPE_MOV },
{ MACH_NIOS16, TYPE_OP11, OP_USR1, FMT_Rw, R_ANAL_OP_TYPE_IO },
{ MACH_NIOS16, TYPE_OP11, OP_USR2, FMT_Rw, R_ANAL_OP_TYPE_IO },
{ MACH_NIOS16, TYPE_OP11, OP_USR3, FMT_Rw, R_ANAL_OP_TYPE_IO },
{ MACH_NIOS16, TYPE_OP11, OP_USR4, FMT_Rw, R_ANAL_OP_TYPE_IO },
{ MACH_NIOS32, TYPE_OP6, OP_ADD, FMT_RR, R_ANAL_OP_TYPE_ADD },
{ MACH_NIOS32, TYPE_OP6, OP_ADDI, FMT_Ri5, R_ANAL_OP_TYPE_ADD },
{ MACH_NIOS32, TYPE_OP6, OP_SUB, FMT_RR, R_ANAL_OP_TYPE_SUB },
{ MACH_NIOS32, TYPE_OP6, OP_SUBI, FMT_Ri5, R_ANAL_OP_TYPE_SUB },
{ MACH_NIOS32, TYPE_OP6, OP_CMP, FMT_RR, R_ANAL_OP_TYPE_CMP },
{ MACH_NIOS32, TYPE_OP6, OP_CMPI, FMT_Ri5, R_ANAL_OP_TYPE_CMP },
{ MACH_NIOS32, TYPE_OP6, OP_LSL, FMT_RR, R_ANAL_OP_TYPE_SHL },
{ MACH_NIOS32, TYPE_OP6, OP_LSLI, FMT_Ri5, R_ANAL_OP_TYPE_SHL },
{ MACH_NIOS32, TYPE_OP6, OP_LSR, FMT_RR, R_ANAL_OP_TYPE_SHR },
{ MACH_NIOS32, TYPE_OP6, OP_LSRI, FMT_Ri5, R_ANAL_OP_TYPE_SHR },
{ MACH_NIOS32, TYPE_OP6, OP_ASR, FMT_RR, R_ANAL_OP_TYPE_SAR },
{ MACH_NIOS32, TYPE_OP6, OP_ASRI, FMT_Ri5, R_ANAL_OP_TYPE_SAR },
{ MACH_NIOS32, TYPE_OP6, OP_MOV, FMT_RR, R_ANAL_OP_TYPE_MOV },
{ MACH_NIOS32, TYPE_OP6, OP_MOVI, FMT_Ri5, R_ANAL_OP_TYPE_MOV },
{ MACH_NIOS32, TYPE_OP6, OP_AND, FMT_RR, R_ANAL_OP_TYPE_AND },
{ MACH_NIOS32, TYPE_OP6, OP_ANDN, FMT_RR, R_ANAL_OP_TYPE_AND },
{ MACH_NIOS32, TYPE_OP6, OP_OR, FMT_RR, R_ANAL_OP_TYPE_OR },
{ MACH_NIOS32, TYPE_OP6, OP_XOR, FMT_RR, R_ANAL_OP_TYPE_XOR },
{ MACH_NIOS32, TYPE_OP6, OP_BGEN, FMT_Ri5, R_ANAL_OP_TYPE_MUL },
{ MACH_NIOS32, TYPE_OP6, OP_EXT8D, FMT_RR, R_ANAL_OP_TYPE_MOV },
{ MACH_NIOS32, TYPE_OP6, OP_SKP0, FMT_Ri5, R_ANAL_OP_TYPE_CJMP },
{ MACH_NIOS32, TYPE_OP6, OP_SKP1, FMT_Ri5, R_ANAL_OP_TYPE_CJMP },
{ MACH_NIOS32, TYPE_OP6, OP_LD, FMT_RR, R_ANAL_OP_TYPE_LOAD },
{ MACH_NIOS32, TYPE_OP6, OP_ST, FMT_RR, R_ANAL_OP_TYPE_STORE },
{ MACH_NIOS32, TYPE_OP6, OP_STS8S, FMT_i10, R_ANAL_OP_TYPE_STORE },
{ MACH_NIOS32, TYPE_OP6, OP_STS16S, FMT_i9, R_ANAL_OP_TYPE_STORE },
{ MACH_NIOS32, TYPE_OP6, OP_EXT16D, FMT_RR, R_ANAL_OP_TYPE_MOV },
{ MACH_NIOS32, TYPE_OP6, OP_MOVHI, FMT_Ri5, R_ANAL_OP_TYPE_MOV },
{ MACH_NIOS32, TYPE_OP6, OP_USR0, FMT_RR, R_ANAL_OP_TYPE_IO },
{ MACH_NIOS32, TYPE_OP3, OP_STS, FMT_Ri8, R_ANAL_OP_TYPE_STORE },
{ MACH_NIOS32, TYPE_OP3, OP_LDS, FMT_Ri8, R_ANAL_OP_TYPE_LOAD },
{ MACH_NIOS32, TYPE_OP4, OP_STP, FMT_RPi5, R_ANAL_OP_TYPE_STORE },
{ MACH_NIOS32, TYPE_OP4, OP_LDP, FMT_RPi5, R_ANAL_OP_TYPE_LOAD },
{ MACH_NIOS32, TYPE_OP5, OP_BR, FMT_i11, R_ANAL_OP_TYPE_JMP },
{ MACH_NIOS32, TYPE_OP5, OP_BSR, FMT_i11, R_ANAL_OP_TYPE_JMP },
{ MACH_NIOS32, TYPE_OP5, OP_PFXIO, FMT_i11, R_ANAL_OP_TYPE_MOV },
{ MACH_NIOS32, TYPE_OP5, OP_PFX, FMT_i11, R_ANAL_OP_TYPE_MOV },
{ MACH_NIOS32, TYPE_OP8, OP_SAVE, FMT_i8v, R_ANAL_OP_TYPE_PUSH },
{ MACH_NIOS32, TYPE_OP8, OP_TRAP, FMT_i6v, R_ANAL_OP_TYPE_TRAP },
{ MACH_NIOS32, TYPE_OP9, OP_EXT8S, FMT_Ri1u, R_ANAL_OP_TYPE_MOV },
{ MACH_NIOS32, TYPE_OP9, OP_EXT16S, FMT_Ri1u, R_ANAL_OP_TYPE_MOV },
{ MACH_NIOS32, TYPE_OP9, OP_ST8S, FMT_Ri1u, R_ANAL_OP_TYPE_STORE },
{ MACH_NIOS32, TYPE_OP9, OP_ST16S, FMT_Ri1u, R_ANAL_OP_TYPE_STORE },
{ MACH_NIOS32, TYPE_OP11, OP_NOT, FMT_Rw, R_ANAL_OP_TYPE_NOT },
{ MACH_NIOS32, TYPE_OP11, OP_NEG, FMT_Rw, R_ANAL_OP_TYPE_SUB },
{ MACH_NIOS32, TYPE_OP11, OP_ABS, FMT_Rw, R_ANAL_OP_TYPE_ABS },
{ MACH_NIOS32, TYPE_OP11, OP_SEXT8, FMT_Rw, R_ANAL_OP_TYPE_MOV },
{ MACH_NIOS32, TYPE_OP11, OP_SEXT16, FMT_Rw, R_ANAL_OP_TYPE_MOV },
{ MACH_NIOS32, TYPE_OP11, OP_RLC, FMT_Rw, R_ANAL_OP_TYPE_ROL },
{ MACH_NIOS32, TYPE_OP11, OP_RRC, FMT_Rw, R_ANAL_OP_TYPE_ROR },
{ MACH_NIOS32, TYPE_OP11, OP_TRET, FMT_Rw, R_ANAL_OP_TYPE_UJMP },
{ MACH_NIOS32, TYPE_OP11, OP_RESTORE, FMT_w, R_ANAL_OP_TYPE_POP },
{ MACH_NIOS32, TYPE_OP11, OP_ST8D, FMT_Rw, R_ANAL_OP_TYPE_STORE },
{ MACH_NIOS32, TYPE_OP11, OP_ST16D, FMT_Rw, R_ANAL_OP_TYPE_STORE },
{ MACH_NIOS32, TYPE_OP11, OP_FILL8, FMT_Rw, R_ANAL_OP_TYPE_MOV },
{ MACH_NIOS32, TYPE_OP11, OP_FILL16, FMT_Rw, R_ANAL_OP_TYPE_MOV },
{ MACH_NIOS32, TYPE_OP11, OP_SKPRZ, FMT_Rw, R_ANAL_OP_TYPE_CJMP },
{ MACH_NIOS32, TYPE_OP11, OP_SKPS, FMT_Rw, R_ANAL_OP_TYPE_CJMP },
{ MACH_NIOS32, TYPE_OP11, OP_WRCTL, FMT_Rw, R_ANAL_OP_TYPE_MOV },
{ MACH_NIOS32, TYPE_OP11, OP_RDCTL, FMT_Rw, R_ANAL_OP_TYPE_MOV },
{ MACH_NIOS32, TYPE_OP11, OP_SKPRNZ, FMT_Rw, R_ANAL_OP_TYPE_CJMP },
{ MACH_NIOS32, TYPE_OP11, OP_JMP, FMT_Rw, R_ANAL_OP_TYPE_JMP },
{ MACH_NIOS32, TYPE_OP11, OP_CALL, FMT_Rw, R_ANAL_OP_TYPE_CALL },
{ MACH_NIOS32, TYPE_OP11, OP_SWAP, FMT_Rw, R_ANAL_OP_TYPE_MOV },
{ MACH_NIOS32, TYPE_OP11, OP_USR1, FMT_Rw, R_ANAL_OP_TYPE_IO },
{ MACH_NIOS32, TYPE_OP11, OP_USR2, FMT_Rw, R_ANAL_OP_TYPE_IO },
{ MACH_NIOS32, TYPE_OP11, OP_USR3, FMT_Rw, R_ANAL_OP_TYPE_IO },
{ MACH_NIOS32, TYPE_OP11, OP_USR4, FMT_Rw, R_ANAL_OP_TYPE_IO },
{ MACH_NIOS32, TYPE_OP11, OP_MSTEP, FMT_Rw, R_ANAL_OP_TYPE_MUL },
{ MACH_NIOS32, TYPE_OP11, OP_MUL, FMT_Rw, R_ANAL_OP_TYPE_MUL }
};
struct nios_info {
HtPP *ops;
};
static struct nios_info *nios;
static const char *nios16_reg_profile = \
"=SR ctl0\n"
"=PC pc\n"
"=SP r14\n"
"=LR r15\n"
"=BP r30\n"
/* control registers */
"gpr ctl0 .16 0 0\n"
"gpr ctl1 .16 2 0\n"
"gpr ctl2 .16 4 0\n"
"gpr ctl3 .16 6 0\n"
"gpr ctl4 .16 8 0\n"
"gpr ctl5 .16 10 0\n"
"gpr ctl6 .16 12 0\n"
"gpr ctl7 .16 14 0\n"
"gpr ctl8 .16 16 0\n"
"gpr ctl9 .16 18 0\n"
"gpr pc .16 20 0\n"
"gpr k .16 22 0\n"
/* r0-r7 are global (g0-g7) */
"gpr r0 .16 24 0\n"
"gpr r1 .16 26 0\n"
"gpr r2 .16 28 0\n"
"gpr r3 .16 30 0\n"
"gpr r4 .16 32 0\n"
"gpr r5 .16 34 0\n"
"gpr r6 .16 36 0\n"
"gpr r7 .16 38 0\n"
/* r8-15 are out (o0-o7) */
"gpr r8 .16 40 0\n"
"gpr r9 .16 42 0\n"
"gpr r10 .16 44 0\n"
"gpr r11 .16 46 0\n"
"gpr r12 .16 48 0\n"
"gpr r13 .16 50 0\n"
"gpr r14 .16 52 0\n"
"gpr r15 .16 54 0\n"
/* r16-23 are local (l0-l7) */
"gpr r16 .16 56 0\n"
"gpr r17 .16 58 0\n"
"gpr r18 .16 60 0\n"
"gpr r19 .16 62 0\n"
"gpr r20 .16 64 0\n"
"gpr r21 .16 66 0\n"
"gpr r22 .16 68 0\n"
"gpr r23 .16 70 0\n"
/* r24-31 are in (i0-i7) */
"gpr r24 .16 72 0\n"
"gpr r25 .16 74 0\n"
"gpr r26 .16 76 0\n"
"gpr r27 .16 78 0\n"
"gpr r28 .16 80 0\n"
"gpr r29 .16 82 0\n"
"gpr r30 .16 84 0\n"
"gpr r31 .16 86 0\n";
static const char *nios32_reg_profile = \
"=SR ctl0\n"
"=PC pc\n"
"=SP r14\n"
"=LR r15\n"
"=BP r30\n"
/* control registers */
"gpr ctl0 .32 0 0\n"
"gpr ctl1 .32 4 0\n"
"gpr ctl2 .32 8 0\n"
"gpr ctl3 .32 12 0\n"
"gpr ctl4 .32 16 0\n"
"gpr ctl5 .32 20 0\n"
"gpr ctl6 .32 24 0\n"
"gpr ctl7 .32 28 0\n"
"gpr ctl8 .32 32 0\n"
"gpr ctl9 .32 36 0\n"
"gpr pc .32 40 0\n"
"gpr k .16 44 0\n"
/* r0-r7 are global (g0-g7) */
"gpr r0 .32 48 0\n"
"gpr r1 .32 52 0\n"
"gpr r2 .32 56 0\n"
"gpr r3 .32 60 0\n"
"gpr r4 .32 64 0\n"
"gpr r5 .32 68 0\n"
"gpr r6 .32 72 0\n"
"gpr r7 .32 76 0\n"
/* r8-15 are out (o0-o7) */
"gpr r8 .32 80 0\n"
"gpr r9 .32 84 0\n"
"gpr r10 .32 88 0\n"
"gpr r11 .32 92 0\n"
"gpr r12 .32 96 0\n"
"gpr r13 .32 100 0\n"
"gpr r14 .32 104 0\n"
"gpr r15 .32 108 0\n"
/* r16-23 are local (l0-l7) */
"gpr r16 .32 112 0\n"
"gpr r17 .32 116 0\n"
"gpr r18 .32 120 0\n"
"gpr r19 .32 124 0\n"
"gpr r20 .32 128 0\n"
"gpr r21 .32 132 0\n"
"gpr r22 .32 136 0\n"
"gpr r23 .32 140 0\n"
/* r24-31 are in (i0-i7) */
"gpr r24 .32 144 0\n"
"gpr r25 .32 148 0\n"
"gpr r26 .32 152 0\n"
"gpr r27 .32 156 0\n"
"gpr r28 .32 160 0\n"
"gpr r29 .32 164 0\n"
"gpr r30 .32 168 0\n"
"gpr r31 .32 172 0\n";
static int parse_insn(enum mach_attr mach, ut16 insn, struct insn_op **op, struct insn_fields *f) {
ut16 insns[TYPE_OPS] = {
f_op6(insn),
f_op9(insn),
f_op8(insn),
f_op11(insn),
f_op5(insn),
f_op4(insn),
f_op3(insn),
};
bool found;
int opcode;
for (int type = TYPE_OP6; type < TYPE_OPS; type++) {
r_strf_var (key, 128, "%d %d %d", mach, type, insns[type]);
*op = ht_pp_find(nios->ops, key, &found);
if (found) {
opcode = (*op)->opcode;
break;
}
}
if (!found) {
return -1;
}
switch ((*op)->format) {
case FMT_RR:
f->op6 = f_op6(insn);
f->B = f_B(insn);
f->A = f_A(insn);
break;
case FMT_Ri5:
f->op6 = f_op6(insn);
f->IMM5 = f_IMM5(insn);
f->A = f_A(insn);
break;
case FMT_Ri4:
f->op6 = f_op6(insn);
f->IMM4 = f_IMM4(insn);
f->A = f_A(insn);
break;
case FMT_RPi5:
f->op4 = f_op4(insn);
f->P = f_P(insn);
f->B = f_B(insn);
f->A = f_A(insn);
break;
case FMT_Ri6:
f->op5 = f_op5(insn);
f->IMM6 = f_IMM6(insn);
f->A = f_A(insn);
break;
case FMT_Ri8:
f->op3 = f_op3(insn);
f->IMM8 = f_IMM8(insn);
f->A = f_A(insn);
break;
case FMT_i9:
f->op6 = f_op6(insn);
f->IMM9 = f_IMM9(insn);
break;
case FMT_i10:
f->op6 = f_op6(insn);
f->IMM10 = f_IMM10(insn);
break;
case FMT_i11:
f->op5 = f_op5(insn);
f->IMM11 = f_IMM11(insn);
break;
case FMT_Ri1u:
f->op6 = f_op6(insn);
f->op3u = f_op3u(insn);
f->IMM1u = f_IMM1u(insn);
f->A = f_A(insn);
break;
case FMT_Ri2u:
f->op6 = f_op6(insn);
f->op3u = f_op3u(insn);
f->IMM2u = f_IMM2u(insn);
f->A = f_A(insn);
break;
case FMT_i8v:
f->op6 = f_op6(insn);
f->op2v = f_op2v(insn);
f->IMM8v = f_IMM8v(insn);
break;
case FMT_i6v:
f->op6 = f_op6(insn);
f->op2v = f_op2v(insn);
f->IMM6v = f_IMM6v(insn);
break;
case FMT_Rw:
f->op6 = f_op6(insn);
f->op5w = f_op5w(insn);
f->A = f_A(insn);
break;
case FMT_i4w:
f->op6 = f_op6(insn);
f->op5w = f_op5w(insn);
f->IMM4w = f_IMM4w(insn);
break;
case FMT_w:
f->op6 = f_op6(insn);
f->op5w = f_op5w(insn);
break;
default:
break;
}
return opcode;
}
static void nios16_anal(RAnalOp *op, ut16 opcode, enum insn_type type, struct insn_fields *f) {
if (type == TYPE_OP6) {
switch (opcode) {
case OP_ADD:
case OP_ADDI:
case OP_SUB:
case OP_SUBI:
case OP_CMP:
case OP_CMPI:
case OP_LSL:
case OP_LSLI:
case OP_LSR:
case OP_LSRI:
case OP_ASR:
case OP_ASRI:
case OP_MOV:
case OP_MOVI:
case OP_AND:
case OP_ANDN:
case OP_OR:
case OP_XOR:
case OP_BGEN:
case OP_EXT8D:
case OP_SKP0:
case OP_SKP1:
case OP_LD:
case OP_ST:
case OP_STS8S:
case OP_ADDC:
case OP_SUBC:
case OP_USR0:
default:
break;
}
} else if (type == TYPE_OP3) {
switch (opcode) {
case OP_STS:
case OP_LDS:
default:
break;
}
} else if (type == TYPE_OP4) {
switch (opcode) {
case OP_STP:
case OP_LDP:
default:
break;
}
} else if (type == TYPE_OP5) {
switch (opcode) {
case OP_BR:
case OP_BSR:
op->jump = op->addr + ((f->IMM11 + 1) * 2);
break;
case OP_PFX:
default:
break;
}
} else if (type == TYPE_OP8) {
switch (opcode) {
case OP_SAVE:
case OP_TRAP:
break;
}
} else if (type == TYPE_OP9) {
switch (opcode) {
case OP_EXT8S:
case OP_ST8S:
default:
break;
}
} else if (type == TYPE_OP11) {
switch (opcode) {
case OP_NOT:
case OP_NEG:
case OP_ABS:
case OP_SEXT8:
case OP_RLC:
case OP_RRC:
case OP_TRET:
case OP_RESTORE:
case OP_ST8D:
case OP_FILL8:
case OP_SKPRZ:
case OP_SKPS:
case OP_WRCTL:
case OP_RDCTL:
case OP_SKPRNZ:
case OP_JMP:
case OP_CALL:
case OP_SWAP:
case OP_USR1:
case OP_USR2:
case OP_USR3:
case OP_USR4:
default:
break;
}
}
}
static void nios32_anal(RAnalOp *op, ut16 opcode, enum insn_type type, struct insn_fields *f) {
if (type == TYPE_OP6) {
switch (opcode) {
case OP_ADD:
case OP_ADDI:
case OP_SUB:
case OP_SUBI:
case OP_CMP:
case OP_CMPI:
case OP_LSL:
case OP_LSLI:
case OP_LSR:
case OP_LSRI:
case OP_ASR:
case OP_ASRI:
case OP_MOV:
case OP_MOVI:
case OP_AND:
case OP_ANDN:
case OP_OR:
case OP_XOR:
case OP_BGEN:
case OP_EXT8D:
case OP_SKP0:
case OP_SKP1:
case OP_LD:
case OP_ST:
case OP_STS8S:
case OP_STS16S:
case OP_EXT16D:
case OP_MOVHI:
case OP_USR0:
default:
break;
}
} else if (type == TYPE_OP3) {
switch (opcode) {
case OP_STS:
case OP_LDS:
default:
break;
}
} else if (type == TYPE_OP4) {
switch (opcode) {
case OP_STP:
case OP_LDP:
default:
break;
}
} else if (type == TYPE_OP5) {
switch (opcode) {
case OP_BR:
case OP_BSR:
op->jump = op->addr + ((f->IMM11 + 1) * 2);
break;
case OP_PFXIO:
case OP_PFX:
default:
break;
}
} else if (type == TYPE_OP8) {
switch (opcode) {
case OP_SAVE:
case OP_TRAP:
default:
break;
}
} else if (type == TYPE_OP9) {
switch (opcode) {
case OP_EXT8S:
case OP_EXT16S:
case OP_ST8S:
case OP_ST16S:
default:
break;
}
} else if (type == TYPE_OP11) {
switch (opcode) {
case OP_NOT:
case OP_NEG:
case OP_ABS:
case OP_SEXT8:
case OP_SEXT16:
case OP_RLC:
case OP_RRC:
case OP_TRET:
case OP_RESTORE:
case OP_ST8D:
case OP_ST16D:
case OP_FILL8:
case OP_FILL16:
case OP_SKPRZ:
case OP_SKPS:
case OP_WRCTL:
case OP_RDCTL:
case OP_SKPRNZ:
case OP_JMP:
case OP_CALL:
case OP_SWAP:
case OP_USR1:
case OP_USR2:
case OP_USR3:
case OP_USR4:
case OP_MSTEP:
case OP_MUL:
default:
break;
}
}
}
static int nios_op(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *data, int len, RAnalOpMask mask) {
if (!op) {
return -1;
}
memset(op, 0, sizeof (RAnalOp));
op->size = CGEN_MAX_INSN_SIZE;
op->addr = addr;
op->type = R_ANAL_OP_TYPE_UNK;
enum mach_attr arch;
void (*nios_anal)(RAnalOp *, ut16, enum insn_type, struct insn_fields *);
if (a->bits == 16) {
arch = MACH_NIOS16;
nios_anal = &nios16_anal;
} else {
arch = MACH_NIOS32;
nios_anal = &nios32_anal;
}
ut16 insn;
insn = r_read_ble16(data, a->big_endian);
struct insn_op *insn_op;
struct insn_fields insn_fields = { 0 };
int opcode;
opcode = parse_insn(arch, insn, &insn_op, &insn_fields);
if (opcode >= 0) {
op->type = insn_op->r_op_type;
(*nios_anal)(op, opcode, insn_op->type, &insn_fields);
}
return op->size;
}
static bool set_reg_profile(RAnal *a) {
const char *nios_reg_profile;
if (a->bits == 16) {
nios_reg_profile = nios16_reg_profile;
} else {
nios_reg_profile = nios32_reg_profile;
}
return r_reg_set_profile_string(a->reg, nios_reg_profile);
}
static void nios_free_kv(HtPPKv *kv) {
if (kv && kv->key) {
free(kv->key);
}
}
static int nios_init(void *user) {
if (!nios) {
nios = calloc(1, sizeof (*nios));
nios->ops = ht_pp_new(NULL, nios_free_kv, NULL);
if (!nios->ops) {
return -1;
}
}
for (int i = 0; i < INSN_OPS_MAX; i++) {
const struct insn_op *op = &insn_ops[i];
r_strf_var (key, 64, "%d %d %d", op->mach, op->type, op->opcode);
ht_pp_insert(nios->ops, key, (void *) op);
}
return 0;
}
static int nios_fini(void *user) {
if (nios && nios->ops) {
ht_pp_free(nios->ops);
}
if (nios) {
free(nios);
}
return 0;
}
RAnalPlugin r_anal_plugin_nios = {
.name = "nios",
.desc = "Altera Nios code analysis plugin",
.license = "LGPL3",
.arch = "nios",
.bits = 16 | 32,
.esil = false,
.init = &nios_init,
.fini = &nios_fini,
.op = &nios_op,
.cmd_ext = NULL,
.set_reg_profile = &set_reg_profile,
};
#ifndef CORELIB
RLibStruct radare_plugin = {
.type = R_LIB_TYPE_ANAL,
.data = &r_anal_plugin_nios,
.version = R2_VERSION
};
#endif
+207
View File
@@ -0,0 +1,207 @@
/* rl78 plugin by pancake, using binutils ripped code from 2022 */
#include <string.h>
#include <r_types.h>
#include <r_lib.h>
#include <r_asm.h>
#include <r_anal.h>
#include <sdb.h>
#include "disas-asm.h"
#include "../arch/rl78/rl78-decode.c"
#include "../arch/rl78/rl78-dis.c"
static const char *rl78_reg_profile = \
"=SR ctl0\n"
"=PC pc\n"
"=SP r14\n"
"=LR r15\n"
"=BP r30\n"
/* control registers */
"gpr ctl0 .16 0 0\n"
"gpr ctl1 .16 2 0\n"
"gpr ctl2 .16 4 0\n"
"gpr ctl3 .16 6 0\n"
"gpr ctl4 .16 8 0\n"
"gpr ctl5 .16 10 0\n"
"gpr ctl6 .16 12 0\n"
"gpr ctl7 .16 14 0\n"
"gpr ctl8 .16 16 0\n"
"gpr ctl9 .16 18 0\n"
"gpr pc .16 20 0\n"
"gpr k .16 22 0\n"
/* r0-r7 are global (g0-g7) */
"gpr r0 .16 24 0\n"
"gpr r1 .16 26 0\n"
"gpr r2 .16 28 0\n"
"gpr r3 .16 30 0\n"
"gpr r4 .16 32 0\n"
"gpr r5 .16 34 0\n"
"gpr r6 .16 36 0\n"
"gpr r7 .16 38 0\n"
/* r8-15 are out (o0-o7) */
"gpr r8 .16 40 0\n"
"gpr r9 .16 42 0\n"
"gpr r10 .16 44 0\n"
"gpr r11 .16 46 0\n"
"gpr r12 .16 48 0\n"
"gpr r13 .16 50 0\n"
"gpr r14 .16 52 0\n"
"gpr r15 .16 54 0\n"
/* r16-23 are local (l0-l7) */
"gpr r16 .16 56 0\n"
"gpr r17 .16 58 0\n"
"gpr r18 .16 60 0\n"
"gpr r19 .16 62 0\n"
"gpr r20 .16 64 0\n"
"gpr r21 .16 66 0\n"
"gpr r22 .16 68 0\n"
"gpr r23 .16 70 0\n"
/* r24-31 are in (i0-i7) */
"gpr r24 .16 72 0\n"
"gpr r25 .16 74 0\n"
"gpr r26 .16 76 0\n"
"gpr r27 .16 78 0\n"
"gpr r28 .16 80 0\n"
"gpr r29 .16 82 0\n"
"gpr r30 .16 84 0\n"
"gpr r31 .16 86 0\n";
static const char *rl7832_reg_profile = \
"=SR ctl0\n"
"=PC pc\n"
"=SP r14\n"
"=LR r15\n"
"=BP r30\n"
/* control registers */
"gpr ctl0 .32 0 0\n"
"gpr ctl1 .32 4 0\n"
"gpr ctl2 .32 8 0\n"
"gpr ctl3 .32 12 0\n"
"gpr ctl4 .32 16 0\n"
"gpr ctl5 .32 20 0\n"
"gpr ctl6 .32 24 0\n"
"gpr ctl7 .32 28 0\n"
"gpr ctl8 .32 32 0\n"
"gpr ctl9 .32 36 0\n"
"gpr pc .32 40 0\n"
"gpr k .16 44 0\n"
/* r0-r7 are global (g0-g7) */
"gpr r0 .32 48 0\n"
"gpr r1 .32 52 0\n"
"gpr r2 .32 56 0\n"
"gpr r3 .32 60 0\n"
"gpr r4 .32 64 0\n"
"gpr r5 .32 68 0\n"
"gpr r6 .32 72 0\n"
"gpr r7 .32 76 0\n"
/* r8-15 are out (o0-o7) */
"gpr r8 .32 80 0\n"
"gpr r9 .32 84 0\n"
"gpr r10 .32 88 0\n"
"gpr r11 .32 92 0\n"
"gpr r12 .32 96 0\n"
"gpr r13 .32 100 0\n"
"gpr r14 .32 104 0\n"
"gpr r15 .32 108 0\n"
/* r16-23 are local (l0-l7) */
"gpr r16 .32 112 0\n"
"gpr r17 .32 116 0\n"
"gpr r18 .32 120 0\n"
"gpr r19 .32 124 0\n"
"gpr r20 .32 128 0\n"
"gpr r21 .32 132 0\n"
"gpr r22 .32 136 0\n"
"gpr r23 .32 140 0\n"
/* r24-31 are in (i0-i7) */
"gpr r24 .32 144 0\n"
"gpr r25 .32 148 0\n"
"gpr r26 .32 152 0\n"
"gpr r27 .32 156 0\n"
"gpr r28 .32 160 0\n"
"gpr r29 .32 164 0\n"
"gpr r30 .32 168 0\n"
"gpr r31 .32 172 0\n";
static unsigned long Offset = 0;
static RStrBuf *buf_global = NULL;
static const ut8 *bytes = NULL;
static int bytes_size = 0;
static int rl78_buffer_read_memory(bfd_vma memaddr, bfd_byte *myaddr, ut32 length, struct disassemble_info *info) {
int delta = (memaddr - Offset);
if (delta < 0) {
return -1; // disable backward reads
}
memcpy (myaddr, bytes + delta, R_MIN (length, bytes_size));
return 0;
}
static int symbol_at_address(bfd_vma addr, struct disassemble_info *info) {
return 0;
}
static void memory_error_func(int status, bfd_vma memaddr, struct disassemble_info *info) {
//--
}
DECLARE_GENERIC_PRINT_ADDRESS_FUNC()
DECLARE_GENERIC_FPRINTF_FUNC()
static int rl78_op(RAnal *a, RAnalOp *op, ut64 addr, const ut8 *data, int len, RAnalOpMask mask) {
if (!op) {
return -1;
}
memset (op, 0, sizeof (RAnalOp));
// RL78_ISA_G10
// RL78_ISA_G13
// RL78_ISA_G14
disassemble_info disasm_obj = {0};
memset (&disasm_obj, '\0', sizeof (struct disassemble_info));
buf_global = r_strbuf_new ("");
bytes = data;
bytes_size = len;
Offset = 0; // a->pc;
disasm_obj.buffer = (ut8*)bytes;
disasm_obj.read_memory_func = &rl78_buffer_read_memory;
disasm_obj.symbol_at_address_func = &symbol_at_address;
disasm_obj.memory_error_func = &memory_error_func;
disasm_obj.print_address_func = &generic_print_address_func;
disasm_obj.endian = BFD_ENDIAN_LITTLE;
disasm_obj.fprintf_func = &generic_fprintf_func;
disasm_obj.stream = stdout;
op->size = print_insn_rl78 ((bfd_vma)Offset, &disasm_obj);
int res = print_insn_rl78_common (addr, &disasm_obj, RL78_ISA_DEFAULT);
if (mask & R_ANAL_OP_MASK_DISASM) {
op->mnemonic = r_strbuf_drain (buf_global);
}
op->size = 1; // CGEN_MAX_INSN_SIZE;
op->addr = addr;
op->type = R_ANAL_OP_TYPE_UNK;
return op->size;
}
RAnalPlugin r_anal_plugin_rl78 = {
.name = "rl78",
.desc = "Renesas RL78 8 bit CPU",
.license = "LGPL3",
.arch = "rl78",
.bits = 8,
.esil = false,
.op = &rl78_op,
// .set_reg_profile = &set_reg_profile,
};
#ifndef CORELIB
RLibStruct radare_plugin = {
.type = R_LIB_TYPE_ANAL,
.data = &r_anal_plugin_rl78,
.version = R2_VERSION
};
#endif
+1 -1
View File
@@ -19,7 +19,7 @@ static int aop(RAnal *anal, RAnalOp *aop, ut64 addr, const ut8 *data, int len) {
memset(&disasm_obj, '\0', sizeof(DISASM));
disasm_obj.EIP = (long long)(data);
disasm_obj.VirtualAddr = addr;
disasm_obj.Archi = ((anal->bits == 64) ? 64 : 0);
disasm_obj.Archi = ((anal->config->bits == 64) ? 64 : 0);
disasm_obj.SecurityBlock = 128;
memset(aop, 0, sizeof(RAnalOp));
+790
View File
@@ -0,0 +1,790 @@
/* radare - LGPL - Copyright 2009-2016 - nibble, pancake */
#include <r_lib.h>
#include <r_types.h>
#include <r_anal.h>
#include <r_util.h>
#include "udis86/types.h"
#include "udis86/extern.h"
#include "esil.h"
static st64 getval(ud_operand_t *op);
// XXX Copypasta from udis
#define UD_REG_TAB_SIZE (sizeof (ud_reg_tab)/sizeof (*ud_reg_tab))
static const char* ud_reg_tab[] = {
"al", "cl", "dl", "bl",
"ah", "ch", "dh", "bh",
"spl", "bpl", "sil", "dil",
"r8b", "r9b", "r10b", "r11b",
"r12b", "r13b", "r14b", "r15b",
"ax", "cx", "dx", "bx",
"sp", "bp", "si", "di",
"r8w", "r9w", "r10w", "r11w",
"r12w", "r13w", "r14w", "r15w",
"eax", "ecx", "edx", "ebx",
"esp", "ebp", "esi", "edi",
"r8d", "r9d", "r10d", "r11d",
"r12d", "r13d", "r14d", "r15d",
"rax", "rcx", "rdx", "rbx",
"rsp", "rbp", "rsi", "rdi",
"r8", "r9", "r10", "r11",
"r12", "r13", "r14", "r15",
"es", "cs", "ss", "ds",
"fs", "gs",
"cr0", "cr1", "cr2", "cr3",
"cr4", "cr5", "cr6", "cr7",
"cr8", "cr9", "cr10", "cr11",
"cr12", "cr13", "cr14", "cr15",
"dr0", "dr1", "dr2", "dr3",
"dr4", "dr5", "dr6", "dr7",
"dr8", "dr9", "dr10", "dr11",
"dr12", "dr13", "dr14", "dr15",
"mm0", "mm1", "mm2", "mm3",
"mm4", "mm5", "mm6", "mm7",
"st0", "st1", "st2", "st3",
"st4", "st5", "st6", "st7",
"xmm0", "xmm1", "xmm2", "xmm3",
"xmm4", "xmm5", "xmm6", "xmm7",
"xmm8", "xmm9", "xmm10", "xmm11",
"xmm12","xmm13", "xmm14", "xmm15",
"ymm0", "ymm1", "ymm2", "ymm3",
"ymm4", "ymm5", "ymm6", "ymm7",
"ymm8", "ymm9", "ymm10", "ymm11",
"ymm12","ymm13", "ymm14", "ymm15",
"rip"
};
static int getarg(char *src, struct ud *u, st64 mask, int idx, int regsz) {
ud_operand_t *op = &u->operand[idx];
st64 n;
src[0] = 0;
if (!mask) mask = UT64_MAX;
switch (op->type) {
case UD_OP_PTR:
case UD_OP_CONST:
case UD_OP_JIMM:
case UD_OP_IMM:
n = getval (op) & mask;
//mask = UT64_MAX; // uhm?
if (op->type == UD_OP_JIMM) n += u->pc;
if (n>=0 && n<256)
sprintf (src, "%"PFMT64d, n & mask);
else sprintf (src, "0x%"PFMT64x, n&mask);
break;
case UD_OP_REG:
idx = op->base-UD_R_AL;
if (idx>=0 && idx<UD_REG_TAB_SIZE)
strcpy (src, ud_reg_tab[idx]);
break;
case UD_OP_MEM:
n = getval (op);
// TODO ->scale
if (op->base != UD_NONE) {
idx = op->base-UD_R_AL;
if (idx>=0 && idx<UD_REG_TAB_SIZE) {
sprintf (src, "%s", ud_reg_tab[idx]);
src += strlen (src);
if (op->index != UD_NONE) {
idx = op->index - UD_R_AL;
if (idx >= 0 && idx < UD_REG_TAB_SIZE) {
sprintf (src, ",%d,%s,*,+",
op->scale, ud_reg_tab[idx]);
}
src += strlen (src);
}
if (u->mnemonic == UD_Ilea) {
if ((st16)n>0) sprintf (src, ",%"PFMT64d",+", n);
else if ((st16)n<0) sprintf (src, ",%"PFMT64d",-", UT32_MAX-n);
} else if ((st16)n >= -256 && (st16)n < 256) {
char nb = (char)n;
char absn = ((st16)nb<0)? -nb: nb;
if (n==0) sprintf (src, ",[%d]", regsz);
else sprintf (src, ",%d,%c,[%d]",
absn, nb<0?'-':'+', regsz);
} else {
sprintf (src, ",0x%"PFMT64x",+,[%d]",
mask & n, regsz);
}
} else {
/* If UDis86 works properly, it will never reach this point.
* Only useful for debug purposes ("unknown reg" is clearer
* than an empty string, right?)
*/
}
} else sprintf (src, "0x%"PFMT64x",[%d]", n & mask, regsz);
break;
default:
break;
}
return 0;
}
static st64 getval(ud_operand_t *op) {
int bits = op->size;
switch (op->type) {
case UD_OP_PTR:
return (op->lval.ptr.seg<<4) + (op->lval.ptr.off & 0xFFFF);
default:
break;
}
if (!bits) bits = 32;
if (op->signed_lval) { // TODO: honor sign
switch (bits) {
case 8: return (st64)(char) (op->lval.sbyte);
case 16: return (st64)(short) op->lval.uword;
case 32: return (ut64)(ut32)(op->lval.udword&UT32_MAX);
case 64: return op->lval.uqword;
}
} else {
switch (bits) {
case 8: return (st64)(char)(255-op->lval.sbyte); // XXX?
case 16: return (st64)(short) (op->lval.uword& UT16_MAX);
case 32: return (ut64)(ut32)(op->lval.udword & UT32_MAX);
case 64: return op->lval.uqword;
}
}
return 0LL;
}
int x86_udis86_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *data, int len) {
const char *pc = anal->config->bits==64? "rip": anal->config->bits==32? "eip": "ip";
const char *sp = anal->config->bits==64? "rsp": anal->config->bits==32? "esp": "sp";
const char *bp = anal->config->bits==64? "rbp": anal->config->bits==32? "ebp": "bp";
int delta, oplen, regsz = 4;
char str[64], src[32], dst[32];
struct ud u;
switch (anal->config->bits) {
case 64: regsz = 8; break;
case 16: regsz = 2; break;
default:
case 32: regsz = 4; break;
}
UDis86Esil *handler;
UDis86OPInfo info = {0, anal->config->bits, (1LL << anal->config->bits) - 1, regsz, 0, pc, sp, bp};
memset (op, '\0', sizeof (RAnalOp));
op->addr = addr;
op->jump = op->fail = -1;
op->ptr = op->val = -1;
ud_init (&u);
ud_set_pc (&u, addr);
ud_set_mode (&u, anal->config->bits);
ud_set_syntax (&u, NULL);
ud_set_input_buffer (&u, data, len);
ud_disassemble (&u);
op->id = u.mnemonic;
oplen = op->size = ud_insn_len (&u);
r_strbuf_init (&op->esil);
const bool decode = true;
if (decode && (handler = udis86_esil_get_handler (u.mnemonic))) {
info.oplen = oplen;
//if (anal->bits==32)
info.bitmask = UT32_MAX;
if (handler->argc > 0) {
info.n = getval (u.operand);
getarg (dst, &u, info.bitmask, 0, regsz);
if (handler->argc > 1) {
getarg (src, &u, info.bitmask, 1, regsz);
if (handler->argc > 2)
getarg (str, &u, info.bitmask, 2, regsz);
}
}
handler->callback (&info, op, dst, src, str);
}
#if 0
u->pfx_seg = 0;
u->pfx_opr = 0;
u->pfx_adr = 0;
u->pfx_lock = 0;
u->pfx_repne = 0;
u->pfx_rep = 0;
u->pfx_repe = 0;
u->pfx_rex = 0;
u->pfx_str = 0;
#endif
op->prefix = 0;
if (u.pfx_rep) op->prefix |= R_ANAL_OP_PREFIX_REP;
if (u.pfx_repe) op->prefix |= R_ANAL_OP_PREFIX_REP;
if (u.pfx_repne) op->prefix |= R_ANAL_OP_PREFIX_REPNE;
if (u.pfx_lock) op->prefix |= R_ANAL_OP_PREFIX_LOCK;
switch (u.mnemonic) {
case UD_Iinvalid:
oplen = op->size = -1;
return -1;
break;
case UD_Itest:
case UD_Icmp:
op->type = R_ANAL_OP_TYPE_CMP;
// TODO: support 2nd parameter too?
switch (u.operand[0].type) {
case UD_OP_MEM:
op->refptr = u.operand[0].size /8;
switch (u.operand[0].base) {
case UD_R_RIP:
// Self modifying code? relative local vars
switch (u.operand[1].size) {
case 8:
case 16:
case 32: delta = u.operand[1].lval.udword; break;
case 64: delta = u.operand[1].lval.uqword; break;
default: delta = u.operand[1].lval.udword; break;
}
op->ptr = addr + oplen + delta;
break;
case UD_R_RBP:
op->stackop = R_ANAL_STACK_SET;
op->ptr = getval (&u.operand[0]); //-(st64)u.operand[0].lval.sbyte; //getval (&u.operand[0]);
op->ptr = (st64)((char)u.operand[0].lval.sbyte); //getval (&u.operand[0]);
// if positive = arg
// if negative = var
break;
default:
op->ptr = getval (&u.operand[0]);
break;
}
break;
case UD_OP_IMM:
op->ptr = getval (&u.operand[0]);
default:
break;
}
switch (u.operand[1].type) {
case UD_OP_MEM:
op->refptr = u.operand[0].size /8;
switch (u.operand[1].base) {
case UD_R_RIP:
// Self modifying code? relative local vars
delta = u.operand[1].lval.uword;
op->ptr = addr + oplen + delta;
break;
case UD_R_RBP:
op->stackop = R_ANAL_STACK_SET;
op->ptr = getval (&u.operand[1]); //-(st64)u.operand[0].lval.sbyte; //getval (&u.operand[0]);
op->ptr = (st64)((char)u.operand[1].lval.sbyte); //getval (&u.operand[0]);
// if positive = arg
// if negative = var
break;
default:
op->ptr = getval (&u.operand[1]);
break;
}
break;
case UD_OP_IMM:
op->ptr = getval (&u.operand[0]);
default:
break;
}
break;
case UD_Isalc: // ??
// al = cf
break;
case UD_Ixor:
op->type = R_ANAL_OP_TYPE_XOR;
break;
case UD_Ior:
op->type = R_ANAL_OP_TYPE_OR;
break;
case UD_Iand:
op->type = R_ANAL_OP_TYPE_AND;
break;
case UD_Isar:
op->type = R_ANAL_OP_TYPE_SAR;
break;
// XXX: sal ?!?
case UD_Ishl:
op->type = R_ANAL_OP_TYPE_SHL;
break;
case UD_Ishr:
op->type = R_ANAL_OP_TYPE_SHR;
break;
case UD_Irol:
op->type = R_ANAL_OP_TYPE_ROL;
break;
case UD_Iror:
op->type = R_ANAL_OP_TYPE_ROR;
break;
case UD_Iint1:
case UD_Iint3:
op->type = R_ANAL_OP_TYPE_TRAP;
break;
case UD_Iint:
op->type = R_ANAL_OP_TYPE_SWI;
op->val = u.operand[0].lval.uword;
break;
case UD_Ilea:
case UD_Imov:
op->type = R_ANAL_OP_TYPE_MOV;
switch (u.operand[0].type) {
case UD_OP_MEM:
op->refptr = u.operand[0].size/8;
switch (u.operand[0].base) {
case UD_R_RIP:
// Self modifying code? relative local vars
// op->type == 9
//switch (op->size) {
switch (u.operand[0].size) {
case 8:
case 16:
case 32: delta = u.operand[0].lval.udword; break;
case 64: delta = u.operand[0].lval.uqword; break;
default: delta = u.operand[0].lval.udword; break;
}
op->ptr = addr + oplen + delta;
break;
case UD_R_RBP:
op->stackop = R_ANAL_STACK_SET;
op->ptr = getval (&u.operand[0]); //-(st64)u.operand[0].lval.sbyte; //getval (&u.operand[0]);
// op->ptr = (st64)((char)u.operand[0].lval.sbyte); //getval (&u.operand[0]);
// if positive = arg
// if negative = var
break;
default:
/* nothing to do here yet */
op->ptr = getval (&u.operand[1]);
break;
}
break;
default:
switch (u.operand[1].type) {
case UD_OP_MEM:
op->refptr = u.operand[1].size /8;
switch (u.operand[1].base) {
case UD_R_RIP:
switch (u.operand[1].size) {
case 8:
case 16:
case 32: delta = u.operand[1].lval.udword; break;
case 64: delta = u.operand[1].lval.uqword; break;
default: delta = u.operand[1].lval.udword; break;
}
op->ptr = addr + oplen + delta;
break;
case UD_R_RBP:
op->stackop = R_ANAL_STACK_GET;
op->ptr = getval (&u.operand[1]);
// op->ptr = (st64)((char)u.operand[1].lval.sbyte); //getval (&u.operand[0]);
// if positive = arg
// if negative = var
break;
default:
/* nothing to do here yet */
op->ptr = getval (&u.operand[1]); //-(st64)u.operand[0].lval.sbyte; //getval (&u.operand[0]);
break;
}
break;
default:
op->ptr = getval (&u.operand[1]);
// XX
break;
}
break;
}
op->stackptr = regsz;
break;
case UD_Ipush:
case UD_Ipusha:
case UD_Ipushad:
case UD_Ipushfq:
case UD_Ipushfd:
case UD_Ipushfw:
switch (u.operand[0].type) {
case UD_OP_CONST:
case UD_OP_JIMM:
case UD_OP_IMM:
op->type = R_ANAL_OP_TYPE_PUSH;
op->ptr = getval (&u.operand[0]);
break;
case UD_OP_REG:
case UD_OP_PTR:
case UD_OP_MEM:
default:
op->type = R_ANAL_OP_TYPE_UPUSH;
op->ptr = 0;
break;
}
op->stackop = R_ANAL_STACK_INC;
op->stackptr = regsz;
break;
case UD_Ipop:
case UD_Ipopa:
case UD_Ipopad:
case UD_Ipopfw:
case UD_Ipopfd:
case UD_Ipopfq:
op->type = R_ANAL_OP_TYPE_POP;
op->stackop = R_ANAL_STACK_INC;
op->stackptr = -regsz;
break;
case UD_Ileave:
op->type = R_ANAL_OP_TYPE_MOV;
op->stackop = R_ANAL_STACK_INC;
op->stackptr = -regsz;
break;
case UD_Iadd:
case UD_Isub:
op->type = (u.mnemonic==UD_Iadd)? R_ANAL_OP_TYPE_ADD: R_ANAL_OP_TYPE_SUB;
op->ptr = 0;
op->stackptr = 0;
if (u.operand[0].type == UD_OP_REG) {
if (u.operand[0].base == UD_R_RSP) {
int o = (int)getval (&u.operand[1]);
op->stackop = R_ANAL_STACK_INC;
if (u.mnemonic ==UD_Iadd) {
op->stackptr = -o;
} else {
op->stackptr = o;
}
}
if (u.operand[1].type != UD_OP_REG)
op->val = getval (&u.operand[1]);
}
op->stackptr = 4;
break;
case UD_Iadc:
case UD_Iinc:
op->type = R_ANAL_OP_TYPE_ADD;
break;
case UD_Isbb:
case UD_Idec:
op->type = R_ANAL_OP_TYPE_SUB;
break;
case UD_Ijmp:
switch (u.operand[0].type) {
case UD_OP_MEM:
op->ptr = getval (&u.operand[0]);
op->type = R_ANAL_OP_TYPE_UJMP;
break;
case UD_OP_REG:
op->type = R_ANAL_OP_TYPE_UJMP;
break;
default:
op->type = R_ANAL_OP_TYPE_JMP;
if (u.operand[0].type==UD_OP_PTR) {
op->jump = getval (&u.operand[0]);
} else {
if (anal->config->bits==16) {
// honor segment
op->jump = (addr&0xf0000) + oplen + \
((((addr&0xffff)+getval (&u.operand[0]))&0xffff));
} else {
op->jump = addr + oplen + (int)getval (&u.operand[0]);
}
}
}
break;
case UD_Ije:
case UD_Ijne:
case UD_Ijb:
case UD_Ijbe:
case UD_Ija:
case UD_Ijae:
case UD_Ijs:
case UD_Ijns:
case UD_Ijo:
case UD_Ijno:
case UD_Ijp:
case UD_Ijnp:
case UD_Ijl:
case UD_Ijge:
case UD_Ijle:
case UD_Ijg:
case UD_Ijcxz:
case UD_Iloop:
op->type = R_ANAL_OP_TYPE_CJMP;
op->jump = addr + oplen + (int)getval (&u.operand[0]);
op->fail = addr+oplen;
break;
case UD_Icall:
op->type = R_ANAL_OP_TYPE_CALL;
switch (u.operand[0].type) {
case UD_OP_REG:
op->type = R_ANAL_OP_TYPE_UCALL;
op->jump = 0; // EAX, EBX, ... use anal->reg
break;
case UD_OP_PTR:
op->jump = (int)getval (&u.operand[0]);
break;
case UD_OP_IMM:
case UD_OP_MEM:
default:
op->jump = addr + oplen + (int)getval (&u.operand[0]);
}
op->fail = addr + oplen;
break;
case UD_Ihlt:
op->type = R_ANAL_OP_TYPE_TRAP; //HALT;
break;
case UD_Iin:
case UD_Iout:
op->type = R_ANAL_OP_TYPE_IO;
break;
case UD_Iret:
case UD_Iiretd:
case UD_Iretf:
case UD_Isysret:
op->type = R_ANAL_OP_TYPE_RET;
op->stackop = R_ANAL_STACK_INC;
op->stackptr = -regsz;
break;
case UD_Isyscall:
op->type = R_ANAL_OP_TYPE_SWI;
break;
case UD_Inop:
op->type = R_ANAL_OP_TYPE_NOP;
break;
default:
break;
}
return oplen;
}
static int set_reg_profile(RAnal *anal) {
const char *p = NULL;
switch (anal->config->bits) {
case 16: p =
"=PC ip\n"
"=SP sp\n"
"=BP bp\n"
"=A0 ax\n"
"=A1 bx\n"
"=A2 cx\n"
"=A3 di\n"
"gpr ip .16 48 0\n"
"gpr ax .16 24 0\n"
"gpr ah .8 24 0\n"
"gpr al .8 25 0\n"
"gpr bx .16 0 0\n"
"gpr bh .8 1 0\n"
"gpr bl .8 0 0\n"
"gpr cx .16 4 0\n"
"gpr ch .8 5 0\n"
"gpr cl .8 4 0\n"
"gpr dx .16 8 0\n"
"gpr dh .8 9 0\n"
"gpr dl .8 8 0\n"
"gpr sp .16 60 0\n"
"gpr bp .16 20 0\n"
"gpr si .16 12 0\n"
"gpr di .16 16 0\n"
"seg cs .16 52 0\n"
"gpr flags .16 56 0\n"
"gpr cf .1 .448 0\n"
"flg pf .1 .449 0\n"
"flg af .1 .450 0\n"
"gpr zf .1 .451 0\n"
"gpr sf .1 .452 0\n"
"flg tf .1 .453 0\n"
"flg if .1 .454 0\n"
"flg df .1 .455 0\n"
"flg of .1 .456 0\n"
"flg flag_r .1 .457 0\n";
#if 0
"drx dr0 .32 0 0\n"
"drx dr1 .32 4 0\n"
"drx dr2 .32 8 0\n"
"drx dr3 .32 12 0\n"
//"drx dr4 .32 16 0\n"
//"drx dr5 .32 20 0\n"
"drx dr6 .32 24 0\n"
"drx dr7 .32 28 0\n"
#endif
break;
case 32: p =
"=PC eip\n"
"=SP esp\n"
"=BP ebp\n"
"=A0 eax\n"
"=A1 ebx\n"
"=A2 ecx\n"
"=A3 edi\n"
"gpr eip .32 48 0\n"
"gpr ip .16 48 0\n"
"gpr oeax .32 44 0\n"
"gpr eax .32 24 0\n"
"gpr ax .16 24 0\n"
"gpr ah .8 24 0\n"
"gpr al .8 25 0\n"
"gpr ebx .32 0 0\n"
"gpr bx .16 0 0\n"
"gpr bh .8 1 0\n"
"gpr bl .8 0 0\n"
"gpr ecx .32 4 0\n"
"gpr cx .16 4 0\n"
"gpr ch .8 5 0\n"
"gpr cl .8 4 0\n"
"gpr edx .32 8 0\n"
"gpr dx .16 8 0\n"
"gpr dh .8 9 0\n"
"gpr dl .8 8 0\n"
"gpr esp .32 60 0\n"
"gpr sp .16 60 0\n"
"gpr ebp .32 20 0\n"
"gpr bp .16 20 0\n"
"gpr esi .32 12 0\n"
"gpr si .16 12 0\n"
"gpr edi .32 16 0\n"
"gpr di .16 16 0\n"
"seg xfs .32 36 0\n"
"seg xgs .32 40 0\n"
"seg xcs .32 52 0\n"
"seg cs .16 52 0\n"
"seg xss .32 52 0\n"
"gpr eflags .32 56 0 c1p.a.zstido.n.rv\n"
"gpr flags .16 56 0\n"
"gpr cf .1 .448 0\n"
"flg flag_p .1 .449 0\n"
"flg flag_a .1 .450 0\n"
"gpr zf .1 .451 0\n"
"gpr sf .1 .452 0\n"
"flg flag_t .1 .453 0\n"
"flg flag_i .1 .454 0\n"
"flg flag_d .1 .455 0\n"
"flg of .1 .456 0\n"
"flg flag_r .1 .457 0\n"
"drx dr0 .32 0 0\n"
"drx dr1 .32 4 0\n"
"drx dr2 .32 8 0\n"
"drx dr3 .32 12 0\n"
//"drx dr4 .32 16 0\n"
//"drx dr5 .32 20 0\n"
"drx dr6 .32 24 0\n"
"drx dr7 .32 28 0\n";
break;
default: p =
"=PC rip\n"
"=SP rsp\n"
"=BP rbp\n"
"=A0 rax\n"
"=A1 rbx\n"
"=A2 rcx\n"
"=A3 rdx\n"
"# no profile defined for x86-64\n"
"gpr r15 .64 0 0\n"
"gpr r15d .32 0 0\n"
"gpr r15w .16 0 0\n"
"gpr r15b .8 0 0\n"
"gpr r14 .64 8 0\n"
"gpr r14d .32 8 0\n"
"gpr r14w .16 8 0\n"
"gpr r14b .8 8 0\n"
"gpr r13 .64 16 0\n"
"gpr r13d .32 16 0\n"
"gpr r13w .16 16 0\n"
"gpr r13b .8 16 0\n"
"gpr r12 .64 24 0\n"
"gpr r12d .32 24 0\n"
"gpr r12w .16 24 0\n"
"gpr r12b .8 24 0\n"
"gpr rbp .64 32 0\n"
"gpr ebp .32 32 0\n"
"gpr bp .16 32 0\n"
"gpr bpl .8 32 0\n"
"gpr rbx .64 40 0\n"
"gpr ebx .32 40 0\n"
"gpr bx .16 40 0\n"
"gpr bl .8 40 0\n"
"gpr r11 .64 48 0\n"
"gpr r11d .32 48 0\n"
"gpr r11w .16 48 0\n"
"gpr r11b .8 48 0\n"
"gpr r10 .64 56 0\n"
"gpr r10d .32 56 0\n"
"gpr r10w .16 56 0\n"
"gpr r10b .8 56 0\n"
"gpr r9 .64 64 0\n"
"gpr r9d .32 64 0\n"
"gpr r9w .16 64 0\n"
"gpr r9b .8 64 0\n"
"gpr r8 .64 72 0\n"
"gpr r8d .32 72 0\n"
"gpr r8w .16 72 0\n"
"gpr r8b .8 72 0\n"
"gpr rax .64 80 0\n"
"gpr eax .32 80 0\n"
"gpr ax .16 80 0\n"
"gpr al .8 80 0\n"
"gpr rcx .64 88 0\n"
"gpr ecx .32 88 0\n"
"gpr cx .16 88 0\n"
"gpr cl .8 88 0\n"
"gpr rdx .64 96 0\n"
"gpr edx .32 96 0\n"
"gpr dx .16 96 0\n"
"gpr dl .8 96 0\n"
"gpr rsi .64 104 0\n"
"gpr esi .32 104 0\n"
"gpr si .16 104 0\n"
"gpr sil .8 104 0\n"
"gpr rdi .64 112 0\n"
"gpr edi .32 112 0\n"
"gpr di .16 112 0\n"
"gpr dil .8 112 0\n"
"gpr oeax .64 120 0\n"
"gpr rip .64 128 0\n"
"seg cs .64 136 0\n"
//"flg eflags .64 144 0\n"
"gpr eflags .32 144 0 c1p.a.zstido.n.rv\n"
"gpr cf .1 .1152 0\n"
"flg flag_p .1 .1153 0\n"
"flg flag_a .1 .1154 0\n"
"gpr zf .1 .1155 0\n"
"gpr sf .1 .1156 0\n"
"flg flag_t .1 .1157 0\n"
"flg flag_i .1 .1158 0\n"
"flg flag_d .1 .1159 0\n"
"flg of .1 .1160 0\n"
"flg flag_r .1 .1161 0\n"
"gpr rsp .64 152 0\n"
"seg ss .64 160 0\n"
"seg fs_base .64 168 0\n"
"seg gs_base .64 176 0\n"
"seg ds .64 184 0\n"
"seg es .64 192 0\n"
"seg fs .64 200 0\n"
"seg gs .64 208 0\n"
"drx dr0 .32 0 0\n"
"drx dr1 .32 4 0\n"
"drx dr2 .32 8 0\n"
"drx dr3 .32 12 0\n"
"drx dr6 .32 24 0\n"
"drx dr7 .32 28 0\n";
break;
}
return r_reg_set_profile_string (anal->reg, p);
}
RAnalPlugin r_anal_plugin_x86_udis = {
.name = "x86.udis",
.desc = "X86 analysis plugin (udis86 backend)",
.license = "LGPL3",
.arch = "x86",
.esil = true,
.bits = 16|32|64,
.op = &x86_udis86_op,
.set_reg_profile = &set_reg_profile,
};
#ifndef CORELIB
RLibStruct radare_plugin = {
.type = R_LIB_TYPE_ANAL,
.data = &r_anal_plugin_x86_udis,
.version = R2_VERSION
};
#endif
+10
View File
@@ -0,0 +1,10 @@
OBJ_ATOMBIOS=anal_atombios.o
OBJ_ATOMBIOS+=../../asm/arch/atombios/atombios.o
STATIC_OBJ+=${OBJ_ATOMBIOS}
TARGET_ATOMBIOS=anal_atombios.${LIBEXT}
ALL_TARGETS+=${TARGET_ATOMBIOS}
${TARGET_ATOMBIOS}: ${OBJ_ATOMBIOS}
${CC} -g $(call libname,anal_atombios) ${LDFLAGS} ${CFLAGS} -o anal_atombios.${LIBEXT} ${OBJ_ATOMBIOS}
+16
View File
@@ -0,0 +1,16 @@
OBJ_BA2=anal_ba2.o
STATIC_OBJ+=${OBJ_BA2}
TARGET_BA2=anal_ba2.${LIBEXT}
ALL_TARGETS+=${TARGET_BA2}
CFLAGS_BA2=$(R2_CFLAGS)
CFLAGS_BA2+=-I../../asm/arch/ba2
CFLAGS_BA2+=-Wall -shared -fPIC ${LDFLAGS_LIB}
$(OBJ_BA2): %.o : %.c
$(CC) -c $(CFLAGS_BA2) $< -o $@
${TARGET_BA2}: ${OBJ_BA2}
${CC} $(call libname,anal_ba2) ${LDFLAGS} ${CFLAGS_BA2} -o ${TARGET_BA2} ${OBJ_BA2}
+262
View File
@@ -0,0 +1,262 @@
/* radare - LGPL - Copyright 2013-2018 - batchdrake */
#include <r_lib.h>
#include <r_types.h>
#include <r_anal.h>
#include <r_util.h>
#include "udis86/types.h"
#include "udis86/extern.h"
#include "esil_x86_udis.h"
#define RPN
RPN UDIS86_ESIL (nop, ",");
RPN UDIS86_ESIL (jo, "of,?{,%s,%s,=,}", dst, info->pc);
RPN UDIS86_ESIL (jno, "of,!,?{,%s,%s,}", dst, info->pc);
RPN UDIS86_ESIL (jb, "cf,?{,%s,%s,=,}", dst, info->pc);
RPN UDIS86_ESIL (jae, "cf,?{,%s,%s,=,}", dst, info->pc);
// UDIS86_ESIL (je, "?zf,%s=%s", info->pc, dst);
RPN UDIS86_ESIL (je, "zf,?{,%s,%s,=,}", dst, info->pc);
// UDIS86_ESIL (jne, "?!zf,%s=%s", info->pc, dst);
RPN UDIS86_ESIL (jne, "zf,!,?{,%s,%s,=,}", dst, info->pc);
RPN UDIS86_ESIL (ja, "cf,!,zf,!,&,?{,%s,%s,}",dst, info->pc);
RPN UDIS86_ESIL (jbe, "zf,cf,&,?{,%s,%s,=,}", dst, info->pc);
RPN UDIS86_ESIL (js, "sf,?{,%s,%s,=,}", dst, info->pc);
RPN UDIS86_ESIL (jns, "sf,!,?{,%s,%s,=,}", dst, info->pc);
RPN UDIS86_ESIL (jp, "pf,?{,%s,%s,=,}", dst, info->pc);
RPN UDIS86_ESIL (jnp, "pf,!,?{,%s,%s,=,}", dst, info->pc);
RPN UDIS86_ESIL (jl, "of,sf,^,?{,%s,%s,}", dst, info->pc);
RPN UDIS86_ESIL (jge, "of,!,sf,^,?{,%s,%s,}", dst, info->pc);
RPN UDIS86_ESIL (jle, "of,sf,^,zf,|,%s,%s,=", dst, info->pc);
RPN UDIS86_ESIL (jg, "sf,of,!,^,zf,!,&,?{,%s,%s,=,}", dst, info->pc);
RPN UDIS86_ESIL (jcxz, "cx,!,?{,%s,%s,=,}", dst, info->pc);
RPN UDIS86_ESIL (jecxz, "ecx,!,?{,%s,%s,=,}", dst, info->pc);
RPN UDIS86_ESIL (jrcxz, "rcx,!,?{,%s,%s,=,}", dst, info->pc);
// UDIS86_ESIL (jmp, "%s=%s", info->pc, dst);
RPN UDIS86_ESIL (jmp, "%s,%s,=", dst, info->pc);
RPN UDIS86_ESIL (call,
"%d,%s,+,"
"%d,%s,-=,%s,"
"=[],"
"%s,%s,=",
5, info->pc,
info->regsz, info->sp, info->sp,
dst, info->pc);
RPN UDIS86_ESIL (hlt, "hlt,TODO");
RPN UDIS86_ESIL (shl, "%s,%s,<<=,cz,$z,zf,=", src, dst);
RPN UDIS86_ESIL (shr, "%s,%s,>>=,cz,$z,zf,=", src, dst);
RPN UDIS86_ESIL (salc, "%s,%s,<<=,$z,zf,=", src, dst);
RPN UDIS86_ESIL (sar, "%s,%s,>>=,$z,zf,=", src, dst);
RPN UDIS86_ESIL (rol, "%s,%s,<<<=", src, dst);
RPN UDIS86_ESIL (ror, "%s,%s,>>>=", src, dst);
#if 0
RPN UDIS86_ESIL (rol, "%s,1,<<,%s,&,cf,=,%s,%s,>>=,%s,zf,=", src, dst, src, dst, dst)
RPN UDIS86_ESIL (ror, "%s,%d,-,1,<<,%s,&,cf,=,%s,%s,>>=,%s,zf,=", src, info->regsz*8, dst, src, dst, dst)
// UDIS86_ESIL (rol, "cf=%s&(1<<%s),%s>>=%s,zf=%s==0", dst, src, dst, src, dst);
UDIS86_ESIL (ror, "cf=%s&(1<<%d-%s),%s<<<=%s,zf=%s==0", dst, info->regsz * 8, src, dst, src, dst);
#endif
// UDIS86_ESIL (add, "cf=%s<=-%s&%s!=0,of=!((%s^%s)>>%d)&(((%s+%s)^%s)>>%d),%s+=%s,zf=%s==0,sf=%s>>%d", dst, src, src, dst, src, info->bits - 1, dst, src, src, info->bits - 1, dst, src, dst, dst, info->bits - 1);
// XXX: this is wrong coz add [rax], al -> al,[rax+0],= ;;; this is not valid esil
RPN UDIS86_ESIL (add, "%s,%s,+=", src, dst); //cf=%s<=-%s&%s!=0,of=!((%s^%s)>>%d)&(((%s+%s)^%s)>>%d),%s+=%s,zf=%s==0,sf=%s>>%d", dst, src, src, dst, src, info->bits - 1, dst, src, src, info->bits - 1, dst, src, dst, dst, info->bits - 1);
RPN UDIS86_ESIL (inc, "1,%s,+=,z,$z,zf,=", dst);
RPN UDIS86_ESIL (dec, "1,%s,-=,$z,zf,=,$o,of,=,$s,sf,=", dst);
// UDIS86_ESIL (inc, "of=(%s^(%s+1))>>%d,%s++,zf=%s==0,sf=%s>>%d", dst, dst, info->bits - 1, dst, dst, dst, info->bits - 1);
// UDIS86_ESIL (sub, "cf=%s<%s,of=!((%s^%s)>>%d)&(((%s+%s)^%s)>>%d),%s-=%s,zf=%s==0,sf=%s>>%d", dst, src, dst, src, info->bits - 1, dst, src, src, info->bits - 1, dst, src, dst, dst, info->bits - 1);
RPN UDIS86_ESIL (sub, "%s,%s,-=,$c,cf,=,$z,zf,=,$s,sf,=,$o,of,=", src, dst); // TODO: update flags
// UDIS86_ESIL (dec, "of=(%s^(%s-1))>>%d,%s--,zf=%s==0,sf=%s>>%d", dst, dst, info->bits - 1, dst, dst, dst, info->bits - 1);
// UDIS86_ESIL (cmp, "cf=%s<%s,zf=%s==%s", dst, src, dst, src);
RPN UDIS86_ESIL (cmp, "%s,%s,==,$z,zf,=", dst, src);
// UDIS86_ESIL (xor, "%s^=%s,zf=%s==0,sf=%s>>%d,cf=0,of=0", dst, src, dst, dst, info->bits - 1);
RPN UDIS86_ESIL (xor, "%s,%s,^=", dst, src);
// UDIS86_ESIL (or, "%s|=%s,zf=%s==0,sf=%s>>%d,cf=0,of=0", dst, src, dst, dst, info->bits - 1);
RPN UDIS86_ESIL (or, "%s,%s,|=", src, dst);
// UDIS86_ESIL (and, "%s&=%s,zf=%s==0,sf=%s>>%d,cf=0,of=0", dst, src, dst, dst, info->bits - 1);
RPN UDIS86_ESIL (and, "%s,%s,&=", src, dst);
#if 0
RPN UDIS86_ESIL (and, "%s,%s,&=,%s,!,zf,%s,%d,>>,sf,=,0,cf,=,0,of,=",
src, dst, dst, dst, info->bits-1);
#endif
// UDIS86_ESIL (test, "zf=%s&%s==0,sf=%s>>%d,cf=0,of=0", dst, src, dst, info->bits - 1);
RPN UDIS86_ESIL (test, "%s,%s,==,$z,zf,=", dst, src);
// UDIS86_ESIL (syscall, "$");
RPN UDIS86_ESIL (syscall, "$");
// UDIS86_ESIL (int3, "$3");
RPN UDIS86_ESIL (int3, "3,$");
// UDIS86_ESIL (int, "$0x%"PFMT64x, info->n);
RPN UDIS86_ESIL (int, "0x%"PFMT64x",$", info->n);
RPN UDIS86_ESIL (lea, "%s,%s,=", src, dst);
RPN UDIS86_ESIL (movzx, "%s,%s,=", src, dst); // not working? try 0fb63d55380000
RPN UDIS86_ESIL (mov, "%s,%s,=", src, dst);
// UDIS86_ESIL (push, "%s-=%d,%d[%s]=%s", info->sp, info->regsz, info->regsz, info->sp, dst);
RPN UDIS86_ESIL (push, "%s,%d,%s,-=,%s,=[%d]", dst, info->regsz, info->sp, info->sp, info->regsz);
// UDIS86_ESIL (pop, "%s=%d[%s],%s+=%d", dst, info->regsz, info->sp, info->sp, info->regsz);
RPN UDIS86_ESIL (pop, "%s,[%d],%s,=,%d,%s,+=",
info->sp, info->regsz, dst, info->regsz, info->sp);
RPN UDIS86_ESIL (leave, "%s,%s,=,%s,[%d],%s,%d,%s,-=",
info->bp, info->sp, info->sp, info->regsz, info->bp, info->regsz, info->sp);
RPN UDIS86_ESIL (ret, "%s,[%d],%s,=,%d,%s,+=", info->sp, info->regsz, info->pc, info->regsz, info->sp);
RPN UDIS86_ESIL (iretf, "%s,[%d],%s,=,%d,%s,+=", info->sp, info->regsz, info->pc, info->regsz, info->sp);
RPN UDIS86_ESIL (iretd, "%s,[%d],%s,=,%d,%s,+=", info->sp, info->regsz, info->pc, info->regsz, info->sp);
// UDIS86_ESIL (xchg, "%s^=%s,%s^=%s,%s^=%s", dst, src, src, dst, dst, src);
// TODO: add support for rpnesil tmp regs?
//RPN UDIS86_ESIL (xchg, "%s,%s,^=,%s,%s,^=,%s,%s,^=", src, dst, src, src, dst, dst);
RPN UDIS86_ESIL (xchg, "%s,%s,%s,=,%s,=", dst, src, dst, src);
UDIS86_ESIL (xadd, "%s^=%s,%s^=%s,%s^=%s,cf=%s<=-%s&%s!=0,of=!((%s^%s)>>%d)&(((%s+%s)^%s)>>%d),%s+=%s,zf=%s==0,sf=%s>>%d", dst, src, src, dst, dst, src, dst, src, src, dst, src, info->bits - 1, dst, src, src, info->bits - 1, dst, src, dst, dst, info->bits - 1);
UDIS86_ESIL (bt, "cf=%s&(1<<%d)!=0", dst, (int) info->n);
UDIS86_ESIL (btc, "cf=%s&(1<<%d)!=0,%s^=(1<<%d)", dst, (int) info->n, dst, (int) info->n);
UDIS86_ESIL (bts, "cf=%s&(1<<%d)!=0,%s|=(1<<%d)", dst, (int) info->n, dst, (int) info->n);
UDIS86_ESIL (btr, "cf=%s&(1<<%d)!=0,%s&=!(1<<%d)", dst, (int) info->n, dst, (int) info->n);
// UDIS86_ESIL (clc, "cf=0");
RPN UDIS86_ESIL (clc, "0,cf,=");
RPN UDIS86_ESIL (sti, "1,if,="); // interrupt flag
RPN UDIS86_ESIL (cli, "0,if,="); // interrupt flag
// UDIS86_ESIL (cld, "df=0");
RPN UDIS86_ESIL (std, "1,df,=");
RPN UDIS86_ESIL (cld, "0,df,=");
#define IS16 (info->bits==16)
#define IS32 (info->bits==32)
#define IS64 (info->bits==64)
#define RSZ (IS32?4:IS64?8:2)
RPN UDIS86_ESIL (pushad,
"%s"
",$r,%s,-=,%s,=[]"
",$r,%s,-=,%s,=[]"
",$r,%s,-=,%s,=[]"
",$r,%s,-=,%s,=[]"
",$r,%s,-=,%s,=[]"
",$r,%s,-=,%s,=[]"
",$r,%s,-=,%s,=[]"
",$r,%s,-=,%s,=[]",
IS64?
"rdi,rsi,rbp,rsp,rbx,rdx,rcx,rax"
: "edi,esi,ebp,esp,ebx,edx,ecx,eax",
info->sp, info->sp,
info->sp, info->sp,
info->sp, info->sp,
info->sp, info->sp,
info->sp, info->sp,
info->sp, info->sp,
info->sp, info->sp,
info->sp, info->sp
);
RPN UDIS86_ESIL (pusha,
"%s"
",$r,%s,-=,%s,=[]"
",$r,%s,-=,%s,=[]"
",$r,%s,-=,%s,=[]"
",$r,%s,-=,%s,=[]"
",$r,%s,-=,%s,=[]"
",$r,%s,-=,%s,=[]"
",$r,%s,-=,%s,=[]"
",$r,%s,-=,%s,=[]",
IS64?
"rdi,rsi,rbp,rsp,rbx,rdx,rcx,rax"
: "edi,esi,ebp,esp,ebx,edx,ecx,eax",
info->sp, info->sp,
info->sp, info->sp,
info->sp, info->sp,
info->sp, info->sp,
info->sp, info->sp,
info->sp, info->sp,
info->sp, info->sp,
info->sp, info->sp
);
RPN UDIS86_ESIL (popad,
"%s", IS64?
"rsp,[],rdi,="
",8,rsp,+,[],rsi,="
",16,rsp,+,[],rbp,="
",24,rsp,+,[],rsp,="
",32,rsp,+,[],rbx,="
",40,rsp,+,[],rdx,="
",48,rsp,+,[],rcx,="
",56,rsp,+,[],rax,="
",64,rsp,+="
:
"esp,[],edi,="
",4,esp,+,[],esi,="
",8,esp,+,[],ebp,="
",12,esp,+,[],esp,="
",16,esp,+,[],ebx,="
",20,esp,+,[],edx,="
",24,esp,+,[],ecx,="
",28,esp,+,[],eax,="
",32,esp,+="
);
RPN UDIS86_ESIL (popa,
"%s", IS64?
"rsp,[],rdi,="
",8,rsp,+,[],rsi,="
",16,rsp,+,[],rbp,="
",24,rsp,+,[],rsp,="
",32,rsp,+,[],rbx,="
",40,rsp,+,[],rdx,="
",48,rsp,+,[],rcx,="
",56,rsp,+,[],rax,="
",64,rsp,+="
:
"esp,[],edi,="
",4,esp,+,[],esi,="
",8,esp,+,[],ebp,="
",12,esp,+,[],esp,="
",16,esp,+,[],ebx,="
",20,esp,+,[],edx,="
",24,esp,+,[],ecx,="
",28,esp,+,[],eax,="
",32,esp,+="
);
RPN UDIS86_ESIL (cmc, "cf,!=");
RPN UDIS86_ESIL (into, "of,?{,4,$,}");
RPN UDIS86_ESIL (lahf, "%s,ah,=", info->bits == 16 ? "flags" : (info->bits == 32 ? "eflags" : "rflags"));
RPN UDIS86_ESIL (loop, "1,%s,-=,!,?{%s,%s,=,}",
info->bits == 16 ? "cx" : IS32 ? "ecx" : "rcx",
dst, info->pc);
RPN UDIS86_ESIL (loope, "1,%s,-=,zf,?{,%s,%s,}",
info->bits == 16 ? "cx" : IS32 ? "ecx" : "rcx",
dst, info->pc);
RPN UDIS86_ESIL (loopne, "1,%s,-=,zf,!,?{,%s,%s,}",
info->bits == 16 ? "cx" : IS32 ? "ecx" : "rcx",
dst, info->pc);
#define OP(args, inst) [JOIN (UD_I, inst)] = {args, UDIS86_ESIL_HANDLER (inst)}
/* This is the fastest way I can think about to implement this list of handlers */
UDis86Esil udis86_esil_callback_table[ UD_MAX_MNEMONIC_CODE ] = {
OP (0, nop), OP (1, jo), OP (1, jno), OP (1, jb), OP (1, jae),
OP (1, je), OP (1, jne), OP (1, ja), OP (1, jbe), OP (1, js),
OP (1, jns), OP (1, jp), OP (1, jnp), OP (1, jl), OP (1, jge),
OP (1, jle), OP (1, jg), OP (1, jcxz),OP (1, jecxz),OP (1, jrcxz),
OP (1, jmp), OP (1, call), OP (2, shl), OP (2, rol), OP (2, ror),
OP (2, add), OP (1, inc), OP (2, sub), OP (1, dec), OP (2, cmp),
OP (2, xor), OP (2, or), OP (2, and), OP (2, test), OP (0, syscall),
OP (1, int), OP (2, lea), OP (2, mov), OP (1, push), OP (1, pop),
OP (0, leave),OP (0, ret), OP (2, xchg),OP (2, xadd), OP (2, bt),
OP (2, btc), OP (2, bts), OP (2, btr), OP (0, clc), OP (0, cli),
OP (0, cld), OP (0, cmc), OP (0, int3),OP (0, into), OP (0, lahf),
OP (1, loop), OP (1, loope),OP (1, loopne), OP(2,sar), OP (2, salc)
};
UDis86Esil * udis86_esil_get_handler (enum ud_mnemonic_code code) {
if (!udis86_esil_callback_table[code].callback) {
return NULL;
}
return udis86_esil_callback_table + code;
}
+35
View File
@@ -0,0 +1,35 @@
#ifndef _UDIS86_ESIL_H
#define _UDIS86_ESIL_H
#include "udis86/extern.h"
/* This may be useful for other architectures */
#define esilprintf(op, fmt, ...) r_strbuf_setf (&op->esil, fmt, ##__VA_ARGS__)
#define UDIS86_ESIL_ARGUMENTS const UDis86OPInfo *info, RAnalOp *op, const char *dst, const char *src, const char *src2
typedef struct udis86_op_info {
ut64 n;
int bits;
ut64 bitmask;
int regsz;
int oplen;
const char *pc;
const char *sp;
const char *bp;
} UDis86OPInfo;
typedef struct udis86_esil_t {
int argc;
void (*callback) (UDIS86_ESIL_ARGUMENTS);
} UDis86Esil;
#define _JOIN(a1, a2) a1 ## a2
#define JOIN(a1, a2) _JOIN (a1, a2)
#define UDIS86_ESIL_HANDLER(name) JOIN (JOIN (__x86_, name), _to_esil)
#define UDIS86_ESIL_PROTO(name) void UDIS86_ESIL_HANDLER (name) (UDIS86_ESIL_ARGUMENTS)
#define UDIS86_ESIL(name, fmt, ...) UDIS86_ESIL_PROTO (name) { esilprintf (op, fmt, ##__VA_ARGS__); }
UDis86Esil *udis86_esil_get_handler (enum ud_mnemonic_code);
#endif /* _UDIS86_ESIL_H */
-10
View File
@@ -1,10 +0,0 @@
OBJ_evm=anal_evm.o
CFLAGS+=-I../asm/arch/evm/
STATIC_OBJ+=${OBJ_evm}
TARGET_evm=anal_evm.${LIBEXT}
ALL_TARGETS+=${TARGET_evm}
${TARGET_evm}: ${OBJ_evm} ${SHARED_OBJ}
${CC} $(call libname,anal_evm) ${LDFLAGS} ${CFLAGS} -o ${TARGET_evm} ${OBJ_evm}
+14
View File
@@ -0,0 +1,14 @@
OBJ_NIOS=anal_nios.o
STATIC_OBJ+=${OBJ_NIOS}
TARGET_NIOS=anal_nios.${LIBEXT}
ALL_TARGETS+=${TARGET_NIOS}
CFLAGS+=-I../../asm/arch
CFLAGS+=-I../../asm/arch/include
${TARGET_NIOS}: ${OBJ_NIOS}
${CC} $(call libname,anal_nios) ${LDFLAGS} ${CFLAGS} \
-o anal_nios.${LIBEXT} ${OBJ_NIOS}
+14
View File
@@ -0,0 +1,14 @@
OBJ_RL78=anal_rl78.o
STATIC_OBJ+=${OBJ_RL78}
TARGET_RL78=anal_rl78.${LIBEXT}
ALL_TARGETS+=${TARGET_RL78}
CFLAGS+=-I../../asm/arch
CFLAGS+=-I../../asm/arch/include
${TARGET_RL78}: ${OBJ_RL78}
${CC} $(call libname,anal_rl78) ${LDFLAGS} ${CFLAGS} \
-o anal_rl78.${LIBEXT} ${OBJ_RL78}
+10 -5
View File
@@ -5,11 +5,16 @@ STATIC_OBJ+=${OBJ_X86_BEA}
TARGET_X86_BEA=anal_x86_bea.${LIBEXT}
ALL_TARGETS+=${TARGET_X86_BEA}
CFLAGS+=-I../../asm/arch/x86/bea/
CFLAGS+=-I../../asm/arch/x86/bea/src
CFLAGS+=-I../../asm/arch/x86/bea/include
CFLAGS+=-DUint64=uint64_t
CFLAGS_BEA=$(CFLAGS)
CFLAGS_BEA+=-I../../asm/arch/x86/bea/
CFLAGS_BEA+=-I../../asm/arch/x86/bea/src
CFLAGS_BEA+=-I../../asm/arch/x86/bea/include
CFLAGS_BEA+=-DUint64=uint64_t
$(OBJ_X86_BEA): %.o : %.c
$(CC) -c $(CFLAGS_BEA) $< -o $@
${TARGET_X86_BEA}: ${OBJ_X86_BEA}
${CC} ${CFLAGS} -o anal_x86_bea.${LIBEXT} ${OBJ_X86_BEA}
${CC} ${CFLAGS_BEA} -o anal_x86_bea.${LIBEXT} ${OBJ_X86_BEA}
@#strip -s anal_x86_bea.${LIBEXT}
+27
View File
@@ -0,0 +1,27 @@
OBJ_X86_UDIS86=anal_x86_udis.o
OBJ_X86_UDIS86+=esil_x86_udis.o
SHARED_X86_UDIS86=../../asm/arch/x86/udis86/decode.o
SHARED_X86_UDIS86+=../../asm/arch/x86/udis86/itab.o
SHARED_X86_UDIS86+=../../asm/arch/x86/udis86/syn-att.o
SHARED_X86_UDIS86+=../../asm/arch/x86/udis86/syn-intel.o
SHARED_X86_UDIS86+=../../asm/arch/x86/udis86/syn.o
SHARED_X86_UDIS86+=../../asm/arch/x86/udis86/udis86.o
SRC_X86_UDIS86=../../asm/arch/x86/udis86/*.c
EXT_SO=$(shell r2 -H LIBEXT)
STATIC_OBJ+=${OBJ_X86_UDIS86} ${OBJ_ESIL_UDIS86}
SHARED_OBJ+=${SHARED_X86_UDIS86}
TARGET_X86_UDIS86=anal_x86_udis.${EXT_SO}
ALL_TARGETS+=${TARGET_X86_UDIS86}
CFLAGS_UDIS86=$(CFLAGS)
CFLAGS_UDIS86+=-I../../asm/arch/x86 -I../../asm/arch/x86/udis86 -DHAVE_STRING_H=1
$(OBJ_X86_UDIS86): %.o : %.c
$(CC) -c $(CFLAGS_UDIS86) $< -o $@
${TARGET_X86_UDIS86}: ${OBJ_X86_UDIS86} ${OBJ_ESIL_UDIS86}
${CC} ${CFLAGS_UDIS86} ${LDFLAGS} $(call libname,anal_x86) -lr_reg -lr_anal -lr_util \
$(SRC_X86_UDIS86) -o anal_x86_udis.${EXT_SO} ${OBJ_X86_UDIS86}
+23
View File
@@ -0,0 +1,23 @@
SO=$(shell r2 -H R2_LIBEXT)
PD=$(shell r2 -H R2_USER_PLUGINS)
CFLAGS+=$(shell pkg-config --cflags r_util r_arch) -fPIC
LDFLAGS+=$(shell pkg-config --libs r_util r_arch)
CFLAGS+=-g
OBJS=arch_hexagon.o
OBJS+=hexagon.o
OBJS+=hexagon_anal.o
OBJS+=hexagon_disas.o
all: arch_hexagon.${SO}
arch_hexagon.$(SO): $(OBJS)
$(CC) -shared -fPIC -o arch_hexagon.$(SO) $(OBJS) $(LDFLAGS)
rm -f $(PD)/arch_hexagon.$(SO)
mkdir -p $(PD)
cp -f arch_hexagon.$(SO) $(PD)/arch_hexagon.$(SO)
clean:
rm -f arch_hexagon.$(SO) $(OBJS)
+116
View File
@@ -0,0 +1,116 @@
#if 0
/* radare - LGPL - Copyright 2018-2021 - xvilka, pancake */
#include <r_types.h>
#include <r_util.h>
#include <r_asm.h>
#include <r_anal.h>
#include <r_lib.h>
#include "hexagon.h"
#include "hexagon_insn.h"
#include "hexagon_anal.h"
static int hexagon_v6_op(RAnal *anal, RAnalOp *op, ut64 addr, const ut8 *buf, int len, RAnalOpMask mask) {
if (len < 4) {
return 0;
}
ut32 data = r_read_le32 (buf);
HexInsn hi = {0};
int size = hexagon_disasm_instruction (data, &hi, (ut32) addr);
if (size > 0 && mask & R_ANAL_OP_MASK_DISASM) {
op->mnemonic = strdup (hi.mnem);
}
op->size = size;
if (size < 1) {
return size;
}
op->vliw = hi.op_count;
op->addr = addr;
return hexagon_anal_instruction (&hi, op);
}
static bool set_reg_profile(RAnal *anal) {
// TODO: Add missing registers
const char *p =
"=PC pc\n"
"=SP r29\n"
"=A0 r0\n"
"=A1 r1\n"
"=A2 r2\n"
"=A3 r3\n"
"=A4 r4\n"
"=A5 r5\n"
"=BP r30\n"
"=LR r31\n"
"=SN r6\n"
"=ZF z\n"
"=SF s\n"
"=OF ov\n"
"=CF cy\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"
"gpr r18 .32 72 0\n"
"gpr r19 .32 76 0\n"
"gpr r20 .32 80 0\n"
"gpr r21 .32 84 0\n"
"gpr r22 .32 88 0\n"
"gpr r23 .32 92 0\n"
"gpr r24 .32 96 0\n"
"gpr r25 .32 100 0\n"
"gpr r26 .32 104 0\n"
"gpr r27 .32 108 0\n"
"gpr r28 .32 112 0\n"
"gpr r29 .32 116 0\n"
"gpr r30 .32 120 0\n"
"gpr r31 .32 124 0\n"
"gpr pc .32 128 0\n"
"gpr psw .32 132 0\n"
"gpr np .1 132.16 0\n"
"gpr ep .1 132.17 0\n"
"gpr ae .1 132.18 0\n"
"gpr id .1 132.19 0\n"
"flg cy .1 132.28 0\n"
"flg ov .1 132.29 0\n"
"flg s .1 132.30 0\n"
"flg z .1 132.31 0\n";
return r_reg_set_profile_string (anal->reg, p);
}
RAnalPlugin r_anal_plugin_hexagon = {
.name = "hexagon",
.desc = "Qualcomm Hexagon (QDSP6) V6",
.license = "LGPL3",
.arch = "hexagon",
.bits = 32,
.op = hexagon_v6_op,
.esil = false,
.set_reg_profile = set_reg_profile,
};
#ifndef R2_PLUGIN_INCORE
R_API RLibStruct radare_plugin = {
.type = R_LIB_TYPE_ANAL,
.data = &r_anal_plugin_hexagon,
.version = R2_VERSION
};
#endif
#endif
+113
View File
@@ -0,0 +1,113 @@
/* radare - LGPL - Copyright 2015-2023 - condret */
#include <r_arch.h>
#include <r_lib.h>
#include "hexagon.h"
#include "hexagon_insn.h"
#include "hexagon_anal.h"
static bool mal_decode(RArchSession *s, RAnalOp *op, RArchEncodeMask mask) {
if (op->size < 4 || !op->bytes) {
return false;
}
ut32 data = r_read_le32 (op->bytes);
HexInsn hi = {0};
int size = hexagon_disasm_instruction (data, &hi, (ut32) (op->addr & UT32_MAX));
if (size > 0 && mask & R_ARCH_OP_MASK_DISASM) {
op->mnemonic = strdup (hi.mnem);
}
op->size = size;
if (size < 1) {
return false;
}
op->vliw = hi.op_count;
int res = hexagon_anal_instruction (&hi, op);
if (op->size != res) {
R_LOG_DEBUG ("shouldnt happen invalid instruction at 0x%08"PFMT64x, op->addr);
}
op->size = res;
return true;
}
static char* regs(RArchSession *as) {
return strdup (
"=PC pc\n"
"=SP r29\n"
"=A0 r0\n"
"=A1 r1\n"
"=A2 r2\n"
"=A3 r3\n"
"=A4 r4\n"
"=A5 r5\n"
"=BP r30\n"
"=LR r31\n"
"=SN r6\n"
"=ZF z\n"
"=SF s\n"
"=OF ov\n"
"=CF cy\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"
"gpr r18 .32 72 0\n"
"gpr r19 .32 76 0\n"
"gpr r20 .32 80 0\n"
"gpr r21 .32 84 0\n"
"gpr r22 .32 88 0\n"
"gpr r23 .32 92 0\n"
"gpr r24 .32 96 0\n"
"gpr r25 .32 100 0\n"
"gpr r26 .32 104 0\n"
"gpr r27 .32 108 0\n"
"gpr r28 .32 112 0\n"
"gpr r29 .32 116 0\n"
"gpr r30 .32 120 0\n"
"gpr r31 .32 124 0\n"
"gpr pc .32 128 0\n"
"gpr psw .32 132 0\n"
"gpr np .1 132.16 0\n"
"gpr ep .1 132.17 0\n"
"gpr ae .1 132.18 0\n"
"gpr id .1 132.19 0\n"
"flg cy .1 132.28 0\n"
"flg ov .1 132.29 0\n"
"flg s .1 132.30 0\n"
"flg z .1 132.31 0\n");
}
RArchPlugin r_arch_plugin_hexagon = {
.meta = {
.name = "hexagon",
.desc = "Qualcomm Hexagon (QDSP6) V6",
.author = "pancake,condret,xvilka",
.license = "LGPL3",
},
.regs = regs,
.arch = "hexagon",
.bits = 32,
.decode = &mal_decode,
};
#ifndef R2_PLUGIN_INCORE
R_API RLibStruct radare_plugin = {
.type = R_LIB_TYPE_ARCH,
.data = &r_arch_plugin_hexagon,
.version = R2_VERSION
};
#endif
+91
View File
@@ -0,0 +1,91 @@
/* radare - LGPL - Copyright 2017 - pancake */
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
#include <r_types.h>
#include <r_lib.h>
#include <r_util.h>
#include <r_asm.h>
#include "disas-asm.h"
#include <mybfd.h>
disassembler_ftype
hexagon_get_disassembler_from_mach(
unsigned long machine,
unsigned long big_p
);
static unsigned long Offset = 0;
static RStrBuf *buf_global = NULL;
static unsigned char bytes[4];
static int hexagon_buffer_read_memory (bfd_vma memaddr, bfd_byte *myaddr, unsigned int length, struct disassemble_info *info) {
memcpy (myaddr, bytes, length);
return 0;
}
static int symbol_at_address(bfd_vma addr, struct disassemble_info * info) {
return 0;
}
static void memory_error_func(int status, bfd_vma memaddr, struct disassemble_info *info) {
//--
}
DECLARE_GENERIC_PRINT_ADDRESS_FUNC()
DECLARE_GENERIC_FPRINTF_FUNC()
static int disassemble(RAsm *a, RAsmOp *op, const ut8 *buf, int len) {
static int (*print_insn_hexagon)(bfd_vma, struct disassemble_info *);
static struct disassemble_info disasm_obj;
if (len < 4) {
return -1;
}
buf_global = &op->buf_asm;
Offset = a->pc;
// disasm inverted
r_mem_swapendian (bytes, buf, 4); // TODO handle thumb
/* prepare disassembler */
memset (&disasm_obj,'\0', sizeof (struct disassemble_info));
disasm_obj.buffer = bytes;
disasm_obj.read_memory_func = &hexagon_buffer_read_memory;
disasm_obj.symbol_at_address_func = &symbol_at_address;
disasm_obj.memory_error_func = &memory_error_func;
disasm_obj.print_address_func = &generic_print_address_func;
disasm_obj.endian = a->big_endian;
disasm_obj.fprintf_func = &generic_fprintf_func;
disasm_obj.stream = stdout;
disasm_obj.mach = 0;
r_strbuf_set (&op->buf_asm, "");
print_insn_hexagon = hexagon_get_disassembler_from_mach (0, 0);
op->size = print_insn_hexagon ((bfd_vma)Offset, &disasm_obj);
if (!strncmp ( r_strbuf_get (&op->buf_asm), "unknown", 7)) {
r_strbuf_set (&op->buf_asm, "invalid");
}
if (op->size == -1) {
r_strbuf_set (&op->buf_asm, "(data)");
}
return op->size;
}
RAsmPlugin r_asm_plugin_hexagon_gnu = {
.name = "hexagon.gnu",
.arch = "hexagon.gnu",
.bits = 32,
.endian = R_SYS_ENDIAN_BIG | R_SYS_ENDIAN_LITTLE,
.license = "GPL3",
.desc = "Qualcomm DSPv5",
.disassemble = &disassemble,
};
#ifndef R2_PLUGIN_INCORE
R_API RLibStruct radare_plugin = {
.type = R_LIB_TYPE_ASM,
.data = &r_asm_plugin_hexagon_gnu,
.version = R2_VERSION
};
#endif
+239
View File
@@ -0,0 +1,239 @@
/* radare - LGPL - Copyright 2018-2021 - xvilka */
#include <stdio.h>
#include <stdbool.h>
#include <r_types.h>
#include <r_lib.h>
#include <r_util.h>
#include <r_asm.h>
#include "hexagon.h"
// TODO: Handle also control reg pairs
char* hex_get_cntl_reg(int opreg) {
switch (opreg) {
case HEX_REG_SA0:
return "SA0";
case HEX_REG_LC0:
return "LC0";
case HEX_REG_SA1:
return "SA1";
case HEX_REG_LC1:
return "LC1";
case HEX_REG_P:
return "P";
case HEX_REG_M0:
return "M0";
case HEX_REG_M1:
return "M1";
case HEX_REG_USR:
return "USR";
case HEX_REG_PC:
return "PC";
case HEX_REG_UGP:
return "UGP";
case HEX_REG_GP:
return "GP";
case HEX_REG_CS0:
return "CS0";
case HEX_REG_CS1:
return "CS1";
case HEX_REG_UPCYCLELO:
return "UPCYCLELO";
case HEX_REG_UPCYCLEHI:
return "UPCYCLEHI";
case HEX_REG_FRAMELIMIT:
return "FRAMELIMIT";
case HEX_REG_FRAMEKEY:
return "FRAMEKEY";
case HEX_REG_PKTCOUNTLO:
return "PKTCOUNTLO";
case HEX_REG_PKTCOUNTHI:
return "PKTCOUNTHI";
case HEX_REG_UTIMERLO:
return "UTIMERLO";
case HEX_REG_UTIMERHI:
return "UTIMERHI";
default:
return "<CRerr>";
}
}
char* hex_get_sys_reg(int opreg) {
static char tmp[5];
switch (opreg) {
case HEX_REG_SGP0:
return "SGP0";
case HEX_REG_SGP1:
return "SGP1";
case HEX_REG_STID:
return "STID";
case HEX_REG_ELR:
return "ELR";
case HEX_REG_BADVA0:
return "BADVA0";
case HEX_REG_BADVA1:
return "BADVA1";
case HEX_REG_SSR:
return "SSR";
case HEX_REG_CCR:
return "CCR";
case HEX_REG_HTID:
return "HTID";
case HEX_REG_BADVA:
return "BADVA";
case HEX_REG_IMASK:
return "IMASK";
case HEX_REG_EVB:
return "EVB";
case HEX_REG_MODECTL:
return "MODECTL";
case HEX_REG_SYSCFG:
return "SYSCFG";
case HEX_REG_IPEND:
return "IPEND";
case HEX_REG_VID:
return "VID";
case HEX_REG_IAD:
return "IAD";
case HEX_REG_IEL:
return "IEL";
case HEX_REG_IAHL:
return "IAHL";
case HEX_REG_CFGBASE:
return "CFGBASE";
case HEX_REG_DIAG:
return "DIAG";
case HEX_REG_REV:
return "REV";
case HEX_REG_PCYCLELO:
return "PCYCLELO";
case HEX_REG_PCYCLEHI:
return "PCYCLEHI";
case HEX_REG_ISDBST:
return "ISDBST";
case HEX_REG_ISDBCFG0:
return "ISDBCFG0";
case HEX_REG_ISDBCFG1:
return "ISDBCFG1";
case HEX_REG_BRKPTPC0:
return "BRKPTPC0";
case HEX_REG_BRKPTCFG0:
return "BRKPTCFG0";
case HEX_REG_BRKPTPC1:
return "BRKPTPC1";
case HEX_REG_BRKPTCFG1:
return "BRKPTCFG1";
case HEX_REG_ISDBMBXIN:
return "ISDBMBXIN";
case HEX_REG_ISDBMBXOUT:
return "ISDBMBXOUT";
case HEX_REG_ISDBEN:
return "ISDBEN";
case HEX_REG_ISDBGPR:
return "ISDBGPR";
case HEX_REG_PMUCNT0:
return "PMUCNT0";
case HEX_REG_PMUCNT1:
return "PMUCNT1";
case HEX_REG_PMUCNT2:
return "PMUCNT2";
case HEX_REG_PMUCNT3:
return "PMUCNT3";
case HEX_REG_PMUEVTCFG:
return "PMUEVTCFG";
case HEX_REG_PMUCFG:
return "PMUCFG";
default:
sprintf(tmp, "S%d", opreg);
return tmp;
}
}
char* hex_get_sub_reg(int opreg) {
switch (opreg) {
case HEX_SUB_REG_R0:
return "R0";
case HEX_SUB_REG_R1:
return "R1";
case HEX_SUB_REG_R2:
return "R2";
case HEX_SUB_REG_R3:
return "R3";
case HEX_SUB_REG_R4:
return "R4";
case HEX_SUB_REG_R5:
return "R5";
case HEX_SUB_REG_R6:
return "R6";
case HEX_SUB_REG_R7:
return "R7";
case HEX_SUB_REG_R16:
return "R16";
case HEX_SUB_REG_R17:
return "R17";
case HEX_SUB_REG_R18:
return "R18";
case HEX_SUB_REG_R19:
return "R19";
case HEX_SUB_REG_R20:
return "R20";
case HEX_SUB_REG_R21:
return "R21";
case HEX_SUB_REG_R22:
return "R22";
case HEX_SUB_REG_R23:
return "R23";
default:
return "<err>";
}
}
char* hex_get_sub_regpair(int opreg)
{
switch (opreg) {
case HEX_SUB_REGPAIR_R1_R0:
return "R1:R0";
case HEX_SUB_REGPAIR_R3_R2:
return "R3:R2";
case HEX_SUB_REGPAIR_R5_R4:
return "R5:R4";
case HEX_SUB_REGPAIR_R7_R6:
return "R7:R6";
case HEX_SUB_REGPAIR_R17_R16:
return "R17:R16";
case HEX_SUB_REGPAIR_R19_R18:
return "R19:R18";
case HEX_SUB_REGPAIR_R21_R20:
return "R21:R20";
case HEX_SUB_REGPAIR_R23_R22:
return "R23:R22";
default:
return "<err>";
}
}
inline bool hex_if_duplex(uint32_t insn_word)
{
if ((insn_word & (3 << 14)) == 0) {
return true;
}
return false;
}
// Constant extender value
ut32 constant_extender = 1;
void hex_op_extend(HexOp *op) {
if ((constant_extender != 1) && (op->type == HEX_OP_TYPE_IMM)) {
op->op.imm = ((op->op.imm) & 0x3F) | (constant_extender);
}
constant_extender = 1;
}
void hex_op_extend_off(HexOp *op, int offset) {
return;
if ((constant_extender != 1) && (op->type == HEX_OP_TYPE_IMM)) {
op->op.imm = (op->op.imm) >> offset;
hex_op_extend(op);
}
}
Loaded 100 of 701 files, more files were not shown because too many files have changed in this diff. Show more