1
0
mirror of https://github.com/DxWnd/DxWnd.reloaded synced 2024-12-30 09:25:35 +01:00

v2_03_23_src

Former-commit-id: cecbfca59b1066f5c3b745a7e8bdda9510acd68b
This commit is contained in:
gho tik 2015-05-28 12:40:51 -04:00 committed by Refael ACkermann
parent f386bd1d35
commit f43aa4930c
28 changed files with 1499 additions and 43 deletions

1144
Include/Vfw.h Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:685801c38436f785e2d29010e560c7eb98e07adb83ae0bf0593f089a2d2ed043
size 572928
oid sha256:b8a67c242eed842488275368e2e9ce0eca579d7694ac9b1d60081a1a9bddc6e9
size 573952

View File

@ -1,3 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:ea58d479ffbb81c24c0282a35b7e8203848d66799bf047ad7d662e4fc53d0470
oid sha256:276600bf95e4a2b4e02780dff3bc64d0c7760781f22d3e17c797e7eb05355cae
size 539648

5
build/dxwnd.ini Normal file
View File

@ -0,0 +1,5 @@
[window]
posx=1433
posy=301
sizx=320
sizy=749

View File

@ -0,0 +1,31 @@
[target]
title0=Age of Wanderer
path0=D:\Games\Age of Wanderer\Yain.exe
launchpath0=
module0=
opengllib0=
notes0=
ver0=0
coord0=0
flag0=134217762
flagg0=1207959552
flagh0=20
flagi0=134217732
flagj0=4224
flagk0=0
tflag0=0
initx0=0
inity0=0
minx0=0
miny0=0
maxx0=0
maxy0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=-1
swapeffect0=0

View File

@ -0,0 +1,31 @@
[target]
title0=Alien Nations (GOG)
path0=D:\Games\Alien Nations (GOG)\Bin\AN.exe
launchpath0=
module0=
opengllib0=
notes0=
ver0=0
coord0=0
flag0=134217762
flagg0=1207959552
flagh0=20
flagi0=134217732
flagj0=4224
flagk0=0
tflag0=0
initx0=0
inity0=0
minx0=0
miny0=0
maxx0=0
maxy0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=-1
swapeffect0=0

View File

@ -0,0 +1,31 @@
[target]
title0=Alien Nations
path0=D:\Games\Alien Nations\Bin\AN.exe
launchpath0=
module0=
opengllib0=
notes0=
ver0=0
coord0=0
flag0=134217762
flagg0=1207959552
flagh0=20
flagi0=134217732
flagj0=4224
flagk0=0
tflag0=0
initx0=0
inity0=0
minx0=0
miny0=0
maxx0=0
maxy0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=-1
swapeffect0=0

View File

@ -0,0 +1,31 @@
[target]
title0=Atlantis - The Lost Tales
path0=D:\Games\Atlantis - The Lost Tales\Atlantis.exe
launchpath0=
module0=
opengllib0=
notes0=
ver0=0
coord0=0
flag0=134217762
flagg0=1207959552
flagh0=20
flagi0=138412036
flagj0=4224
flagk0=0
tflag0=0
initx0=0
inity0=0
minx0=0
miny0=0
maxx0=0
maxy0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=-1
swapeffect0=0

View File

@ -6,7 +6,7 @@ module0=
opengllib0=
ver0=0
coord0=0
flag0=150994976
flag0=134234150
flagg0=1207959552
flagh0=20
flagi0=138412036
@ -25,3 +25,7 @@ maxfps0=0
initts0=0
winver0=0
maxres0=-1
notes0=
flagj0=128
flagk0=0
swapeffect0=0

View File

@ -0,0 +1,31 @@
[target]
title0=Close Combat 2: a bridge too far
path0=D:\Games\Close Combat 2\CC2.EXE
launchpath0=
module0=
opengllib0=
notes0=
ver0=0
coord0=0
flag0=134225954
flagg0=1744830464
flagh0=1044
flagi0=1212153860
flagj0=4224
flagk0=0
tflag0=0
initx0=0
inity0=0
minx0=0
miny0=0
maxx0=0
maxy0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=-1
swapeffect0=0

View File

@ -0,0 +1,31 @@
[target]
title0=Sports Car GT
path0=D:\Games\Sports Car GT\Spcar.exe
launchpath0=
module0=
opengllib0=
notes0=
ver0=0
coord0=0
flag0=134234146
flagg0=1207959552
flagh0=20
flagi0=138543108
flagj0=20608
flagk0=0
tflag0=0
initx0=0
inity0=0
minx0=0
miny0=0
maxx0=0
maxy0=0
posx0=50
posy0=50
sizx0=800
sizy0=600
maxfps0=0
initts0=0
winver0=0
maxres0=-1
swapeffect0=0

View File

@ -5,10 +5,10 @@ module0=
opengllib0=
ver0=0
coord0=0
flag0=134234656
flag0=134234146
flagg0=1207959552
flagh0=20
flagi0=4
flagi0=4194308
tflag0=0
initx0=0
inity0=0
@ -24,3 +24,8 @@ maxfps0=0
initts0=0
winver0=0
maxres0=-1
launchpath0=
notes0=
flagj0=128
flagk0=0
swapeffect0=0

View File

@ -8,7 +8,7 @@ coord0=0
flag0=134217762
flagg0=1207959552
flagh0=20
flagi0=4
flagi0=4194308
tflag0=0
initx0=0
inity0=0
@ -22,3 +22,10 @@ sizx0=800
sizy0=600
maxfps0=0
initts0=0
launchpath0=
notes0=
flagj0=128
flagk0=0
winver0=0
maxres0=0
swapeffect0=0

View File

@ -1,5 +1,5 @@
[window]
posx=1477
posy=150
posx=1431
posy=41
sizx=320
sizy=749

View File

@ -813,3 +813,8 @@ eliminated GDI over directdraw emulation (MAPGDITOPRIMARY flag)
add: support for texture D3DFMT_L8 dump ("Turok")
fix: eliminate a possible divide by zero error
fix: avoid intercepting WindowProc routines when set to special values 0xFFFFxxxx - makes "The Hulk" demo working
v2.03.23:
fix: implemented the correct interface of registry query calls that can be used to know the key data length
fix: hexdump routine with NULL input used in registry operation log was causing crash
add: preliminary hooking for user32.dll desktop routines, like CreateDesktop() - makes "STCC Swedish TouringCar Championship" working

View File

@ -0,0 +1,28 @@
// Close Combat 2 a bridge too far
[HKEY_LOCAL_MACHINE\SOFTWARE]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft Games]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft Games\Close Combat]
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft Games\Close Combat\2.00]
"PID"="00000-000-0000000-00000"
"InstalledTo"=".\\"
"ScreenX"="800"
"ScreenY"="600"
"Version"="2.0"
"IType"=hex:01,00,00,00
"GameSpeed"=hex:01,00,00,00
"ShowDSAlert"=hex:01,00,00,00
"ShowQuickHelp"=hex:01,00,00,00
"PlaySounds"=hex:01,00,00,00
"PlayMusic"=hex:01,00,00,00
"PlayVideos"=hex:00,00,00,00
"FCopy"=hex:00,00,00,00
"SMethod"=hex:00,00,00,00
"Save"=hex:00,00,00,00
"ShowTrees"=hex:01,00,00,00
"StaticFPS"=hex:0a,00,00,00
"InstalledFrom"=".\\"
"Launched"="1"
"VersionType"="RetailVersion"

View File

