aboutsummaryrefslogtreecommitdiffstats
path: root/machoparse/cdhash.h
diff options
context:
space:
mode:
authorCameron Katri <me@cameronkatri.com>2022-05-20 10:42:38 -0400
committerCameron Katri <me@cameronkatri.com>2022-05-20 10:42:38 -0400
commitaa035f73ce081b3f07247bd15860d72355a096b2 (patch)
tree170a83f5aa816f936df5ae906f20da3fb6b9404e /machoparse/cdhash.h
downloadtrustcache-aa035f73ce081b3f07247bd15860d72355a096b2.tar.gz
trustcache-aa035f73ce081b3f07247bd15860d72355a096b2.zip
Initial import
Diffstat (limited to 'machoparse/cdhash.h')
-rw-r--r--machoparse/cdhash.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/machoparse/cdhash.h b/machoparse/cdhash.h
new file mode 100644
index 0000000..6cc559a
--- /dev/null
+++ b/machoparse/cdhash.h
@@ -0,0 +1,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