18 const char *
name =
sdb_fmt(
"%s::%s", klass, method);
56 if (plugin && plugin->
destroy) {
136 return bits == iter_bits && !strcmp(iter_arch,
arch) && !xtr_data->
loaded;
170 rz_list_foreach (
bin->binfiles,
iter, binfile) {
176 rz_list_foreach (binfile->
xtr_data, iter_xtr, xtr_data) {
191 rz_list_foreach (
bin->binfiles,
iter, bf) {
192 if (bf->
id == bf_id) {
204 rz_list_foreach (
bin->binfiles, it, bf) {
205 RzEventBinFileDel ev = { bf };
217 if (
bin->cur == bf) {
220 RzEventBinFileDel ev = { bf };
231 rz_list_foreach (
bin->binfiles,
iter, bf) {
232 if (bf->
fd == bin_fd) {
245 rz_list_foreach (
bin->binfiles,
iter, bf) {
274 if (
bin->minstrlen < 1) {
320 RZ_LOG_INFO(
"TODO: Implement extractall_from_buffer in '%s' xtr.bin plugin\n", xtr->
name);
329 x->obj_opts = *obj_opts;
381 if (!strcmp(
name,
"entropy")) {
424 RZ_LOG_WARN(
"rz_bin_file_hash: file exceeds bin.hashlimit\n");
431 goto rz_bin_file_compute_hashes_bad;
436 goto rz_bin_file_compute_hashes_bad;
444 goto rz_bin_file_compute_hashes_bad;
447 goto rz_bin_file_compute_hashes_bad;
451 goto rz_bin_file_compute_hashes_bad;
455 goto rz_bin_file_compute_hashes_bad;
463 goto rz_bin_file_compute_hashes_bad;
477 rz_bin_file_compute_hashes_bad:
507 c->visibility = view;
518 free(
k->visibility_str);
548 RZ_LOG_ERROR(
"Cannot allocate RzBinClass for '%s'\n", klass);
557 const char *
name =
sdb_fmt(
"%s::%s", klass, method);
566 if (bf->o->plugin->trycatch) {
567 return bf->o->plugin->trycatch(bf);
RZ_API bool rz_bin_file_set_cur_binfile(RzBin *bin, RzBinFile *bf)
RZ_API RZ_OWN RzList * rz_bin_file_set_hashes(RzBin *bin, RZ_OWN RzList *new_hashes)
Set file_hashes on current RzBinInfo.
RZ_API ut64 rz_bin_file_delete_all(RzBin *bin)
RZ_API RzBinSymbol * rz_bin_file_add_method(RzBinFile *bf, const char *klass, const char *method, int nargs)
RZ_IPI RzBinFile * rz_bin_file_new_from_buffer(RzBin *bin, const char *file, RzBuffer *buf, RzBinObjectLoadOptions *opts, int fd, const char *pluginname)
RZ_API RzBinClass * rz_bin_file_add_class(RzBinFile *bf, const char *name, const char *super, int view)
RZ_API RzBinFile * rz_bin_file_find_by_name(RzBin *bin, const char *name)
RZ_IPI bool rz_bin_file_set_obj(RzBin *bin, RzBinFile *bf, RzBinObject *obj)
RZ_API RzBinFile * rz_bin_file_find_by_id(RzBin *bin, ut32 bf_id)
RZ_API bool rz_bin_file_set_cur_by_fd(RzBin *bin, ut32 bin_fd)
RZ_IPI bool rz_bin_file_set_bytes(RzBinFile *bf, const ut8 *bytes, ut64 sz, bool steal_ptr)
static RzBinClass * __getClass(RzBinFile *bf, const char *name)
static RzBinSymbol * __getMethod(RzBinFile *bf, const char *klass, const char *method)
RZ_IPI void rz_bin_class_free(RzBinClass *k)
RZ_API RzList * rz_bin_file_get_symbols(RzBinFile *bf)
RZ_API RzBinFile * rz_bin_file_find_by_fd(RzBin *bin, ut32 bin_fd)
RZ_API bool rz_bin_file_delete(RzBin *bin, RzBinFile *bf)
RZ_IPI RzBinClass * rz_bin_class_new(const char *name, const char *super, int view)
RZ_API RzBinFile * rz_bin_file_find_by_arch_bits(RzBin *bin, const char *arch, int bits)
static ut64 buf_compute_hashes(const ut8 *buf, ut64 size, void *user)
static RzBinPlugin * get_plugin_from_buffer(RzBin *bin, const char *pluginname, RzBuffer *buf)
RZ_IPI RzBinFile * rz_bin_file_new(RzBin *bin, const char *file, ut64 file_sz, int fd, const char *xtrname, bool steal_ptr)
RZ_API bool rz_bin_file_close(RzBin *bin, int bd)
RZ_API RZ_OWN RzList * rz_bin_file_compute_hashes(RzBin *bin, RzBinFile *bf, ut64 limit)
RZ_API bool rz_bin_file_set_cur_by_id(RzBin *bin, ut32 bin_id)
RZ_API RzBinPlugin * rz_bin_file_cur_plugin(RzBinFile *bf)
static bool add_file_hash(RzHashCfg *md, const char *name, RzList *list)
static bool xtr_metadata_match(RzBinXtrData *xtr_data, const char *arch, int bits)
RZ_IPI void rz_bin_file_free(void *_bf)
RZ_API bool rz_bin_file_object_new_from_xtr_data(RzBin *bin, RzBinFile *bf, RzBinObjectLoadOptions *opts, RzBinXtrData *data)
RZ_IPI RzBinFile * rz_bin_file_xtr_load_buffer(RzBin *bin, RzBinXtrPlugin *xtr, const char *filename, RzBuffer *buf, RzBinObjectLoadOptions *obj_opts, int idx, int fd)
RZ_API bool rz_bin_file_set_cur_by_name(RzBin *bin, const char *name)
RZ_API ut64 rz_bin_file_get_baddr(RzBinFile *bf)
RZ_API RzList * rz_bin_file_get_trycatch(RZ_NONNULL RzBinFile *bf)
RZ_API void rz_bin_xtrdata_free(void *data_)
RZ_API void rz_bin_file_hash_free(RzBinFileHash *fhash)
RZ_API RzBinPlugin * rz_bin_get_binplugin_by_buffer(RzBin *bin, RzBuffer *buf)
RZ_IPI RzBinPlugin * rz_bin_get_binplugin_by_name(RzBin *bin, const char *name)
RZ_IPI RzBinPlugin * rz_bin_get_binplugin_by_filename(RzBin *bin)
RZ_IPI RzBinXtrPlugin * rz_bin_get_xtrplugin_by_name(RzBin *bin, const char *name)
RZ_API const char * rz_bin_language_to_string(RzBinLanguage language)
returns the language name based on the given language identifier
RzBinInfo * info(RzBinFile *bf)
int bits(struct state *s, int need)
RZ_IPI void rz_bin_object_free(RzBinObject *o)
RZ_IPI RzBinObject * rz_bin_object_new(RzBinFile *bf, RzBinPlugin *plugin, RzBinObjectLoadOptions *opts, ut64 offset, ut64 sz)
RZ_API const RzList * rz_bin_object_get_symbols(RZ_NONNULL RzBinObject *obj)
Get list of RzBinSymbol representing the symbols in the binary object.
RZ_API char * sdb_fmt(const char *fmt,...)
RZ_API RZ_BORROW const ut8 * rz_hash_cfg_get_result(RZ_NONNULL RzHashCfg *md, RZ_NONNULL const char *name, RZ_NONNULL ut32 *size)
Returns the digest value of the requested algorithm name.
RZ_API RZ_OWN RzHashCfg * rz_hash_cfg_new(RZ_NONNULL RzHash *rh)
RZ_API void rz_hash_cfg_free(RZ_NONNULL RzHashCfg *md)
RZ_API bool rz_hash_cfg_configure(RZ_NONNULL RzHashCfg *md, RZ_NONNULL const char *name)
Allocates and configures the plugin message digest context.
RZ_API bool rz_hash_cfg_init(RZ_NONNULL RzHashCfg *md)
Resets/initialize the message digest contextes.
RZ_API bool rz_hash_cfg_update(RZ_NONNULL RzHashCfg *md, RZ_NONNULL const ut8 *data, ut64 size)
Inserts data into each the message digest contextes.
RZ_API bool rz_hash_cfg_final(RZ_NONNULL RzHashCfg *md)
Generates the final value of the message digest contextes.
RZ_API void Ht_() free(HtName_(Ht) *ht)
static void list(RzEgg *egg)
RZ_API RZ_OWN RzList * rz_list_newf(RzListFree f)
Returns a new initialized RzList pointer and sets the free method.
RZ_API RZ_BORROW RzListIter * rz_list_find_ptr(RZ_NONNULL const RzList *list, RZ_NONNULL const void *ptr)
Returns the RzListIter of the given pointer, if found.
RZ_API void rz_list_delete(RZ_NONNULL RzList *list, RZ_NONNULL RzListIter *iter)
Removes an entry in the list by using the RzListIter pointer.
RZ_API RZ_OWN RzList * rz_list_new(void)
Returns a new initialized RzList pointer (free method is not initialized)
RZ_API bool rz_list_join(RZ_NONNULL RzList *list1, RZ_NONNULL RzList *list2)
Joins 2 list into one (list2 pointer needs to be freed by the user)
RZ_API RZ_BORROW RzListIter * rz_list_push(RZ_NONNULL RzList *list, void *item)
Alias for rz_list_append.
RZ_API ut32 rz_list_length(RZ_NONNULL const RzList *list)
Returns the length of the list.
RZ_API RZ_BORROW RzListIter * rz_list_append(RZ_NONNULL RzList *list, void *data)
Appends at the end of the list a new element.
RZ_API void rz_list_free(RZ_NONNULL RzList *list)
Empties the list and frees the list pointer.
RZ_API void rz_list_purge(RZ_NONNULL RzList *list)
Empties the list without freeing the list pointer.
return strdup("=SP r13\n" "=LR r14\n" "=PC r15\n" "=A0 r0\n" "=A1 r1\n" "=A2 r2\n" "=A3 r3\n" "=ZF zf\n" "=SF nf\n" "=OF vf\n" "=CF cf\n" "=SN or0\n" "gpr lr .32 56 0\n" "gpr pc .32 60 0\n" "gpr cpsr .32 64 0 ____tfiae_________________qvczn\n" "gpr or0 .32 68 0\n" "gpr tf .1 64.5 0 thumb\n" "gpr ef .1 64.9 0 endian\n" "gpr jf .1 64.24 0 java\n" "gpr qf .1 64.27 0 sticky_overflow\n" "gpr vf .1 64.28 0 overflow\n" "gpr cf .1 64.29 0 carry\n" "gpr zf .1 64.30 0 zero\n" "gpr nf .1 64.31 0 negative\n" "gpr itc .4 64.10 0 if_then_count\n" "gpr gef .4 64.16 0 great_or_equal\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")
static uint32_t const uint8_t uint32_t uint32_t limit
#define rz_return_val_if_fail(expr, val)
RZ_API RzBuffer * rz_buf_ref(RzBuffer *b)
Increment the reference count of the buffer.
RZ_API RZ_OWN RzBuffer * rz_buf_new_with_io_fd(RZ_NONNULL void *iob, int fd)
Creates a new buffer wrapping a file descriptor accessed through RzIOBind.
RZ_API RZ_OWN RzBuffer * rz_buf_new_with_pointers(const ut8 *bytes, ut64 len, bool steal)
Creates a new buffer with a bytes array.
RZ_API void rz_buf_free(RzBuffer *b)
Free all internal data hold by the buffer and the buffer.
RZ_API RZ_OWN RzBuffer * rz_buf_new_with_bytes(RZ_NULLABLE RZ_BORROW const ut8 *bytes, ut64 len)
Creates a new buffer with a bytes array.
RZ_API ut64 rz_buf_fwd_scan(RZ_NONNULL RzBuffer *b, ut64 start, ut64 amount, RZ_NONNULL RzBufferFwdScan fwd_scan, RZ_NULLABLE void *user)
Scans buffer linearly in chunks calling fwd_scan for each chunk.
RZ_DEPRECATE RZ_API RZ_BORROW ut8 * rz_buf_data(RZ_NONNULL RzBuffer *b, RZ_NONNULL RZ_OUT ut64 *size)
Return a borrowed array of bytes representing the buffer data.
RZ_API ut64 rz_buf_size(RZ_NONNULL RzBuffer *b)
Return the size of the buffer.
static double rz_read_be_double(const void *src)
RZ_API void rz_event_send(RzEvent *ev, int type, void *data)
RZ_API int rz_hex_bin2str(const ut8 *in, int len, char *out)
RZ_API bool rz_id_pool_grab_id(RzIDPool *pool, ut32 *grabber)
RZ_API void * rz_id_storage_take(RzIDStorage *storage, ut32 id)
RZ_API void rz_id_storage_delete(RzIDStorage *storage, ut32 id)
RZ_API bool rz_id_pool_kick_id(RzIDPool *pool, ut32 kick)
void(* RzListFree)(void *ptr)
#define RZ_LOG_INFO(fmtstr,...)
#define RZ_LOG_WARN(fmtstr,...)
#define RZ_LOG_ERROR(fmtstr,...)
#define rz_strf(buf,...)
Convenience macro for local temporary strings.
RZ_API Sdb * sdb_new0(void)
RZ_API bool sdb_free(Sdb *s)
ut64 loadaddr
starting physical address to read from the target file
ut64 baseaddr
where the linker maps the binary in memory
XX curplugin == o->plugin.
RZ_DEPRECATE Sdb * sdb
deprecated, put info in C structures instead of this
int fd
when used in combination with RzIO, this refers to the io fd.
struct rz_bin_xtr_plugin_t * curxtr
RzBinObjectLoadOptions opts
struct rz_bin_plugin_t * plugin
RzList *(* hashes)(RzBinFile *bf)
void(* destroy)(RzBinFile *bf)
RZ_DEPRECATE RzBinFile * cur
never use this in new code! Get a file from the binfiles list or track it yourself.
void(* free_xtr)(void *xtr_obj)
void(* destroy)(RzBin *bin)
RzList *(* extractall_from_bytes)(RzBin *bin, const ut8 *buf, ut64 size)
RzList *(* extractall_from_buffer)(RzBin *bin, RzBuffer *buf)
ut64(WINAPI *w32_GetEnabledXStateFeatures)()
static const z80_opcode fd[]