diff options
author | Zeex <zeex@rocketmail.com> | 2016-08-28 03:32:50 +0600 |
---|---|---|
committer | Zeex <zeex@rocketmail.com> | 2016-08-28 03:32:52 +0600 |
commit | d4f4d17d9dd6a4740f65c5f7e72ef9989e5b25b8 (patch) | |
tree | c8d27fbb015f17a1cbffbd6fda4dd90dc38448e6 /subhook_x86.c | |
parent | a8d7b7835502f618e8db92f03bd040d4dab12760 (diff) | |
download | subhook-d4f4d17d9dd6a4740f65c5f7e72ef9989e5b25b8.zip subhook-d4f4d17d9dd6a4740f65c5f7e72ef9989e5b25b8.tar.gz subhook-d4f4d17d9dd6a4740f65c5f7e72ef9989e5b25b8.tar.bz2 |
Fix trampoline size calculation
Fixes #18.
Diffstat (limited to 'subhook_x86.c')
-rw-r--r-- | subhook_x86.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/subhook_x86.c b/subhook_x86.c index 46645cc..ee0840e 100644 --- a/subhook_x86.c +++ b/subhook_x86.c @@ -354,7 +354,7 @@ SUBHOOK_EXPORT subhook_t SUBHOOK_API subhook_new(void *src, hook->dst = dst; hook->options = options; hook->jmp_size = subhook_get_jmp_size(hook->options); - hook->trampoline_size = hook->jmp_size + MAX_INSN_LEN - 1; + hook->trampoline_size = hook->jmp_size * 2 + MAX_INSN_LEN; hook->trampoline_len = 0; if ((hook->code = malloc(hook->jmp_size)) == NULL) { |