summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2017-01-29 02:31:00 +0000
committermidipix <writeonce@midipix.org>2017-01-28 21:54:03 -0500
commit8bf8b6bb6a1866d8a2cac15c745cbe6fdb04e63c (patch)
tree7db8c29e2e4ec0852130dc23f1db5b533cd5cb37
parentdd1a85ac7ce0c3e2aa16243c73a9aaae7da384fb (diff)
downloadpemagine-8bf8b6bb6a1866d8a2cac15c745cbe6fdb04e63c.tar.bz2
pemagine-8bf8b6bb6a1866d8a2cac15c745cbe6fdb04e63c.tar.xz
ldso: added pe_ldso.h to ensure namespace isolation in hosted executables.
-rw-r--r--include/pemagine/pe_ldso.h42
-rw-r--r--include/pemagine/pemagine.h1
-rw-r--r--project/headers.mk1
3 files changed, 44 insertions, 0 deletions
diff --git a/include/pemagine/pe_ldso.h b/include/pemagine/pe_ldso.h
new file mode 100644
index 0000000..f7ae6af
--- /dev/null
+++ b/include/pemagine/pe_ldso.h
@@ -0,0 +1,42 @@
+#ifndef PE_LDSO_H
+#define PE_LDSO_H
+
+#ifdef PE_LDSO
+
+#define pe_enum_image_exports __ldso_enum_image_exports
+#define pe_enum_image_import_hdrs __ldso_enum_image_import_hdrs
+#define pe_enum_modules_in_init_order __ldso_enum_modules_in_init_order
+#define pe_enum_modules_in_load_order __ldso_enum_modules_in_load_order
+#define pe_enum_modules_in_memory_order __ldso_enum_modules_in_memory_order
+#define pe_find_framework_loader __ldso_find_framework_loader
+#define pe_get_export_symbol_info __ldso_get_export_symbol_info
+#define pe_get_first_module_handle __ldso_get_first_module_handle
+#define pe_get_framework_runtime_data __ldso_get_framework_runtime_data
+#define pe_get_image_coff_hdr_addr __ldso_get_image_coff_hdr_addr
+#define pe_get_image_data_dirs_addr __ldso_get_image_data_dirs_addr
+#define pe_get_image_dos_hdr_addr __ldso_get_image_dos_hdr_addr
+#define pe_get_image_entry_point_addr __ldso_get_image_entry_point_addr
+#define pe_get_image_export_hdr_addr __ldso_get_image_export_hdr_addr
+#define pe_get_image_import_dir_addr __ldso_get_image_import_dir_addr
+#define pe_get_image_named_section_addr __ldso_get_image_named_section_addr
+#define pe_get_image_opt_hdr_addr __ldso_get_image_opt_hdr_addr
+#define pe_get_image_section_tbl_addr __ldso_get_image_section_tbl_addr
+#define pe_get_image_special_hdr_addr __ldso_get_image_special_hdr_addr
+#define pe_get_image_stack_heap_info __ldso_get_image_stack_heap_info
+#define pe_get_import_symbol_info __ldso_get_import_symbol_info
+#define pe_get_kernel32_module_handle __ldso_get_kernel32_module_handle
+#define pe_get_module_handle __ldso_get_module_handle
+#define pe_get_ntdll_module_handle __ldso_get_ntdll_module_handle
+#define pe_get_peb_command_line __ldso_get_peb_command_line
+#define pe_get_peb_environment_block __ldso_get_peb_environment_block
+#define pe_get_procedure_address __ldso_get_procedure_address
+#define pe_get_symbol_module_info __ldso_get_symbol_module_info
+#define pe_get_symbol_name __ldso_get_symbol_name
+#define pe_load_framework_loader __ldso_load_framework_loader
+#define pe_open_image_from_addr __ldso_open_image_from_addr
+#define pe_open_physical_parent_directory __ldso_open_physical_parent_directory
+#define pe_terminate_current_process __ldso_terminate_current_process
+
+#endif
+
+#endif
diff --git a/include/pemagine/pemagine.h b/include/pemagine/pemagine.h
index e88e244..afc42c7 100644
--- a/include/pemagine/pemagine.h
+++ b/include/pemagine/pemagine.h
@@ -4,6 +4,7 @@
#include "pe_api.h"
#include "pe_consts.h"
#include "pe_structs.h"
+#include "pe_ldso.h"
#ifdef __cplusplus
extern "C" {
diff --git a/project/headers.mk b/project/headers.mk
index f9ee61d..a01f02c 100644
--- a/project/headers.mk
+++ b/project/headers.mk
@@ -3,6 +3,7 @@ API_HEADERS = \
$(PROJECT_DIR)/include/$(PACKAGE)/pe_api.h \
$(PROJECT_DIR)/include/$(PACKAGE)/pe_consts.h \
$(PROJECT_DIR)/include/$(PACKAGE)/pe_inline_asm.h \
+ $(PROJECT_DIR)/include/$(PACKAGE)/pe_ldso.h \
$(PROJECT_DIR)/include/$(PACKAGE)/pe_structs.h \
API_HEADERS_NT32 = \