Dear Heng Yin,
Thank you so much.
one more question.
This is prototype of CreateFile.
HANDLE WINAPI CreateFile(
_In_ LPCTSTR lpFileName,
_In_ DWORD dwDesiredAccess,
_In_ DWORD dwShareMode,
_In_opt_ LPSECURITY_ATTRIBUTES lpSecurityAttributes,
_In_ DWORD dwCreationDisposition,
_In_ DWORD dwFlagsAndAttributes,
_In_opt_ HANDLE hTemplateFile
);
Suppose I have a hook_context_t stucture, as in sample plugin.
typedef struct {
uint32_t call_stack[8]; //paramters and return address
DECAF_Handle hook_handle;
} hook_context_t;
and I fill it using the following statement:
DECAF_read_mem(NULL, cpu_single_env->regs[R_ESP], 8*4, ctx->call_stack);
Now the ctx->call_stack[1] is the address of LPCTSTR lpFileName,
char filename[1024]="\0";
DECAF_read_mem(NULL, ctx->call_stack[1], ?, filename);
But how can know the length of this CSTR?
Thanks and Regards,
Junjie
在 2015年6月9日星期二 UTC+8下午11:10:34,Heng Yin写道: