delete comments
parent
388d892263
commit
2810b887a9
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define RET 0xC3 // ret opcode
|
||||
|
||||
|
@ -13,8 +14,8 @@ byte* AF_address(byte* f) {
|
|||
real_address = f;
|
||||
#else // MSVC debug mode
|
||||
byte* f_p = f;
|
||||
byte* offset = (byte*)(*((int*)f_p) >> 8);
|
||||
real_address = f_p + (int)offset + 5;
|
||||
byte* offset = (byte*)(*((int32_t*)f_p) >> 8);
|
||||
real_address = f_p + (int32_t)offset + 5;
|
||||
#endif
|
||||
#elif defined(__GNUC__) // GCC
|
||||
real_address = f;
|
||||
|
@ -23,13 +24,14 @@ byte* AF_address(byte* f) {
|
|||
}
|
||||
|
||||
// Print bytes from address to address+size
|
||||
int AF_print_bytes(byte* a, int size) {
|
||||
for (int i = 0; i < size; ++i) {
|
||||
int32_t AF_print_bytes(byte* a, int32_t size) {
|
||||
for (int32_t i = 0; i < size; ++i) {
|
||||
printf("%02X ", *(a + i));
|
||||
}
|
||||
}
|
||||
|
||||
// Get any function size
|
||||
int AF_size(byte* f) {
|
||||
int32_t AF_size(byte* f) {
|
||||
byte* p = f;
|
||||
for (; *p != RET; ++p);
|
||||
return p - f + 1;
|
||||
|
|
Loading…
Reference in New Issue