我可以使用Deviare来挂钩和拦截GetLocalTime
函数,但是如何更改字段的参数值,out
即编辑?我能找到很少的片段使用,不幸的是它是一个 void 函数并且直接分配什么都不做。wYear
SYSTEMTIME
NktHookCallInfo.Result
Field(0).Value
CreateHook("kernel32.dll!GetLocalTime", (int)eNktHookFlags.flgOnlyPostCall);
private static void OnFunctionCalled(NktHook hook, NktProcess process, NktHookCallInfo info)
{
NktParamsEnum param = info.Params();
NktParam value = param.First().Evaluate();
for (int i = 0; i < 8; i++)
{
NktParam field = value.Field(i);
Console.WriteLine("{0} {1} {2}", field.Name, field.TypeName, field.Value);
}
}
void WINAPI GetLocalTime(
_Out_ LPSYSTEMTIME lpSystemTime
);
typedef struct _SYSTEMTIME {
WORD wYear;
WORD wMonth;
WORD wDayOfWeek;
WORD wDay;
WORD wHour;
WORD wMinute;
WORD wSecond;
WORD wMilliseconds;
} SYSTEMTIME, *PSYSTEMTIME;