Click here to Skip to main content
16,004,919 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Unable to open a file Pin
toxcct23-Sep-04 4:23
toxcct23-Sep-04 4:23 
GeneralOracle connection Error Pin
nareshos22-Sep-04 18:55
nareshos22-Sep-04 18:55 
GeneralWindows file-caching Pin
tbornemisza22-Sep-04 17:05
tbornemisza22-Sep-04 17:05 
GeneralRe: Windows file-caching Pin
tbornemisza22-Sep-04 17:15
tbornemisza22-Sep-04 17:15 
GeneralRe: Windows file-caching Pin
Anonymous22-Sep-04 17:23
Anonymous22-Sep-04 17:23 
Generalwinctrl5 error Pin
google7322-Sep-04 16:56
google7322-Sep-04 16:56 
Questioncomponent gallery in VC++.net ? Pin
Maximilien22-Sep-04 15:48
Maximilien22-Sep-04 15:48 
Generalhooking problem Pin
Dev57822-Sep-04 14:27
Dev57822-Sep-04 14:27 
I am having trouble with the "Process-wide api spying" article by Anton Bassov. Here is the code:

HMODULE hMod = GetModuleHandle("kernel32.dll");
if (hMod == NULL)
MessageBox(NULL,"could not load dll","error",MB_OK);
else
{
IMAGE_DOS_HEADER * dosheader=(IMAGE_DOS_HEADER *)hMod;
IMAGE_OPTIONAL_HEADER * opthdr =(IMAGE_OPTIONAL_HEADER *) ((BYTE*)hMod+dosheader->e_lfanew+24);
IMAGE_IMPORT_DESCRIPTOR * descriptor=(IMAGE_IMPORT_DESCRIPTOR*)(BYTE*)hMod + opthdr->DataDirectory[IMAGE_DIRECTORY_ENTRY_IMPORT].VirtualAddress;

while(descriptor->FirstThunk)
{
char*dllname=(char*)((BYTE*)hMod+ descriptor->Name);
IMAGE_THUNK_DATA* thunk=( IMAGE_THUNK_DATA*)((BYTE*) hMod + descriptor->OriginalFirstThunk);

int x=0;
while(thunk->u1.Function)
{
char*functionname=(char*)((BYTE*) hMod + ( DWORD)thunk->u1.AddressOfData+2);
MessageBox(NULL,functionname,"function",MB_OK);
DWORD *IATentryaddress=( DWORD *)((BYTE*) hMod + descriptor->FirstThunk)+x;
x++; thunk++;
}
descriptor++;
}
}


It is crashing at run-time, saying that it cannot read from desciptor. Anyone have any idea what the problem is? Any help is appreciated.

-Dev578
GeneralDeleting a self-created CView or CMDIChildWnd object.. Pin
herbert_chow22-Sep-04 11:48
herbert_chow22-Sep-04 11:48 
Questiongetting info from VS_VERSION_INFO? Pin
BlackDice22-Sep-04 11:39
BlackDice22-Sep-04 11:39 
AnswerRe: getting info from VS_VERSION_INFO? Pin
Michael Dunn22-Sep-04 11:42
sitebuilderMichael Dunn22-Sep-04 11:42 
AnswerRe: getting info from VS_VERSION_INFO? Pin
Graham Bradshaw22-Sep-04 13:37
Graham Bradshaw22-Sep-04 13:37 
GeneralRe: getting info from VS_VERSION_INFO? Pin
ThatsAlok23-Sep-04 3:17
ThatsAlok23-Sep-04 3:17 
GeneralRe: getting info from VS_VERSION_INFO? Pin
BlackDice23-Sep-04 7:22
BlackDice23-Sep-04 7:22 
QuestionHow to avoid editing date in Datetime picker ? Pin
ldaoust22-Sep-04 10:48
ldaoust22-Sep-04 10:48 
GeneralOnWizardNext question ... Pin
Maximilien22-Sep-04 10:17
Maximilien22-Sep-04 10:17 
GeneralRe: OnWizardNext question ... Pin
Michael Dunn22-Sep-04 11:43
sitebuilderMichael Dunn22-Sep-04 11:43 
GeneralRe: OnWizardNext question ... Pin
Maximilien22-Sep-04 15:26
Maximilien22-Sep-04 15:26 
QuestionODBC, ADO or OLEDB ? Pin
0v3rloader22-Sep-04 10:15
0v3rloader22-Sep-04 10:15 
AnswerRe: ODBC, ADO or OLEDB ? Pin
Alexander M.,22-Sep-04 10:38
Alexander M.,22-Sep-04 10:38 
AnswerRe: ODBC, ADO or OLEDB ? Pin
Anonymous22-Sep-04 17:30
Anonymous22-Sep-04 17:30 
GeneralRe: ODBC, ADO or OLEDB ? Pin
Anonymous22-Sep-04 17:35
Anonymous22-Sep-04 17:35 
AnswerRe: ODBC, ADO or OLEDB ? Pin
cmk22-Sep-04 22:22
cmk22-Sep-04 22:22 
GeneralRe: ODBC, ADO or OLEDB ? Pin
0v3rloader23-Sep-04 4:39
0v3rloader23-Sep-04 4:39 
GeneralRe: ODBC, ADO or OLEDB ? Pin
cmk23-Sep-04 10:46
cmk23-Sep-04 10:46 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.