Merge branch 'main' into main

This commit is contained in:
Dexrn ZacAttack 2024-09-04 23:07:59 -07:00 committed by GitHub
commit ec8a835ebb
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 218 additions and 24 deletions

43
.github/workflows/static.yml vendored Normal file
View File

@ -0,0 +1,43 @@
# Simple workflow for deploying static content to GitHub Pages
name: Deploy static content to Pages
on:
# Runs on pushes targeting the default branch
push:
branches: ["main"]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write
# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
# Single deploy job since we're just deploying
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
# Upload entire repository
path: '.'
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4

View File

@ -1,10 +1,58 @@
# WinDurango
[![Join our Discord](https://img.shields.io/discord/1280176159010848790?color=2c9510&label=WinDurango%20Discord&logo=Discord&logoColor=white)](https://discord.gg/mHN2BgH7MR)
<h1 align="center">WinDurango</h1>
WinDurango is the worlds first Xbox One compatibility layer for Windows.
For more information, see the
[main WinDurango wiki](https://github.com/WinDurango/WinDurango/wiki).
**Interested in supporting the core contributors?** Visit
[WinDurango Project on Patreon](https://www.patreon.com/WinDurango).
Come chat with us about **emulator-related topics** on [![Join our Discord](https://img.shields.io/discord/1280176159010848790?color=2c9510&label=WinDurango%20Discord&logo=Discord&logoColor=white)](https://discord.gg/mHN2BgH7MR).
For developer chat join `#developer` but stay on topic. Lurking is not only fine, but encouraged!
Please check the [FAQ](https://github.com/WinDurango/WinDurango/wiki/FAQ) page before asking questions.
We've got jobs/lives/etc, so don't expect instant answers.
Discussing illegal activities will get you banned.
## Status
[![GitHub Latest Release](https://img.shields.io/badge/Latest-Release-green)](https://github.com/WinDurango/WinDurango/releases)
[![View stargazers](https://img.shields.io/github/stars/WinDurango/WinDurango)](https://github.com/WinDurango/WinDurango/stargazers)
The worlds first Xbox One compatibility layer for Windows.
# Legal
Currently no games run with WinDurango.
See the [Game compatibility list](https://github.com/WinDurango/WinDurango-game-compatibility/issues)
for currently tracked games, and feel free to contribute your own updates,
screenshots, and information there following the [existing conventions](https://github.com/WinDurango/WinDurango-game-compatibility/blob/main/README.md).
This project is not affiliated with Microsoft.
## Disclaimer
The goal of this project is to experiment, research, and educate on the topic
of emulation of modern devices and operating systems. **It is not for enabling
illegal activity**. All information is obtained via reverse engineering of
legally purchased devices and games and information made public on the internet
(you'd be surprised what's indexed on Google...). We are not any way affliated
with Microsoft.
## Quickstart
See the [Quickstart](https://github.com/WinDurango/WinDurango/wiki/Quickstart) page.
## Building
See [building.md](docs/building.md) for setup.
When writing code, check the [style guide](docs/style_guide.md)
and be sure to run clang-format!
## Contributors Wanted!
Have some spare time, know C++ and have knowledge about Windows interals,
and want to write code for the world's first Microsoft Xbox One compatiablity layer?
Contribute!
**For general rules and guidelines please see [CONTRIBUTING.md](.github/CONTRIBUTING.md).**
See more projects [good for contributors](https://github.com/WinDurango/WinDurango/labels/good%20first%20issue).
It's a good idea to ask on Discord and check the issues page before beginning work on something.
## FAQ
See the [frequently asked questions](https://github.com/WinDurango/WinDurango/wiki/FAQ) page.

View File

@ -10,11 +10,14 @@ EXPORTS
CreateThread = CreateThread_X @60
DebugBreak = DebugBreak_X @71
DecodePointer = NTDLL.RtlDecodePointer @72
DeleteCriticalSection = NTDLL.RtlDeleteCriticalSection@74
DeleteCriticalSection = NTDLL.RtlDeleteCriticalSection @74
DeleteFileW = DeleteFileW_X @77
DeviceIoControl = DeviceIoControl_X @80
DisableThreadLibraryCalls = DisableThreadLibraryCalls_X @81
EventRegister = NTDLL.EtwEventRegister @95
EventUnregister = NTDLL.EtwEventUnregister @97
EnterCriticalSection = EnterCriticalSection_X @87
EventUnregister = NTDLL.EtwEventUnregister @97
EventWrite = NTDLL.EtwEventWrite @98
ExitProcess = ExitProcess_X @102
FileTimeToSystemTime = FileTimeToSystemTime_X @107
FindClose = FindClose_X @109
@ -31,6 +34,7 @@ EXPORTS
GetFileSizeEx = GetFileSizeEx_X @171
GetLastError = GetLastError_X @178
GetLocalTime = GetLocalTime_X @179
GetModuleHandleA = GetModuleHandleA_X @186
GetModuleHandleW = GetModuleHandleW_X @189
GetProcessHeap = GetProcessHeap_X @199
GetProcessId = GetProcessId_X @201
@ -40,16 +44,22 @@ EXPORTS
GetTickCount = GetTickCount_X @231
GetUserDefaultLocaleName = GetUserDefaultLocaleName_X @242
GetUserGeoID = GetUserGeoID_X @243
InitializeConditionVariable = NTDDLL.RtlInitializeConditionVariable @269
HeapAlloc = NTDLL.RtlAllocateHeap @252
HeapFree = HeapFree_X @256
InitializeConditionVariable = NTDLL.RtlInitializeConditionVariable @269
InitializeCriticalSection = NTDLL.RtlInitializeCriticalSection @271
InitializeCriticalSectionAndSpinCount = InitializeCriticalSectionAndSpinCount_X @272
InitializeCriticalSectionEx = InitializeCriticalSectionEx_X @273
InitializeSListHead = NTDLL.RtlInitializeSListHead @275
InitializeSRWLock = NTDLL.InitializeSRWLock @276
InitializeSRWLock = NTDLL.RtlInitializeSRWLock @276
IsDebuggerPresent = IsDebuggerPresent_X @283
IsProcessorFeaturePresent = IsProcessorFeaturePresent_X @284
LeaveCriticalSection = NTDLL.RtlLeaveCriticalSection @293
LoadLibraryExW = LoadLibraryExW_X @296
MultiByteToWideChar = MultiByteToWideChar_X @313
OutputDebugStringA = OutputDebugStringA_X @327
OutputDebugStringW = OutputDebugStringW_X @328
PeekNamedPipe = PeekNamedPipe_X @330
QueryPerformanceCounter = QueryPerformanceCounter_X @333
QueryPerformanceFrequency = QueryPerformanceFrequency_X @334
RaiseException = RaiseException_X @339
@ -59,7 +69,9 @@ EXPORTS
ResumeThread = ResumeThread_X @377
RtlCaptureContext = RtlCaptureContext_X @378
RtlLookupFunctionEntry = RtlLookupFunctionEntry @380
RtlUnwindEx = RtlUnwindEx_X @385
RtlVirtualUnwind = NTDLL.RtlVirtualUnwind @386
SetEvent = SetEvent_X @399
SetFilePointer = SetFilePointer_X @404
SetLastError = NTDLL.RtlSetLastWin32Error @409
SetThreadAffinityMask = SetThreadAffinityMask_X @418
@ -84,3 +96,4 @@ EXPORTS
XMemAlloc = XMemAlloc_X @501
XMemAllocDefault = XMemAllocDefault_X @505
XMemFreeDefault = XMemFreeDefault_X @508
XMemFree = XMemFree_X @507

View File

@ -31,7 +31,7 @@ BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD forwardReason, LPVOID lpvReserved
DestinationString->Buffer = 0LL;
}
//Probably have to change this to SetUnhandledExceptionFilter
RtlSetUnhandledExceptionFilter(UnhandledExceptionFilter);
SetUnhandledExceptionFilter(UnhandledExceptionFilter);
}
else
{

View File

@ -43,12 +43,35 @@ PVOID XMemAlloc_X(SIZE_T dwSize, ULONGLONG dwAttributes)
}
//TODO
BOOL XMemFreeDefault_X(PVOID P, unsigned __int64 a2)
BOOL XMemFreeDefault_X(PVOID P, UINT64 a2)
{
//STUB
return 0;
}
//TODO
BOOL XMemFree_X(PVOID P, UINT64 a2)
{
return 0;
/*struct _EVENT_TRACE_HEADER v5; // [rsp+20h] [rbp-48h] BYREF
unsigned __int64 v6; // [rsp+50h] [rbp-18h]
if (MEMORY[0x7FFE0390])
{
v5.Class.Version = 3105;
v5.ProcessorTime = 0LL;
v6 = a2;
*(&v5.GuidPtr + 1) = (ULONGLONG)P;
NtTraceEvent(MEMORY[0x7FFE0390], 0x10402u, 0x18u, &v5);
}
return off_18002B1B0(P, a2);*/
}
BOOL InitializeCriticalSectionEx_X(LPCRITICAL_SECTION lpCriticalSection, DWORD dwSpinCount, DWORD Flags)
{
return InitializeCriticalSectionEx(lpCriticalSection, dwSpinCount, Flags);
}
LPTOP_LEVEL_EXCEPTION_FILTER SetUnhandledExceptionFilter_X(LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter)
{
return SetUnhandledExceptionFilter(lpTopLevelExceptionFilter);
@ -84,6 +107,21 @@ PRUNTIME_FUNCTION RtlLookupFunctionEntry_X(DWORD64 ControlPc, PDWORD64 ImageBase
return RtlLookupFunctionEntry(ControlPc, ImageBase, HistoryTable);
}
void RtlUnwindEx_X(PVOID TargetFrame, PVOID TargetIp, PEXCEPTION_RECORD ExceptionRecord, PVOID ReturnValue, PCONTEXT ContextRecord, PUNWIND_HISTORY_TABLE HistoryTable)
{
RtlUnwindEx(TargetFrame, TargetIp, ExceptionRecord, ReturnValue, ContextRecord, HistoryTable);
}
BOOL DeviceIoControl_X(HANDLE hDevice, DWORD dwIoControlCode, LPVOID lpInBuffer, DWORD nInBufferSize, LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped)
{
return DeviceIoControl(hDevice, dwIoControlCode, lpInBuffer, nInBufferSize, lpOutBuffer, nOutBufferSize, lpBytesReturned, lpOverlapped);
}
HMODULE LoadLibraryExW_X(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags)
{
return LoadLibraryExW(lpLibFileName, hFile, dwFlags);
}
DWORD GetProcessId_X(HANDLE Process)
{
return GetProcessId(Process);
@ -109,6 +147,11 @@ HMODULE GetModuleHandleW_X(LPCWSTR lpModuleName)
return GetModuleHandleW(lpModuleName);
}
HMODULE GetModuleHandleA_X(LPCSTR lpModuleName)
{
return GetModuleHandleA(lpModuleName);
}
void GetLocalTime_X(LPSYSTEMTIME lpSystemTime)
{
GetLocalTime(lpSystemTime);
@ -317,6 +360,11 @@ BOOL QueryPerformanceCounter_X(LARGE_INTEGER* lpPerformanceCount)
return QueryPerformanceCounter(lpPerformanceCount);
}
void OutputDebugStringA_X(LPCSTR lpOutputString)
{
OutputDebugStringA(lpOutputString);
}
void OutputDebugStringW_X(LPCWSTR lpOutputString)
{
OutputDebugStringW(lpOutputString);
@ -352,6 +400,26 @@ int GetUserDefaultLocaleName_X(LPWSTR lpLocaleName, int cchLocaleName)
return GetUserDefaultLocaleName(lpLocaleName, cchLocaleName);
}
BOOL SetEvent_X(HANDLE hEvent)
{
return SetEvent(hEvent);
}
BOOL PeekNamedPipe_X(HANDLE hNamedPipe, LPVOID lpBuffer, DWORD nBufferSize, LPDWORD lpBytesRead, LPDWORD lpTotalBytesAvail, LPDWORD lpBytesLeftThisMessage)
{
return PeekNamedPipe(hNamedPipe, lpBuffer, nBufferSize, lpBytesRead, lpTotalBytesAvail, lpBytesLeftThisMessage);
}
BOOL DisableThreadLibraryCalls_X(HMODULE hLibModule)
{
return DisableThreadLibraryCalls(hLibModule);
}
BOOL HeapFree_X(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem)
{
return HeapFree(hHeap, dwFlags, lpMem);
}
void GetSystemTime_X(LPSYSTEMTIME lpSystemTime)
{
GetSystemTime(lpSystemTime);
@ -384,11 +452,11 @@ __int64 GetConsoleType_X()
// !!!!!
// Should be in ntdll.dll reimplementation, right now i'm just testing things with DLLMain entryPoint
/*/ Should be in ntdll.dll reimplementation, right now i'm just testing things with DLLMain entryPoint
PVOID RtlSetUnhandledExceptionFilter(PVOID ExceptionFilter)
{
return EncodePointer(ExceptionFilter);
}
}*/

View File

@ -18,7 +18,9 @@ extern "C"
PVOID XMemAlloc_X(SIZE_T dwSize, ULONGLONG dwAttributes);
LPTOP_LEVEL_EXCEPTION_FILTER SetUnhandledExceptionFilter_X(LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter);
BOOL XMemFree_X(PVOID P, UINT64 a2);
LPTOP_LEVEL_EXCEPTION_FILTER SetUnhandledExceptionFilter_X(LPTOP_LEVEL_EXCEPTION_FILTER lpTopLevelExceptionFilter);
BOOL TerminateProcess_X(HANDLE hProcess, UINT uExitCode);
@ -32,7 +34,13 @@ extern "C"
PRUNTIME_FUNCTION RtlLookupFunctionEntry_X(DWORD64 ControlPc, PDWORD64 ImageBase, PUNWIND_HISTORY_TABLE HistoryTable);
DWORD GetProcessId_X(HANDLE Process);
void RtlUnwindEx_X(PVOID TargetFrame, PVOID TargetIp, PEXCEPTION_RECORD ExceptionRecord, PVOID ReturnValue, PCONTEXT ContextRecord, PUNWIND_HISTORY_TABLE HistoryTable);
BOOL DeviceIoControl_X(HANDLE hDevice, DWORD dwIoControlCode, LPVOID lpInBuffer, DWORD nInBufferSize, LPVOID lpOutBuffer, DWORD nOutBufferSize, LPDWORD lpBytesReturned, LPOVERLAPPED lpOverlapped);
HMODULE LoadLibraryExW_X(LPCWSTR lpLibFileName, HANDLE hFile, DWORD dwFlags);
DWORD GetProcessId_X(HANDLE Process);
void GetSystemTimeAsFileTime_X(LPFILETIME lpSystemTimeAsFileTime);
@ -46,7 +54,7 @@ extern "C"
LPVOID VirtualAlloc_X(LPVOID lpAddress, SIZE_T dwSize, DWORD flAllocationType, DWORD flProtect);
BOOL XMemFreeDefault_X(PVOID P, unsigned __int64 a2);
BOOL XMemFreeDefault_X(PVOID P, UINT64 a2);
BOOL WriteFile_X(HANDLE hFile, LPCVOID lpBuffer, DWORD nNumberOfBytesToWrite, LPDWORD lpNumberOfBytesWritten, LPOVERLAPPED lpOverlapped);
@ -80,7 +88,9 @@ extern "C"
BOOL QueryPerformanceCounter_X(LARGE_INTEGER* lpPerformanceCount);
void OutputDebugStringW_X(LPCWSTR lpOutputString);
void OutputDebugStringA_X(LPCSTR lpOutputString);
void OutputDebugStringW_X(LPCWSTR lpOutputString);
int MultiByteToWideChar_X(UINT CodePage, DWORD dwFlags, LPCSTR lpMultiByteStr, int cbMultiByte, LPWSTR lpWideCharStr, int cchWideChar);
@ -90,7 +100,9 @@ extern "C"
BOOL InitializeCriticalSectionAndSpinCount_X(LPCRITICAL_SECTION lpCriticalSection, DWORD dwSpinCount);
GEOID GetUserGeoID_X(GEOCLASS GeoClass);
BOOL InitializeCriticalSectionEx_X(LPCRITICAL_SECTION lpCriticalSection, DWORD dwSpinCount, DWORD Flags);
GEOID GetUserGeoID_X(GEOCLASS GeoClass);
int GetUserDefaultLocaleName_X(LPWSTR lpLocaleName, int cchLocaleName);
@ -100,7 +112,9 @@ extern "C"
HMODULE GetModuleHandleW_X(LPCWSTR lpModuleName);
void GetLocalTime_X(LPSYSTEMTIME lpSystemTime);
HMODULE GetModuleHandleA_X(LPCSTR lpModuleName);
void GetLocalTime_X(LPSYSTEMTIME lpSystemTime);
DWORD GetLastError_X();
@ -132,7 +146,9 @@ extern "C"
void DebugBreak_X();
HANDLE CreateThread_X(LPSECURITY_ATTRIBUTES lpThreadAttributes, SIZE_T dwStackSize, LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, DWORD dwCreationFlags, LPDWORD lpThreadId);
BOOL SetEvent_X(HANDLE hEvent);
HANDLE CreateThread_X(LPSECURITY_ATTRIBUTES lpThreadAttributes, SIZE_T dwStackSize, LPTHREAD_START_ROUTINE lpStartAddress, LPVOID lpParameter, DWORD dwCreationFlags, LPDWORD lpThreadId);
HANDLE CreateFileW_X(LPCWSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile);
@ -144,16 +160,21 @@ extern "C"
BOOL CloseHandle_X(HANDLE hObject);
__int64 GetConsoleType_X();
BOOL DisableThreadLibraryCalls_X(HMODULE hLibModule);
BOOL HeapFree_X(HANDLE hHeap, DWORD dwFlags, LPVOID lpMem);
BOOL PeekNamedPipe_X(HANDLE hNamedPipe, LPVOID lpBuffer, DWORD nBufferSize, LPDWORD lpBytesRead, LPDWORD lpTotalBytesAvail, LPDWORD lpBytesLeftThisMessage);
__int64 GetConsoleType_X();
//BOOL TerminateProcess(HANDLE hProcess, UINT uExitCode);
}
// EXE EXPORTS END
PVOID RtlSetUnhandledExceptionFilter(PVOID ExceptionFilter);
//PVOID RtlSetUnhandledExceptionFilter(PVOID ExceptionFilter);
//DLLMain entrypoint matching test
__int64 sub_18001BB8C();
NTSTATUS sub_18001BCA0(HINSTANCE hInstance, DWORD forwardReason, LPVOID lpvReserved);

1
docs/index.html Normal file
View File

@ -0,0 +1 @@
Hello, world!