EDN Admin
Well-known member
Good afternoon everyone,
I hava a wrong with function.Here is the code:
<pre class="prettyprint HMODULE hMoudle2=LoadLibraryEx("C:\WINDOWS\system32\igxpgd32.dll", NULL,DONT_RESOLVE_DLL_REFERENCES);
DWORD dwErrNum=0;
if (hMoudle == NULL)
dwErrNum=GetLastError();
//__stdcall wrong,FAR PASCAL wrong,__cdcel wrong
//project page:stdcall(/gz) wrong,__cdecl (/Gd) wrong,fastcall :buffer overrun
typedef BOOL (*pDrvEnableDriver)(
ULONG iEngineVersion,
ULONG cj,
DRVENABLEDATA *pded
);
pDrvEnableDriver pMyDrvEnableDriver=(pDrvEnableDriver)GetProcAddress(hMoudle2,"DrvEnableDriver");
DRVENABLEDATA DrvData;
try
{
BOOL bRe=pMyDrvEnableDriver(DDI_DRIVER_VERSION_NT5,sizeof(DRVENABLEDATA),&DrvData); /* DrvData is Assignmented,bRe doesnt change,connot return,ErrMsg:Unhandled exception at 0x00024374 in graphedt.exe: 0xC0000005: Access violation reading location 0x00024374. */
dwErrNum=GetLastError(); //connot run to here
}catch(...)
{}
[/code]
The Assembly code:
<pre class="prettyprint HMODULE hMoudle2=LoadLibraryEx("C:\WINDOWS\system32\igxpgd32.dll",
NULL,DONT_RESOLVE_DLL_REFERENCES);
100699FD mov esi,esp
100699FF push 1
10069A01 push 0
10069A03 push offset string "C:\WINDOWS\system32\igxpgd32.dll"... (101184A4h)
10069A08 call dword ptr [__imp__LoadLibraryExA@12 (1014C728h)]
10069A0E cmp esi,esp
10069A10 call @ILT+9915(__RTC_CheckEsp) (1005C6C0h)
10069A15 mov dword ptr [ebp-1CD8h],eax
DWORD dwErrNum=0;
10069A1B mov dword ptr [ebp-1CE4h],0
if (hMoudle == NULL)
10069A25 cmp dword ptr [ebp-1CCCh],0
10069A2C jne CVideoProcessorFilter::LoadProcessorModule+3B3h (10069A43h)
dwErrNum=GetLastError();
10069A2E mov esi,esp
10069A30 call dword ptr [__imp__GetLastError@0 (1014C724h)]
10069A36 cmp esi,esp
10069A38 call @ILT+9915(__RTC_CheckEsp) (1005C6C0h)
10069A3D mov dword ptr [ebp-1CE4h],eax
//__stdcall wrong,FAR PASCAL wrong,__cdcel wrong
//project page:stdcall(/gz) wrong,__cdecl (/Gd) wrong,fastcall :buffer overrun
typedef BOOL (*pDrvEnableDriver)(
ULONG iEngineVersion,
ULONG cj,
DRVENABLEDATA *pded
);
pDrvEnableDriver pMyDrvEnableDriver=(pDrvEnableDriver)GetProcAddress(hMoudle2,"DrvEnableDriver");
10069A43 mov esi,esp
10069A45 push offset string "DrvEnableDriver" (10118490h)
10069A4A mov eax,dword ptr [ebp-1CD8h]
10069A50 push eax
10069A51 call dword ptr [__imp__GetProcAddress@8 (1014C720h)]
10069A57 cmp esi,esp
10069A59 call @ILT+9915(__RTC_CheckEsp) (1005C6C0h)
10069A5E mov dword ptr [ebp-1CF0h],eax
10069A64 mov dword ptr [ebp-4],0
DRVENABLEDATA DrvData;
try
{
BOOL bRe=pMyDrvEnableDriver(DDI_DRIVER_VERSION_NT5,sizeof(DRVENABLEDATA),&DrvData);
10069A6B mov esi,esp
10069A6D lea eax,[ebp-1D04h]
10069A73 push eax
10069A74 push 0Ch
10069A76 push 30000h
10069A7B call dword ptr [ebp-1CF0h]
10069A81 cmp esi,esp
10069A83 call @ILT+9915(__RTC_CheckEsp) (1005C6C0h)
10069A88 mov dword ptr [ebp-3680h],eax
10069A8E mov ecx,dword ptr [ebp-3680h]
10069A94 mov dword ptr [bRe],ecx [/code]
<br/>
Thx !
<br/>
View the full article
I hava a wrong with function.Here is the code:
<pre class="prettyprint HMODULE hMoudle2=LoadLibraryEx("C:\WINDOWS\system32\igxpgd32.dll", NULL,DONT_RESOLVE_DLL_REFERENCES);
DWORD dwErrNum=0;
if (hMoudle == NULL)
dwErrNum=GetLastError();
//__stdcall wrong,FAR PASCAL wrong,__cdcel wrong
//project page:stdcall(/gz) wrong,__cdecl (/Gd) wrong,fastcall :buffer overrun
typedef BOOL (*pDrvEnableDriver)(
ULONG iEngineVersion,
ULONG cj,
DRVENABLEDATA *pded
);
pDrvEnableDriver pMyDrvEnableDriver=(pDrvEnableDriver)GetProcAddress(hMoudle2,"DrvEnableDriver");
DRVENABLEDATA DrvData;
try
{
BOOL bRe=pMyDrvEnableDriver(DDI_DRIVER_VERSION_NT5,sizeof(DRVENABLEDATA),&DrvData); /* DrvData is Assignmented,bRe doesnt change,connot return,ErrMsg:Unhandled exception at 0x00024374 in graphedt.exe: 0xC0000005: Access violation reading location 0x00024374. */
dwErrNum=GetLastError(); //connot run to here
}catch(...)
{}
[/code]
The Assembly code:
<pre class="prettyprint HMODULE hMoudle2=LoadLibraryEx("C:\WINDOWS\system32\igxpgd32.dll",
NULL,DONT_RESOLVE_DLL_REFERENCES);
100699FD mov esi,esp
100699FF push 1
10069A01 push 0
10069A03 push offset string "C:\WINDOWS\system32\igxpgd32.dll"... (101184A4h)
10069A08 call dword ptr [__imp__LoadLibraryExA@12 (1014C728h)]
10069A0E cmp esi,esp
10069A10 call @ILT+9915(__RTC_CheckEsp) (1005C6C0h)
10069A15 mov dword ptr [ebp-1CD8h],eax
DWORD dwErrNum=0;
10069A1B mov dword ptr [ebp-1CE4h],0
if (hMoudle == NULL)
10069A25 cmp dword ptr [ebp-1CCCh],0
10069A2C jne CVideoProcessorFilter::LoadProcessorModule+3B3h (10069A43h)
dwErrNum=GetLastError();
10069A2E mov esi,esp
10069A30 call dword ptr [__imp__GetLastError@0 (1014C724h)]
10069A36 cmp esi,esp
10069A38 call @ILT+9915(__RTC_CheckEsp) (1005C6C0h)
10069A3D mov dword ptr [ebp-1CE4h],eax
//__stdcall wrong,FAR PASCAL wrong,__cdcel wrong
//project page:stdcall(/gz) wrong,__cdecl (/Gd) wrong,fastcall :buffer overrun
typedef BOOL (*pDrvEnableDriver)(
ULONG iEngineVersion,
ULONG cj,
DRVENABLEDATA *pded
);
pDrvEnableDriver pMyDrvEnableDriver=(pDrvEnableDriver)GetProcAddress(hMoudle2,"DrvEnableDriver");
10069A43 mov esi,esp
10069A45 push offset string "DrvEnableDriver" (10118490h)
10069A4A mov eax,dword ptr [ebp-1CD8h]
10069A50 push eax
10069A51 call dword ptr [__imp__GetProcAddress@8 (1014C720h)]
10069A57 cmp esi,esp
10069A59 call @ILT+9915(__RTC_CheckEsp) (1005C6C0h)
10069A5E mov dword ptr [ebp-1CF0h],eax
10069A64 mov dword ptr [ebp-4],0
DRVENABLEDATA DrvData;
try
{
BOOL bRe=pMyDrvEnableDriver(DDI_DRIVER_VERSION_NT5,sizeof(DRVENABLEDATA),&DrvData);
10069A6B mov esi,esp
10069A6D lea eax,[ebp-1D04h]
10069A73 push eax
10069A74 push 0Ch
10069A76 push 30000h
10069A7B call dword ptr [ebp-1CF0h]
10069A81 cmp esi,esp
10069A83 call @ILT+9915(__RTC_CheckEsp) (1005C6C0h)
10069A88 mov dword ptr [ebp-3680h],eax
10069A8E mov ecx,dword ptr [ebp-3680h]
10069A94 mov dword ptr [bRe],ecx [/code]
<br/>
Thx !
<br/>
View the full article