Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit cb74eb5

Browse filesBrowse files
committed
Restored old functionality.
1 parent e968a29 commit cb74eb5
Copy full SHA for cb74eb5

File tree

Expand file treeCollapse file tree

1 file changed

+8
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-2
lines changed

‎ReClass.NET/AddressParser/DynamicCompiler.cs

Copy file name to clipboardExpand all lines: ReClass.NET/AddressParser/DynamicCompiler.cs
+8-2Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,15 @@ private static Expression GenerateMethodBody(IExpression expression, Expression
102102
{
103103
var addressParameter = GenerateMethodBody(readMemoryExpression.Expression, processParameter);
104104

105-
var readRemoteIntPtrFn = typeof(IRemoteMemoryReaderExtension).GetRuntimeMethod(nameof(IRemoteMemoryReaderExtension.ReadRemoteIntPtr), new[] { typeof(IRemoteMemoryReader), typeof(IntPtr) });
105+
var functionName = readMemoryExpression.ByteCount == 4 ? nameof(IRemoteMemoryReaderExtension.ReadRemoteInt32) : nameof(IRemoteMemoryReaderExtension.ReadRemoteInt64);
106+
var readRemoteIntPtrFn = typeof(IRemoteMemoryReaderExtension).GetRuntimeMethod(functionName, new[] { typeof(IRemoteMemoryReader), typeof(IntPtr) });
106107

107-
return Expression.Call(null, readRemoteIntPtrFn, processParameter, addressParameter);
108+
var callExpression = Expression.Call(null, readRemoteIntPtrFn, processParameter, addressParameter);
109+
110+
var paramType = readMemoryExpression.ByteCount == 4 ? typeof(int) : typeof(long);
111+
var convertFn = typeof(IntPtrExtension).GetRuntimeMethod(nameof(IntPtrExtension.From), new[] { paramType });
112+
113+
return Expression.Call(null, convertFn, callExpression);
108114
}
109115
}
110116

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.