File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Filter options
ReClass.NET/AddressParser Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Original file line number Diff line number Diff line change @@ -102,9 +102,15 @@ private static Expression GenerateMethodBody(IExpression expression, Expression
102
102
{
103
103
var addressParameter = GenerateMethodBody ( readMemoryExpression . Expression , processParameter ) ;
104
104
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 ) } ) ;
106
107
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 ) ;
108
114
}
109
115
}
110
116
You can’t perform that action at this time.
0 commit comments