aboutsummaryrefslogtreecommitdiff
path: root/subhook_x86.c
diff options
context:
space:
mode:
authorZeex <zeex@rocketmail.com>2013-12-05 02:04:59 +0700
committerZeex <zeex@rocketmail.com>2013-12-05 02:11:39 +0700
commitbab4da2a39751366b73dae704b7a04425efa7f13 (patch)
tree7f7a751bf8b6dc35393f4f7c8d0fdf5a575703cd /subhook_x86.c
parent57712a37181e8430a2a74eece1e9b25019e05843 (diff)
downloadsubhook-bab4da2a39751366b73dae704b7a04425efa7f13.zip
subhook-bab4da2a39751366b73dae704b7a04425efa7f13.tar.gz
subhook-bab4da2a39751366b73dae704b7a04425efa7f13.tar.bz2
Add subhook_t typedef
Diffstat (limited to 'subhook_x86.c')
-rw-r--r--subhook_x86.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/subhook_x86.c b/subhook_x86.c
index fdcfcf7..f106a67 100644
--- a/subhook_x86.c
+++ b/subhook_x86.c
@@ -47,18 +47,18 @@ struct subhook_x86 {
unsigned char code[SUBHOOK_JUMP_SIZE];
};
-int subhook_arch_new(struct subhook *hook) {
+int subhook_arch_new(subhook_t hook) {
if ((hook->arch = malloc(sizeof(struct subhook_x86))) == NULL)
return -ENOMEM;
return 0;
}
-void subhook_arch_free(struct subhook *hook) {
+void subhook_arch_free(subhook_t hook) {
free(hook->arch);
}
-SUBHOOK_EXPORT int SUBHOOK_API subhook_install(struct subhook *hook) {
+SUBHOOK_EXPORT int SUBHOOK_API subhook_install(subhook_t hook) {
static const unsigned char jmp = 0xE9;
void *src, *dst;
intptr_t offset;
@@ -72,7 +72,7 @@ SUBHOOK_EXPORT int SUBHOOK_API subhook_install(struct subhook *hook) {
subhook_unprotect(src, SUBHOOK_JUMP_SIZE);
memcpy(((struct subhook_x86 *)hook->arch)->code, src, SUBHOOK_JUMP_SIZE);
- /* E9 - jump near, relative */
+ /* E9 - jump near, relative */
memcpy(src, &jmp, sizeof(jmp));
/* jump address is relative to next instruction */
@@ -84,7 +84,7 @@ SUBHOOK_EXPORT int SUBHOOK_API subhook_install(struct subhook *hook) {
return 0;
}
-SUBHOOK_EXPORT int SUBHOOK_API subhook_remove(struct subhook *hook) {
+SUBHOOK_EXPORT int SUBHOOK_API subhook_remove(subhook_t hook) {
if (!subhook_is_installed(hook))
return -EINVAL;