Commit Graph

96 Commits

Author SHA1 Message Date
Yuvraj Saxena
9ad89fd980
Fix tb instruction for ARM assembler ##asm
Current code unconditionally drops last 2 bits without checking if those 2 bits are set or cleared,
if ignored these 2 bits are eventually lost and not encoded in machine instruction
and it's dangerous to assume destination supplied is valid to correct this I implemented a check.
Last 2 bits are discarded when final machine instruction is generated
and later in the decode phase this 14 bit immediate value (destination) is shifted left 2 bit positions,
and later sign extended to 64 bits that means we can actually encode a number with 16 bits but current code encodes only upto 14 bits. Thus, wasting 2 bits.
Also, Current code unconditionally parses last 5 bits from immediate 1, which is nothing but bit number to be tested in the register. Therefore, it must be within range 0-31 if 32 bit register is used, range must 0-63 if 64 bit register is used.
Also, in the case of 64 bit register only last 5 bits are encoded because it's later concatenated with MSB hence rendering a 6 bit number that can be used to denote bit positions between 0-63. To tackle this a check for this is implemented.
At last testcases are added to demonstrate these checks.
2023-03-19 13:08:25 +01:00
pancake
b340dea630 Fix some warnings on windows and unbreak few tests 2023-03-15 12:03:06 +01:00
pancake
b8bd90585f Fix spaces in cr16 tests 2023-03-13 17:42:32 +01:00
Yuvraj Saxena
046486862a
Add more conditional branch instructions for the arm64 assembler ##asm
* Add testcase and aliases for bhs conditional branch instruction for the arm64 assembler
* bcs and b.cs are aliases for bhs instruction
2023-03-05 18:06:59 +01:00
pancake
3b74c121b6 Implement conditional branch instruction for the arm64 assembler ##asm 2023-03-02 17:11:07 +01:00
pancake
b758db499a Fix alpha tests 2023-02-24 18:00:38 +01:00
pancake
c809882f38
Move the bpf plugins ##arch 2023-02-20 12:48:25 +01:00
pancake
96eee63285 Improve armass64 for tbz/tbnz to handle relative instructions ##asm 2023-02-13 22:53:22 +01:00
pancake
83ab8e718c
Rename evm.cs to evm ##arch 2023-01-29 21:22:18 +01:00
kyufie
1aa6cf6464 Add some test for ARM assembler ##test 2022-12-29 11:39:15 +01:00
pancake
19a377bbda Fix and move failing tests, reorder lib build ##arch 2022-11-30 15:43:54 +01:00
pancake
d5027d07d3 Support reg+idx and idx+reg in x86.nz assembler ##arch 2022-11-30 15:43:54 +01:00
pancake
37b279b6f4
Fix asm.acur supporting arch, anal and asm plugins ##arch
* Fix asm.acur supporting arch, anal and asm plugins ##arch

