本文整理汇总了C#中System.Diagnostics.Process.ReadInt32方法的典型用法代码示例。如果您正苦于以下问题:C# Process.ReadInt32方法的具体用法?C# Process.ReadInt32怎么用?C# Process.ReadInt32使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Diagnostics.Process
的用法示例。
在下文中一共展示了Process.ReadInt32方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: GetBaseEntityMemberOffset
// also works for anything derived from CBaseEntity (player etc) (no multiple inheritance)
// var must be included by one of the DEFINE_FIELD macros
public static bool GetBaseEntityMemberOffset(string member, Process game, SignatureScanner scanner, out int offset)
{
offset = -1;
IntPtr stringPtr = scanner.Scan(new SigScanTarget(0, Encoding.ASCII.GetBytes(member)));
if (stringPtr == IntPtr.Zero)
return false;
var b = BitConverter.GetBytes(stringPtr.ToInt32());
var target = new SigScanTarget(10,
String.Format("C7 05 ?? ?? ?? ?? {0:X02} {1:X02} {2:X02} {3:X02}", b[0], b[1], b[2], b[3])); // mov dword_15E2BF1C, offset aM_fflags ; "m_fFlags"
target.OnFound = (proc, s, ptr) => {
// this instruction is almost always directly after above one, but there are a few cases where it isn't
// so we have to scan down and find it
var proximityScanner = new SignatureScanner(proc, ptr, 256);
return proximityScanner.Scan(new SigScanTarget(6, "C7 05 ?? ?? ?? ?? ?? ?? 00 00")); // mov dword_15E2BF20, 0CCh
};
IntPtr addr = scanner.Scan(target);
if (addr == IntPtr.Zero)
return false;
return game.ReadInt32(addr, out offset);
}