librz/bin: fix the false-positive detection of the C166 bins as AVR bins
This commit is contained in:
parent
48d9f725fb
commit
fe524a30e8
2 changed files with 19 additions and 0 deletions
|
|
@ -609,6 +609,10 @@ static bool avr_check_buffer(RzBuffer *buf) {
|
|||
if (rz_buf_size(buf) < 32) {
|
||||
return false;
|
||||
}
|
||||
ut8 c = 0;
|
||||
if (!rz_buf_read8_at(buf, 0x0, &c) || c == 0xFA) {
|
||||
return false; // This is a c166 jmp
|
||||
}
|
||||
return is_jmp(buf, 0) || is_rjmp(buf, 0);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,21 @@ EXPECT=<<EOF
|
|||
EOF
|
||||
RUN
|
||||
|
||||
NAME=avr or c166 check - DISasm: [fac08400 => jump in c166]
|
||||
FILE=bins/c166/measure_raw.bin
|
||||
CMDS=<<EOF
|
||||
e asm.bytes=true
|
||||
ao 1~^jump[1]
|
||||
iA
|
||||
EOF
|
||||
EXPECT=<<EOF
|
||||
offset size arch bits machine big_endian
|
||||
----------------------------------------------
|
||||
0x00000000 7958 unk_0 64 false
|
||||
EOF
|
||||
RUN
|
||||
|
||||
|
||||
NAME=avr DISasm: [0e940b10 => call] - jump check
|
||||
FILE=malloc://4096
|
||||
CMDS=<<EOF
|
||||
|
|
|
|||
Loading…
Reference in a new issue