Rizin
unix-like reverse engineering framework and cli tools
rz_cmp.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2021 Dhruv Maroo <dhruvmaru007@gmail.com>
2 // SPDX-License-Identifier: LGPL-3.0-only
3 
4 #ifndef RZ_CMP_H
5 #define RZ_CMP_H
6 
7 #include <rz_core.h>
8 #include <rz_util.h>
9 
10 #ifdef __cplusplus
11 extern "C" {
12 #endif
13 
14 typedef struct {
15  ut32 len; // max 255 bytes diff in one struct
16  bool same;
22 
26 RZ_API RZ_OWN RzList /*<RzCompareData *>*/ *rz_core_cmp_disasm(RzCore *core, ut64 addr1, ut64 addr2, ut32 len);
28 RZ_API bool rz_core_cmp_disasm_print(RzCore *core, const RzList /*<RzCompareData *>*/ *compare, bool unified);
29 
34 typedef struct rz_core_cmpwatch_t {
36  int size;
37  char cmd[32];
41 
42 /* watchers */
45 RZ_API bool rz_core_cmpwatch_add(RzCore *core, ut64 addr, int size, const char *cmd);
50 
51 #ifdef __cplusplus
52 }
53 #endif
54 
55 #endif /* RZ_CMP_H */
size_t len
Definition: 6502dis.c:15
static RzILOpEffect * cmp(cs_insn *insn, bool is_thumb)
Definition: arm_il32.c:942
#define RZ_API
#define w
Definition: crypto_rc6.c:13
static static sync static getppid static getegid const char static filename char static len const char char static bufsiz static mask static vfork const void static prot static getpgrp const char static swapflags cmd
Definition: sflib.h:79
uint32_t ut32
RZ_API void rz_core_cmpwatch_show(RzCore *core, ut64 addr, RzOutputMode mode)
Show/print the memory watcher present at address addr.
Definition: cmp.c:397
RZ_API bool rz_core_cmpwatch_update(RzCore *core, ut64 addr)
Update the memory watcher at address addr.
Definition: cmp.c:430
RZ_API bool rz_core_cmpwatch_del(RzCore *core, ut64 addr)
Delete a memory watcher at address addr.
Definition: cmp.c:375
RZ_API bool rz_core_cmpwatch_add(RzCore *core, ut64 addr, int size, const char *cmd)
Add a memory watcher at address addr od size size and command cmd.
Definition: cmp.c:337
RZ_API void rz_core_cmpwatch_free(RzCoreCmpWatcher *w)
Definition: cmp.c:300
RZ_API RzCoreCmpWatcher * rz_core_cmpwatch_get(RzCore *core, ut64 addr)
Get the memory watcher at address addr.
Definition: cmp.c:316
RZ_API bool rz_core_cmpwatch_revert(RzCore *core, ut64 addr)
Revert/reset a memory watcher at address addr.
Definition: cmp.c:458
voidpf void uLong size
Definition: ioapi.h:138
const char int mode
Definition: ioapi.h:137
uint8_t ut8
Definition: lh5801.h:11
static int compare(const char *s1, const char *s2, int l1, int l2)
Definition: chmd.c:864
RZ_API bool rz_core_cmp_disasm_print(RzCore *core, const RzList *compare, bool unified)
Print the instruction comparison data compare.
Definition: cmp.c:243
RZ_API void rz_core_cmp_free(RzCompareData *cmp)
Free RzCompareData object.
Definition: cmp.c:226
RZ_API RZ_OWN RzList * rz_core_cmp_disasm(RzCore *core, ut64 addr1, ut64 addr2, ut32 len)
Compare the instructions at addr1 and addr2.
Definition: cmp.c:161
RZ_API RZ_OWN RzCompareData * rz_core_cmp_mem_mem(RzCore *core, ut64 addr1, ut64 addr2, ut32 len)
Compare memory at addr1 with the memory at addr2.
Definition: cmp.c:17
RZ_API RZ_OWN RzCompareData * rz_core_cmp_mem_data(RzCore *core, ut64 addr, RZ_NONNULL const ut8 *data, ut32 len)
Compare mem at addr with data data.
Definition: cmp.c:56
struct rz_core_cmpwatch_t RzCoreCmpWatcher
RZ_API int rz_core_cmp_print(RzCore *core, RZ_NONNULL const RzCompareData *cmp, RzCmdStateOutput *state)
Print a comparison cmp according to the print mode mode.
Definition: cmp.c:93
#define RZ_OWN
Definition: rz_types.h:62
#define RZ_NONNULL
Definition: rz_types.h:64
RzOutputMode
Enum to describe the way data are printed.
Definition: rz_types.h:38
ut64 addr2
Definition: rz_cmp.h:20
ut32 len
Definition: rz_cmp.h:15
bool same
Definition: rz_cmp.h:16
ut64 addr1
Definition: rz_cmp.h:19
ut8 * data1
Definition: rz_cmp.h:17
ut8 * data2
Definition: rz_cmp.h:18
Watcher which executes a command when listed.
Represent the output state of a command handler.
Definition: rz_cmd.h:91
ut8 * ndata
New data at the given address.
Definition: rz_cmp.h:39
ut64 addr
Address of the watcher.
Definition: rz_cmp.h:35
int size
Size of the watcher.
Definition: rz_cmp.h:36
ut8 * odata
original data at the given address
Definition: rz_cmp.h:38
char cmd[32]
Command to be executed by the watcher.
Definition: rz_cmp.h:37
Definition: dis.h:43
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
static int addr
Definition: z80asm.c:58