From 7e94bfb3073de8d20d51e1d02a6c6e698a295a13 Mon Sep 17 00:00:00 2001 From: Nicholas Hastings Date: Wed, 28 Dec 2022 17:50:51 -0500 Subject: [PATCH] Fix asm.c compiler warnings on Windows. (#1897) --- public/asm/asm.c | 4 ++-- public/asm/asm.h | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/public/asm/asm.c b/public/asm/asm.c index 24383b89..44337f7e 100644 --- a/public/asm/asm.c +++ b/public/asm/asm.c @@ -1,10 +1,10 @@ #include "asm.h" #include "libudis86/udis86.h" +#include #ifndef WIN32 #define _GNU_SOURCE #include -#include #include #include @@ -89,7 +89,7 @@ void check_thunks(unsigned char *dest, unsigned char *pc) #endif } -int copy_bytes(unsigned char *func, unsigned char *dest, int required_len) +int copy_bytes(unsigned char *func, unsigned char *dest, unsigned int required_len) { ud_t ud_obj; ud_init(&ud_obj); diff --git a/public/asm/asm.h b/public/asm/asm.h index 5176a7c9..d61ff30f 100644 --- a/public/asm/asm.h +++ b/public/asm/asm.h @@ -1,5 +1,4 @@ -#ifndef __ASM_H__ -#define __ASM_H__ +#pragma once #define OP_JMP 0xE9 #define OP_JMP_SIZE 5 @@ -23,7 +22,7 @@ void check_thunks(unsigned char *dest, unsigned char *pc); //if dest is NULL, returns minimum number of bytes needed to be copied //if dest is not NULL, it will copy the bytes to dest as well as fix CALLs and JMPs //http://www.devmaster.net/forums/showthread.php?t=2311 -int copy_bytes(unsigned char *func, unsigned char* dest, int required_len); +int copy_bytes(unsigned char *func, unsigned char* dest, unsigned int required_len); //insert a specific JMP instruction at the given location void inject_jmp(void* src, void* dest); @@ -37,5 +36,3 @@ void* eval_jump(void* src); #ifdef __cplusplus } #endif - -#endif //__ASM_H__