26 char *hashtype =
strdup(
bin->spcinfo->messageDigest.digestAlgorithm.algorithm->string);
34 ut32 checksum_paddr =
bin->nt_header_offset + 4 +
sizeof(
PE_(image_file_header)) + 0x40;
35 ut32 security_entry_offset =
bin->nt_header_offset +
sizeof(
PE_(image_nt_headers)) - 96;
37 PE_DWord security_dir_offset = data_dir_security->VirtualAddress;
38 ut32 security_dir_size = data_dir_security->Size;
61 if (!
bin->authentihash) {
64 return bin->authentihash;
68 return bin->is_authhash_valid;
72 if (!
bin || !
bin->nt_headers) {
75 if (
bin->nt_headers->optional_header.NumberOfRvaAndSizes < 5) {
79 PE_DWord paddr = data_dir_security->VirtualAddress;
87 if (!security_directory) {
90 bin->security_directory = security_directory;
138 security_directory->
length++;
142 if (
bin->cms &&
bin->spcinfo) {
145 if (actual_authentihash && claimed_authentihash) {
146 bin->is_authhash_valid = !strcmp(actual_authentihash, claimed_authentihash);
148 bin->is_authhash_valid =
false;
150 free((
void *)claimed_authentihash);
157 if (!security_directory) {
161 for (; numCert < security_directory->length; numCert++) {
162 free(security_directory->certificates[numCert]);
164 free(security_directory->certificates);
165 free(security_directory);
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 void rz_hash_cfg_free(RZ_NONNULL RzHashCfg *md)
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)
void * realloc(void *ptr, size_t size)
void * malloc(size_t size)
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")
char *PE_() bin_pe_compute_authentihash(RzBinPEObj *bin)
int PE_() bin_pe_init_security(RzBinPEObj *bin)
static ut64 buf_fwd_hash(const ut8 *buf, ut64 size, void *user)
void PE_() free_security_directory(Pe_image_security_directory *security_directory)
static const char *PE_() bin_pe_get_claimed_authentihash(RzBinPEObj *bin)
int PE_() bin_pe_is_authhash_valid(RzBinPEObj *bin)
const char *PE_() bin_pe_get_authentihash(RzBinPEObj *bin)
#define PE_WIN_CERT_TYPE_PKCS_SIGNED_DATA
#define PE_IMAGE_DIRECTORY_ENTRY_SECURITY
#define rz_buf_read_le16_at(b, addr, result)
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.
#define rz_buf_read_le32_at(b, addr, result)
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_API ut64 rz_buf_size(RZ_NONNULL RzBuffer *b)
Return the size of the buffer.
RZ_API char * rz_hex_bin2strdup(const ut8 *in, int len)
#define RZ_LOG_INFO(fmtstr,...)
#define RZ_LOG_ERROR(fmtstr,...)
RZ_API RCMS * rz_pkcs7_parse_cms(const ut8 *buffer, ut32 length)
RZ_API SpcIndirectDataContent * rz_pkcs7_parse_spcinfo(RCMS *cms)
RZ_API int rz_str_replace_char(char *s, int a, int b)
Pe_certificate ** certificates
ut64(WINAPI *w32_GetEnabledXStateFeatures)()