-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathBNCustomRelocationHandler.cs
More file actions
59 lines (53 loc) · 1.57 KB
/
Copy pathBNCustomRelocationHandler.cs
File metadata and controls
59 lines (53 loc) · 1.57 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
using System;
using System.Runtime.InteropServices;
namespace BinaryNinja
{
internal static partial class NativeDelegates
{
[UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)]
internal delegate void BNRelocationHandlerFreeObject(IntPtr context);
[UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
internal delegate bool BNRelocationHandlerGetRelocationInfo(
IntPtr context,
IntPtr view,
IntPtr architecture,
IntPtr result,
ulong resultCount
);
[UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)]
[return: MarshalAs(UnmanagedType.I1)]
internal delegate bool BNRelocationHandlerApplyRelocation(
IntPtr context,
IntPtr view,
IntPtr architecture,
IntPtr relocation,
IntPtr destination,
ulong length
);
[UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.Cdecl)]
internal delegate ulong BNRelocationHandlerGetOperandForExternalRelocation(
IntPtr context,
IntPtr data,
ulong address,
ulong length,
IntPtr lowLevelIl,
IntPtr relocation
);
}
[StructLayout(LayoutKind.Sequential)]
internal struct BNCustomRelocationHandler
{
internal IntPtr context;
internal IntPtr freeObject;
internal IntPtr getRelocationInfo;
internal IntPtr applyRelocation;
internal IntPtr getOperandForExternalRelocation;
}
/// <summary>
/// Retained for source compatibility. Custom handlers derive from RelocationHandler.
/// </summary>
public class CustomRelocationHandler
{
}
}