Rizin
unix-like reverse engineering framework and cli tools
bp_arm.c
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2009-2017 pancake <pancake@nopcode.org>
2 // SPDX-License-Identifier: LGPL-3.0-only
3 
4 #include <rz_bp.h>
5 #include <rz_lib.h>
6 
7 static struct rz_bp_arch_t rz_bp_plugin_arm_bps[] = {
8  { 64, 4, 0, (const ut8 *)"\x00\x00\x20\xd4" }, // le - arm64 brk0
9  { 64, 4, 1, (const ut8 *)"\xd4\x20\x00\x00" }, // be - arm64
10  //{ 64, 1, 0, (const ut8*)"\xfe\xde\xff\xe7" }, // le - arm64 // hacky fix
11 
12  { 32, 4, 0, (const ut8 *)"\xf0\x01\xf0\xe7" }, // eabi-le - undefined instruction - for all kernels
13  { 32, 4, 1, (const ut8 *)"\xe7\xf0\x01\xf0" }, // eabi-be
14 
15 // { 32, 1, 0, (const ut8*)"\xff\xff\xff\xff" }, // le - linux only? (undefined instruction)
16 // { 32, 1, 1, (const ut8*)"\xff\xff\xff\xff" }, // be - linux only? (undefined instruction)
17 // { 32, 4, 0, (const ut8*)"\x01\x00\x9f\xef" }, // le - linux only? (undefined instruction)
18 // { 32, 4, 1, (const ut8*)"\xef\x9f\x00\x01" }, // be
19 #if 0
20  { 4, 0, (const ut8*)"\xfe\xde\xff\xe7" }, // arm-le - from a gdb patch
21  { 4, 1, (const ut8*)"\xe7\xff\xde\xfe" }, // arm-be
22  { 4, 0, (const ut8*)"\xf0\x01\xf0\xe7" }, // eabi-le - undefined instruction - for all kernels
23  { 4, 1, (const ut8*)"\xe7\xf0\x01\xf0" }, // eabi-be
24 #endif
25  { 16, 2, 0, (const ut8 *)"\x01\xbe" }, // thumb-le
26  { 16, 2, 1, (const ut8 *)"\xbe\x01" }, // thumb-be
27  { 16, 2, 0, (const ut8 *)"\xfe\xdf" }, // arm-thumb-le
28  { 16, 2, 1, (const ut8 *)"\xdf\xfe" }, // arm-thumb-be
29  { 16, 4, 0, (const ut8 *)"\xff\xff\xff\xff" }, // arm-thumb-le
30  { 16, 4, 1, (const ut8 *)"\xff\xff\xff\xff" }, // arm-thumb-be
31  { 0, 0, 0, NULL }
32 };
33 
35  .name = "arm",
36  .arch = "arm",
37  .nbps = 9,
38  .bps = rz_bp_plugin_arm_bps,
39 };
40 
41 #ifndef RZ_PLUGIN_INCORE
44  .data = &rz_bp_plugin_arm,
45  .version = RZ_VERSION
46 };
47 #endif
RZ_API RzLibStruct rizin_plugin
Definition: bp_arm.c:42
struct rz_bp_plugin_t rz_bp_plugin_arm
Definition: bp_arm.c:34
static struct rz_bp_arch_t rz_bp_plugin_arm_bps[]
Definition: bp_arm.c:7
#define RZ_API
#define NULL
Definition: cris-opc.c:27
uint8_t ut8
Definition: lh5801.h:11
@ RZ_LIB_TYPE_BP
Definition: rz_lib.h:78
#define RZ_VERSION
Definition: rz_version.h:8
char * name
Definition: rz_bp.h:34