Fix asm.c compiler warnings on Windows. (#1897)

This commit is contained in:
Nicholas Hastings 2022-12-28 17:50:51 -05:00 committed by GitHub
parent 51bba0b894
commit 7e94bfb307
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 7 deletions

View File

@ -1,10 +1,10 @@
#include "asm.h"
#include "libudis86/udis86.h"
#include <string.h>
#ifndef WIN32
#define _GNU_SOURCE
#include <dlfcn.h>
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
@ -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);

View File

@ -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__