From 24fdac29fb8a1c7766869b05e7a17b2c4cc98ce1 Mon Sep 17 00:00:00 2001 From: Nathan Lee Date: Sun, 12 Jul 2026 12:42:31 -0500 Subject: create elf.h The ELF parser needs more work, there are more structs to be added. memcpy was refactored from mem.h into common.h endianness conversions were standardized in types.h --- include/common.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'include/common.h') diff --git a/include/common.h b/include/common.h index 86f1f9c..88ee8c4 100644 --- a/include/common.h +++ b/include/common.h @@ -16,4 +16,11 @@ static inline int strcmp(const char *str1, const char* str2) { return *(const unsigned char *)str1 - *(const unsigned char *)str2; } - +static inline void *memcpy(void *restrict dest, const void* restrict src, size_t size) { + unsigned char *d = (unsigned char *)dest; + unsigned char *s = (unsigned char *)src; + for (size_t i = 0; i < size; i++) { + d[i] = s[i]; + } + return d; +} -- cgit v1.2.3