aboutsummaryrefslogtreecommitdiffstats
path: root/machoparse/cdhash.h
blob: 6cc559afe88bc7726423422798cdb0d8effcd4cf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#ifndef BLANKET__AMFID__CDHASH_H_
#define BLANKET__AMFID__CDHASH_H_

#include <stdbool.h>
#include <stdlib.h>
#include "cs_blobs.h"

struct hashes {
	uint32_t hash_type;
	uint8_t cdhash[20];
};

struct cdhashes {
	int count;
	struct hashes *h;
};

/*
 * compute_cdhash
 *
 * Description:
 * 	Compute the cdhash of a Mach-O file.
 *
 * Parameters:
 * 	file				The contents of the Mach-O file.
 * 	size				The size of the Mach-O file.
 * 	cdhash			out	On return, contains the cdhash of the file. Must be
 * 					CS_CDHASH_LEN bytes.
 */
//bool compute_cdhash(const void *file, size_t size, struct cdhash *cdhash);

int find_cdhash(const char *path, const struct stat *sb, struct cdhashes *h);

#endif