In a disassembly with a call to a DirectDraw->BltFast
function, I encountered the following:
(*(void (__stdcall **)(LPDIRECTDRAWSURFACE7, _DWORD, _DWORD, _DWORD, _DWORD, signed int, int, int, int, int))
((void (__stdcall **)(_DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD, _DWORD))v17->lpVtbl + 7))(
v17,
0,
0,
*(&g_COREvidSurf + 25),
0,
16,
v75,
v77,
v79,
v81);
The cast has too many arguments. How does one edit the call's cast to fix the disassembly ?
EDIT: After applying a struct to the code:
.text:00540825 030 cmp [esp+30h+arg_8], ecx
.text:00540829 030 mov edx, g_COREvidSurf+64h
.text:0054082F 030 mov eax, g_CoreVidsurf_6
.text:00540834 030 push 10h
.text:00540836 034 push 0
.text:00540838 038 push edx
.text:00540839 03C push 0
.text:0054083B 040 push 0
.text:00540844 044 mov ecx, [eax]
.text:00540846 044 push eax
.text:00540847 048 mov eax,[ecx+IDirectDrawSurface7Vtbl.BltFast]
.text:0054084A 048 call eax
and the decompilation:
v17.lpVtbl = (struct IDirectDrawSurface7::IDirectDrawSurface7Vtbl *)g_surface2;
(*(void (__stdcall **)(struct IDirectDrawSurface7::IDirectDrawSurface7Vtbl *, _DWORD, _DWORD, _DWORD, _DWORD, signed int, int, int, int, int))(*(_DWORD *)v17.lpVtbl + offsetof(IDirectDrawSurface7Vtbl, BltFast)))(
v17.lpVtbl,
0,
0,
*(&g_COREvidSurf + 25),
0,
16,
v75,
v77,
v79,
v81);
The struct used was selected from the standard struct selection in IDA, and if i press 'Y' on the declaration of BltFast in the struct declaration, the call is declared like this:
HRESULT (__stdcall *BltFast)(IDirectDrawSurface7 *This, DWORD, DWORD, LPDIRECTDRAWSURFACE7, LPRECT, DWORD)
which is correct, but as seen above, IDA is still showing too many args.