-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathbridge.h
More file actions
67 lines (57 loc) · 2.59 KB
/
bridge.h
File metadata and controls
67 lines (57 loc) · 2.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
#import <Foundation/Foundation.h>
#import <objc/message.h>
#include <dlfcn.h>
#include "32bit.h"
#include "dynarmic.h"
#define SEL_RETURN_STRUCT ((u64)1 << 63)
__BEGIN_DECLS
typedef struct LC32_stret {
char *stretAddr;
u64 self; // or objc_super
} LC32_stret;
typedef struct LC32_SixDoubles {
double value[6];
} TEMP_SixDoubles;
void LC32_objc_msgSend_stret(/* LC32_stret stret, SEL sel, ... */);
void LC32_objc_msgSendSuper_stret(/* LC32_stret stret, SEL sel, ... */);
extern int __CFConstantStringClassReference[];
@interface NSObject(LC32)
- (void)setGuestClass:(BOOL)value;
- (BOOL)isGuestClass;
- (void)setGuest_self:(u32)ptr;
- (u32)guest_self;
@end
// dummy function to get and set double registers. CGAffineTransform takes up to 6 doubles
LC32_SixDoubles LC32GetDoubleRegisters();
void LC32SetDoubleRegisters(double d0, double d1, double d2, double d3, double d4, double d5);
u32 LC32HostToGuestCopyClassName(u32 guest_output, size_t length, u64 host_object);
//u64 LC32Dlsym(u32 guest_name);
u64 LC32GetHostObject(u32 guest_self, u32 guest_class, bool returnClass);
u64 LC32GetHostSelector(u32 guest_selector);
u64 LC32InvokeHostSelector(u64 host_self, u64 host_cmd, u64 va_args);
void LC32SetInvokeGuestFuncPtr(u32 dlsymFunc, u32 invokeFunc);
u64 LC32InvokeGuestC(u32 pc, bool ret64, int argc, u32 *args);
u32 LC32HostToGuestArgument(char *type, u64 value);
u64 LC32GuestToHostReturnType(char *type, u32 value);
u64 LC32InvokeGuestSelector(id self, SEL _cmd, u64 arg2, u64 arg3, u64 arg4, u64 arg5, u64 arg6, u64 arg7, ...);
u32 guest_dlsym(const char *host_name);
u32 guest_free(u32 guest_ptr);
u32 guest_class_copyIvarList(u32 guest_cls, unsigned int *outCount);
u32 guest_class_copyMethodList(u32 guest_cls, unsigned int *outCount);
u32 guest_class_copyProtocolList(u32 guest_cls, unsigned int *outCount);
u32 guest_class_createInstance(u32 guest_cls, u32 extraBytes);
u32 guest_class_getClassMethod(u32 guest_cls, u32 guest_sel);
u32 guest_class_getInstanceMethod(u32 guest_cls, u32 guest_sel);
u32 guest_class_getName(u32 guest_cls);
u32 guest_class_getSuperclass(u32 guest_cls);
u32 guest_ivar_getName(u32 guest_ivar);
u32 guest_ivar_getTypeEncoding(u32 guest_ivar);
u32 guest_object_getClass(u32 guest_obj);
u32 guest_object_setInstanceVariable(u32 guest_obj, const char *host_name, u32 newValue);
u32 guest_protocol_getName(u32 guest_ivar);
u32 guest_sel_registerName(const char *host_name);
u32 guest_objc_getClass(const char *name);
Class guest_objc_getClass_retHostClass(const char *name);
u64 guest_objc_msgSend(int argc, u32 *args);
BOOL host_hook_getClass(const char *name, Class *outClass);
__END_DECLS