下面的代码是读取浮点数的示例,有人可以建议修改函数以读取字符串吗?
public static float ReadPointerFloat(string EXENAME, int Pointer, int[] Offset)
{
float Value = 0;
checked
{
try
{
Process[] Proc = Process.GetProcessesByName(EXENAME);
if (Proc.Length != 0)
{
int Bytes = 0;
int Handle = OpenProcess(PROCESS_ALL_ACCESS, 0, Proc[0].Id);
if (Handle != 0)
{
foreach (int i in Offset)
{
ReadProcessMemoryInteger((int)Handle, Pointer, ref Pointer, 4, ref Bytes);
Pointer += i;
}
ReadProcessMemoryFloat((int)Handle, Pointer, ref Value, 4, ref Bytes);
CloseHandle(Handle);
}
}
}
catch
{ }
}
return Value;
}
也许读取一个字节数组并应用它?
ASCIIEncoding.ASCII.GetString(variableholdingresultoffunction);