16 bin->sub_bin_dos = sub_bin_dos;
21 bin->sub_bin_native = sub_bin_native;
24 bin->sub_bin_net = sub_bin_net;
33 ut64 pe_hdr_off = pe_bin->dos_header->e_lfanew;
37 if (!(tmp_buf =
malloc(pe_hdr_off))) {
53 sub_bin_dos->size = pe_hdr_off;
54 sub_bin_dos->dos_header = pe_bin->dos_header;
84 int dotnet_offset = pe_bin->dos_header->e_lfanew;
85 dotnet_offset +=
sizeof(
PE_(image_nt_headers));
86 dotnet_offset -=
sizeof(
PE_(image_data_directory)) * 2;
97 if (
rz_buf_write_at(sub_bin_native->b, dotnet_offset, zero_out,
sizeof(
PE_(image_data_directory))) < -1) {
100 free(sub_bin_native);
106 return sub_bin_native;
122 return bin->sub_bin_dos;
124 return bin->sub_bin_native;
126 return bin->sub_bin_net;
134 return flag & check_mask;
146 if (
bin->sub_bin_dos) {
176 if (!pe_bin->clr || !pe_bin->clr->header) {
RZ_API void Ht_() free(HtName_(Ht) *ht)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
void * malloc(size_t size)
void * calloc(size_t number, size_t size)
void *PE_() rz_bin_pe_free(RzBinPEObj *bin)
RzBinPEObj *PE_() rz_bin_pe_new_buf(RzBuffer *buf, bool verbose)
struct rz_bin_pemixed_obj_t * rz_bin_pemixed_from_bytes_new(const ut8 *buf, ut64 size)
RzBinPEObj * rz_bin_pemixed_extract(struct rz_bin_pemixed_obj_t *bin, int sub_bin)
static bool check_il_only(ut32 flags)
RzBinPEObj * rz_bin_pemixed_init_dos(RzBinPEObj *pe_bin)
void * rz_bin_pemixed_free(struct rz_bin_pemixed_obj_t *bin)
static int rz_bin_pemixed_init(struct rz_bin_pemixed_obj_t *bin, RzBinPEObj *pe_bin)
RzBinPEObj * rz_bin_pemixed_init_native(RzBinPEObj *pe_bin)
RZ_API st64 rz_buf_write_at(RZ_NONNULL RzBuffer *b, ut64 addr, RZ_NONNULL const ut8 *buf, ut64 len)
Write len bytes of the buffer at the specified address.
RZ_API RZ_OWN RzBuffer * rz_buf_new_with_buf(RzBuffer *b)
Creates a new buffer from a source buffer.
RZ_API st64 rz_buf_read_at(RZ_NONNULL RzBuffer *b, ut64 addr, RZ_NONNULL RZ_OUT ut8 *buf, ut64 len)
Read len bytes of the buffer at the specified address.
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.
#define RZ_LOG_ERROR(fmtstr,...)
static struct sockaddr static addrlen static backlog const void static flags void flags
ut64(WINAPI *w32_GetEnabledXStateFeatures)()