@ -7,6 +7,10 @@
#include "dxhook.h"
#include "dxhelper.h"
typedef LONG (WINAPI *RegFlushKey_Type)(HKEY);
LONG WINAPI extRegFlushKey(HKEY);
RegFlushKey_Type pRegFlushKey = NULL;
static HookEntry_Type Hooks[]={
{HOOK_IAT_CANDIDATE, "RegOpenKeyExA", NULL, (FARPROC *)&pRegOpenKeyEx, (FARPROC)extRegOpenKeyEx},
{HOOK_IAT_CANDIDATE, "RegCloseKey", NULL, (FARPROC *)&pRegCloseKey, (FARPROC)extRegCloseKey},
@ -14,6 +18,7 @@ static HookEntry_Type Hooks[]={
{HOOK_IAT_CANDIDATE, "RegCreateKeyA", NULL, (FARPROC *)&pRegCreateKey, (FARPROC)extRegCreateKey},
{HOOK_IAT_CANDIDATE, "RegCreateKeyExA", NULL, (FARPROC *)&pRegCreateKeyEx, (FARPROC)extRegCreateKeyEx},
{HOOK_IAT_CANDIDATE, "RegSetValueExA", NULL, (FARPROC *)&pRegSetValueEx, (FARPROC)extRegSetValueEx},
{HOOK_IAT_CANDIDATE, "RegFlushKey", NULL, (FARPROC *)&pRegFlushKey, (FARPROC)extRegFlushKey},
{HOOK_IAT_CANDIDATE, 0, NULL, 0, 0} // terminator
};
@ -165,7 +170,8 @@ LONG WINAPI extRegQueryValueEx(
{
LONG res;
OutTraceR("RegQueryValueEx: hKey=%x(\"%s\") ValueName=\"%s\" Reserved=%x\n", hKey, hKey2String(hKey), lpValueName, lpReserved);
OutTraceR("RegQueryValueEx: hKey=%x(\"%s\") ValueName=\"%s\" Reserved=%x lpType=%x lpData=%x lpcbData=%x\n",
hKey, hKey2String(hKey), lpValueName, lpReserved, lpType, lpData, lpcbData);
if (!IsFake(hKey)){
res=(*pRegQueryValueEx)(hKey, lpValueName, lpReserved, lpType, lpData, lpcbData);
if(IsTraceR){
@ -202,6 +208,7 @@ LONG WINAPI extRegQueryValueEx(
char RegBuf[MAX_PATH+1];
char *pData;
HKEY hCurKey=HKEY_FAKE+1;
DWORD cbData=0;
regf=OpenFakeRegistry();
if(regf==NULL) return res;
if(!lpValueName)lpValueName="";
@ -221,20 +228,24 @@ LONG WINAPI extRegQueryValueEx(
res=ERROR_FILE_NOT_FOUND;
pData=&RegBuf[strlen(lpValueName)+3];
lpb = lpData;
if(lpcbData) {
cbData = *lpcbData;
*lpcbData=0;
}
if(*pData=='"'){ // string value
if(lpType) *lpType=REG_SZ;
if(lpData){
*lpcbData=0;
pData++;
while(*pData && (*pData != '"')){
if(*pData=='\\') pData++;
if(lpData && lpcbData) if(*lpcbData < cbData) *lpb++=*pData;
pData++;
while(*pData && (*pData != '"')){
if(*pData=='\\') pData++;
*lpb++=*pData++;
if(lpcbData) *lpcbData++;
}
*lpb = 0; // string terminator
if(lpcbData) (*lpcbData)++;
}
OutTraceR("RegQueryValueEx: type=REG_SZ Data=\"%s\"\n", lpData ? (char *)lpData : "(NULL)");
res=ERROR_SUCCESS;
if(lpcbData) (*lpcbData)++; // extra space for string terminator ?
if(lpData && lpcbData) if(*lpcbData < cbData) *lpb = 0; // string terminator
OutTraceR("RegQueryValueEx: type=REG_SZ cbData=%x Data=\"%s\"\n",
lpcbData ? *lpcbData : 0, lpData ? (char *)lpData : "(NULL)");
res=(*lpcbData > cbData) ? ERROR_MORE_DATA : ERROR_SUCCESS;
break;
}
if(!strncmp(pData,"dword:",strlen("dword:"))){ //dword value
@ -242,10 +253,17 @@ LONG WINAPI extRegQueryValueEx(
if(lpType) *lpType=REG_DWORD;
pData+=strlen("dword:");
sscanf(pData, "%x", &val);
if(lpData) memcpy(lpData, &val, sizeof(DWORD));
if(lpcbData) *lpcbData=sizeof(DWORD);
OutTraceR("RegQueryValueEx: type=REG_DWORD Data=0x%x\n", val);
res=ERROR_SUCCESS;
if(lpData) {
if (cbData >= sizeof(DWORD)) {
memcpy(lpData, &val, sizeof(DWORD));
res=ERROR_SUCCESS;
}
else
res=ERROR_MORE_DATA;
}
if (lpcbData) *lpcbData=sizeof(DWORD);
OutTraceR("RegQueryValueEx: type=REG_DWORD cbData=%x Data=0x%x\n",
lpcbData ? *lpcbData : 0, val);
break;
}
if(!strncmp(pData,"hex:",strlen("hex:"))){ //hex value
@ -253,28 +271,27 @@ LONG WINAPI extRegQueryValueEx(
if(lpType) *lpType=REG_BINARY;
p = (BYTE *)pData;
p+=strlen("hex:");
if(lpcbData) *lpcbData=0;
while(TRUE){
p[strlen((char *)p)-1]=0; // eliminates \n
if(lpData){
while(strlen((char *)p)>1){
p[strlen((char *)p)-1]=0; // eliminates \n at the end of line
while(strlen((char *)p)>1){
if((*lpcbData < cbData) && lpData){
sscanf((char *)p, "%x,", (char *)lpb);
p+=3;
lpb++;
if(lpcbData) (*lpcbData)++;
}
if(p[strlen((char *)p)-1]=='\\'){
fgets(RegBuf, 256, regf);
pData = RegBuf;
p = (BYTE *)pData;
}
else break;
p+=3;
if(lpcbData) (*lpcbData)++;
}
if(p[strlen((char *)p)-1]=='\\'){
fgets(RegBuf, 256, regf);
pData = RegBuf;
p = (BYTE *)pData;
}
else break;
}
OutTraceR("RegQueryValueEx: type=REG_BINARY cbData=%d Data=%s\n",
lpcbData ? *lpcbData : 0,
lpData ? "(NULL)" : hexdump(lpData, *lpcbData));
res=ERROR_SUCCESS;
res=(*lpcbData > cbData) ? ERROR_MORE_DATA : ERROR_SUCCESS;
break;
}
}
@ -294,6 +311,13 @@ LONG WINAPI extRegCloseKey(HKEY hKey)
return (*pRegCloseKey)(hKey);
}
LONG WINAPI extRegFlushKey(HKEY hKey)
{
OutTraceR("RegFlushKey: hKey=%x\n", hKey);
if (IsFake(hKey)) return ERROR_SUCCESS;
return (*pRegFlushKey)(hKey);
}
LONG WINAPI extRegSetValueEx(HKEY hKey, LPCTSTR lpValueName, DWORD Reserved, DWORD dwType, const BYTE *lpData, DWORD cbData)
{
if (IsTraceR){

View File

@ -27,7 +27,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "TlHelp32.h"
#define VERSION "2.03.22"
#define VERSION "2.03.23"
#define DDTHREADLOCK 1
//#define LOCKTHREADS

Binary file not shown.

View File

@ -1096,7 +1096,7 @@ int WINAPI extSetDIBitsToDevice(HDC hdc, int XDest, int YDest, DWORD dwWidth, DW
}
//else
if (dxw.IsFullScreen() && (OBJ_DC == GetObjectType(hdc))){
// blitting toprimary surface !!!
// blitting to primary surface !!!
DWORD OrigWidth, OrigHeight;
int OrigXDest, OrigYDest;
OrigWidth=dwWidth;

View File

@ -9,6 +9,7 @@ char *hexdump(unsigned char *Buffer, int len)
static char sHexBuffer[3*MAX_HEXDUMP+12];
char *s;
int iMaxI;
if(!Buffer) return "(NULL)";
s=sHexBuffer;
iMaxI = len;
if(iMaxI > MAX_HEXDUMP) iMaxI = MAX_HEXDUMP;

View File

@ -9,8 +9,8 @@
#undef DXWDECLARATIONS
static HookEntry_Type Hooks[]={
//{"ICSendMessage", (FARPROC)NULL, (FARPROC *)&pICSendMessage, (FARPROC)extICSendMessage},
//{"ICOpen", (FARPROC)NULL, (FARPROC *)&pICOpen, (FARPROC)extICOpen},
//{HOOK_HOT_CANDIDATE, "ICSendMessage", (FARPROC)NULL, (FARPROC *)&pICSendMessage, (FARPROC)extICSendMessage},
//{HOOK_HOT_CANDIDATE, "ICOpen", (FARPROC)NULL, (FARPROC *)&pICOpen, (FARPROC)extICOpen},
{HOOK_IAT_CANDIDATE, 0, NULL, 0, 0} // terminator
};
@ -31,15 +31,18 @@ LRESULT WINAPI extICSendMessage(HIC hic, UINT wMsg, DWORD_PTR dw1, DWORD_PTR dw2
{
LRESULT res;
OutTraceDW("ICSendMessage: hic=%x wMsg=%x dw1=%x dw2=%x\n", hic, wMsg, dw1, dw2);
return 0;
res=(*pICSendMessage)(hic, wMsg, dw1, dw2);
OutTraceDW("ICSendMessage: ret=%x\n", res);
return res;
}
HIC WINAPI extICOpen(DWORD fccType, DWORD fccHandler, UINT wMode)
{
HIC res;
OutTraceDW("ICOpen: fccType=%x fccHandler=%x wMode=%x\n", fccType, fccHandler, wMode);
return (HIC)0;
res=(*pICOpen)(fccType, fccHandler, wMode);
OutTraceDW("ICOpen: ret=%x\n", res);
return res;
}
/*

View File

@ -48,6 +48,18 @@ HRESULT WINAPI extMessageBoxTimeoutW(HWND, LPCWSTR, LPCWSTR, UINT, WORD, DWORD);
typedef BOOL (WINAPI *IsIconic_Type)(HWND);
IsIconic_Type pIsIconic = NULL;
BOOL WINAPI extIsIconic(HWND);
typedef HDESK (WINAPI *CreateDesktop_Type)(LPCTSTR, LPCTSTR, DEVMODE *, DWORD, ACCESS_MASK, LPSECURITY_ATTRIBUTES);
CreateDesktop_Type pCreateDesktop = NULL;
HDESK WINAPI extCreateDesktop(LPCTSTR, LPCTSTR, DEVMODE *, DWORD, ACCESS_MASK, LPSECURITY_ATTRIBUTES);
typedef BOOL (WINAPI *SwitchDesktop_Type)(HDESK);
SwitchDesktop_Type pSwitchDesktop = NULL;
BOOL WINAPI extSwitchDesktop(HDESK);
typedef HDESK (WINAPI *OpenDesktop_Type)(LPTSTR, DWORD, BOOL, ACCESS_MASK);
OpenDesktop_Type pOpenDesktop = NULL;
HDESK WINAPI extOpenDesktop(LPTSTR, DWORD, BOOL, ACCESS_MASK);
typedef BOOL (WINAPI *CloseDesktop_Type)(HDESK);
CloseDesktop_Type pCloseDesktop = NULL;
BOOL WINAPI extCloseDesktop(HDESK);
#ifdef TRACEPALETTE
typedef UINT (WINAPI *GetDIBColorTable_Type)(HDC, UINT, UINT, RGBQUAD *);
@ -116,6 +128,11 @@ static HookEntry_Type Hooks[]={
//{HOOK_HOT_CANDIDATE, "IsIconic", (FARPROC)IsIconic, (FARPROC *)&pIsIconic, (FARPROC)extIsIconic},
{HOOK_IAT_CANDIDATE, "CreateDesktopA", (FARPROC)CreateDesktopA, (FARPROC *)&pCreateDesktop, (FARPROC)extCreateDesktop},
{HOOK_IAT_CANDIDATE, "SwitchDesktop", (FARPROC)SwitchDesktop, (FARPROC *)&pSwitchDesktop, (FARPROC)extSwitchDesktop},
{HOOK_IAT_CANDIDATE, "OpenDesktopA", (FARPROC)OpenDesktopA, (FARPROC *)&pOpenDesktop, (FARPROC)extOpenDesktop},
{HOOK_IAT_CANDIDATE, "CloseDesktop", (FARPROC)CloseDesktop, (FARPROC *)&pCloseDesktop, (FARPROC)extCloseDesktop},
{HOOK_IAT_CANDIDATE, 0, NULL, 0, 0} // terminator
};
@ -2897,4 +2914,31 @@ BOOL WINAPI extIsIconic(HWND hWnd)
OutTrace("IsIconic: hwnd=%x ret=%x\n", hWnd, ret);
//return FALSE;
return ret;
}
HDESK WINAPI extCreateDesktop( LPCTSTR lpszDesktop, LPCTSTR lpszDevice, DEVMODE *pDevmode, DWORD dwFlags, ACCESS_MASK dwDesiredAccess, LPSECURITY_ATTRIBUTES lpsa)
{
//OutTrace("CreateDesktop: SUPPRESS Desktop=%s Device=%s flags=%x access=%x\n", lpszDesktop, lpszDevice, dwFlags, dwDesiredAccess);
OutTraceDW("CreateDesktop: SUPPRESS flags=%x access=%x\n", dwFlags, dwDesiredAccess);
return (HDESK)0xDEADBEEF; // fake handle
//return (HDESK)NULL; // fake handle
}
BOOL WINAPI extSwitchDesktop(HDESK hDesktop)
{
OutTraceDW("SwitchDesktop: SUPPRESS hDesktop=%x\n", hDesktop);
return TRUE;
}
HDESK WINAPI extOpenDesktop(LPTSTR lpszDesktop, DWORD dwFlags, BOOL fInherit, ACCESS_MASK dwDesiredAccess)
{
OutTraceDW("CreateDesktop: SUPPRESS flags=%x access=%x\n", dwFlags, dwDesiredAccess);
return (HDESK)0xDEADBEEF; // fake handle
//return (HDESK)NULL; // fake handle
}
BOOL WINAPI extCloseDesktop(HDESK hDesktop)
{
OutTraceDW("CloseDesktop: SUPPRESS hDesktop=%x\n", hDesktop);
return TRUE;
}

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.