* Fixes the arch/bits combo selection order issue for riscv tests
* Move the riscv arch plugin to the new plugin structure
* Deprecate r_asm_setup ()
2022-11-26 17:49:10 +01:00
pancake
9243a98ae7
Move anal.v810 into arch.v810 ##arch 2022-11-14 23:45:59 +01:00
pancake
c9b90b8926
More refactorings and api redesigns in r_arch ##api 2022-11-10 16:01:57 +01:00
pancake
539c5aee90 Honor plugin name in rate matching for RArch.use ##arch
* Fixes amd29k regressions
2022-11-07 19:19:21 +01:00
Peter Meerwald-Stadler
e55a7bd605 Remove 64-bit instruction from 32-bit test file 2022-10-19 20:47:36 +02:00
Peter Meerwald-Stadler
444530137c
Fix rasm2 x86.nz for "xchg eax,eax" and add tests ##asm
rasm2 -a x86.nz -b 64 "xchg eax,eax" -> 87c0
rasm2 -a x86.nz -b 32 "xchg eax,eax" -> 90
2022-10-12 03:03:27 +02:00
pancake
36d13a1165 Fix sh asan issue 2022-10-09 00:55:18 +02:00
pancake
220bb2515b Fix asm tests for latest arm64 on capstone5-next 2022-10-06 20:32:30 +02:00
Sylvain Pelissier
847e453cad Start moving EVM analysis from extras to core ##arch 2022-09-20 18:11:27 +02:00
Sylvain Pelissier
76fa8dd2a2
Add push32 test for EVM (#20731)
Co-authored-by: Sylvain Pelissier <sylvain.pelissier@nagra.com>
2022-09-13 12:27:58 +02:00
pancake
578e42ffcb
move asm.arm_windebg to anal.arm_wd ##refactor 2022-09-06 14:24:55 +02:00
Denis Ovsienko
2c0951d44c Add a few tests for cBPF conditional jumps. ##tests
This should cover the recent bugfix for unsigned jump offsets.
2022-08-10 09:23:39 +02:00
pancake
652f96aadc
Fix ARC tests and improve r2r.asm output ##tests 2022-07-08 21:42:28 +02:00
pancake
bd3cc5f205 Disable failing test 2022-07-05 16:40:53 +02:00
Richard Patel
88c5447da9 Re-enable the bpf.mr assembler ##arch 2022-07-05 12:47:53 +02:00
condret
8c7dee3016 Remove all instances of "ptr " in x86 cs assembly output ##asm 2022-07-04 04:42:07 +02:00
pancake
5054382ec2 Fix ws test 2022-06-27 11:52:41 +02:00
pancake
f5fd629603
Merge asm.sparc into anal.sparc ##refactor
Co-authored-by: Richard Patel <me@terorie.dev>
Co-authored-by: pancake <pancake@nopcode.org>
2022-06-26 20:07:23 +02:00
Richard Patel
b7a3300596 Merge asm.alpha into anal.alpha ##refactor 2022-06-26 20:06:51 +02:00
Richard Patel
e34f1e0356
Merge asm.i8080 into anal.i8080 and add a test ##refactor 2022-06-17 11:24:29 +02:00
rax2
94d42e9641
Support tbz,tbnz,rev16,rev32 instructions in the arm64 assembler ##asm 2022-06-16 18:51:46 +02:00
Richard Patel
22a184f0bc
Merge asm.v850 into anal.v850 and add a test ##refactor 2022-06-16 18:17:27 +02:00
Richard Patel
c0905d0d98 Merge asm.pdp11 into anal.pdp11 ##refactor 2022-06-16 01:40:22 +02:00
Richard Patel
3df0fb0168 Merge asm.6502 into anal.6502 ##refactor 2022-06-15 14:51:53 +02:00
rax64
698a2cf7af Support cset and sxt(b,h,w) instructions in the arm64 assembler ##asm 2022-06-11 10:17:43 +02:00
Richard Patel
c2bd7dea77
Fix bpf's lddw <reg>, <imm> tests 2022-06-09 20:06:13 +02:00
rax2
81a5780867
Support ccmn and csel instructions in the arm64 assembler ##asm 2022-06-08 20:30:39 +02:00
rax2
a2c0eea501
Support more arm64 instructions ##asm 2022-06-04 10:17:40 +02:00
Richard Patel
4162fe8079
Add initial anal.bpf.cs plugin + disasm tests ##arch 2022-06-03 01:35:05 +02:00
condret
0df5f4111e Reduce LOC of i4004 assembler (only use gperf for 1 byte instructions) ##anal 2022-06-01 22:31:36 +02:00
condret
53c5e8618a Fix tests for i4004 2022-06-01 08:39:40 +02:00
pancake
cc6d99b71b Update output for some v850 tests 2022-05-31 03:43:51 +02:00
pancake
f72af0713e Fix meson build and update v850 tests 2022-05-30 16:26:36 +02:00
rax2
2db5006135
Support cls, clz for 32 and 64 bit registers in the arm64 assembler ##asm
* adding tests (64, 32 registers)  for cls, clz  aarch64 instructions
* implement a function for cls, clz 32, 64 registers
2022-05-17 16:29:01 +02:00
pancake
ad20568b70 Handle mul and udiv in the arm64 assembler
* Fix arm64 assembler regressions
* Improve rasm2 binary input detection
2022-05-02 22:26:38 +02:00
pancake
801dd326a0 Remove the hexagon from anal ##analysis
* Too large (2.2MB) and too slow to build, time explosion with -O2
* It's outdated and not maintained, better use r2ghidra one
* Move this code into extras (or the updated one)
* Still available via r2pm
2022-03-22 01:04:34 +01:00
pancake
16b3ff90b0
Fix #19489 - Implement assembler for jrcxz ##asm 2022-03-15 17:42:48 +01:00
Anton Kochkov
62d6d226ff Fix cmn, teq and tst in arm32 assembler ##asm 2022-02-14 02:00:05 +01:00