summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2020-12-02 13:59:38 -0500
committerPeter Jones <pjones@redhat.com>2021-02-13 11:02:59 -0500
commit06e98a10f639ba53201876f2ff9fbd468bfa8189 (patch)
tree1117e4c43121edb5a683ae0bcd9fcdcf3fca38ef /include
parent186595864c4c7c47fe3a9795e4867b8a72205e38 (diff)
downloadefi-boot-shim-06e98a10f639ba53201876f2ff9fbd468bfa8189.tar.gz
efi-boot-shim-06e98a10f639ba53201876f2ff9fbd468bfa8189.zip
Move a bunch of PE-related stuff out of shim.c
Signed-off-by: Peter Jones <pjones@redhat.com>
Diffstat (limited to 'include')
-rw-r--r--include/pe.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/include/pe.h b/include/pe.h
new file mode 100644
index 00000000..7f2236e4
--- /dev/null
+++ b/include/pe.h
@@ -0,0 +1,35 @@
+// SPDX-License-Identifier: BSD-2-Clause-Patent
+/*
+ * pe.h - helper functions for pe binaries.
+ * Copyright Peter Jones <pjones@redhat.com>
+ */
+
+#ifndef PE_H_
+#define PE_H_
+
+void *
+ImageAddress (void *image, uint64_t size, uint64_t address);
+
+EFI_STATUS
+read_header(void *data, unsigned int datasize,
+ PE_COFF_LOADER_IMAGE_CONTEXT *context);
+
+EFI_STATUS
+handle_image (void *data, unsigned int datasize,
+ EFI_LOADED_IMAGE *li,
+ EFI_IMAGE_ENTRY_POINT *entry_point,
+ EFI_PHYSICAL_ADDRESS *alloc_address,
+ UINTN *alloc_pages);
+
+EFI_STATUS
+generate_hash (char *data, unsigned int datasize_in,
+ PE_COFF_LOADER_IMAGE_CONTEXT *context,
+ UINT8 *sha256hash, UINT8 *sha1hash);
+
+EFI_STATUS
+relocate_coff (PE_COFF_LOADER_IMAGE_CONTEXT *context,
+ EFI_IMAGE_SECTION_HEADER *Section,
+ void *orig, void *data);
+
+#endif /* !PE_H_ */
+// vim:fenc=utf-8:tw=75:noet