File heroic-epic-integration-0.4.obscpio of Package heroic-epic-integration
07070100000000000041ED0000000000000000000000026896C44D00000000000000000000000000000000000000000000002400000000heroic-epic-integration-0.4/.github07070100000001000041ED0000000000000000000000026896C44D00000000000000000000000000000000000000000000002E00000000heroic-epic-integration-0.4/.github/workflows07070100000002000081A40000000000000000000000016896C44D0000030F000000000000000000000000000000000000003800000000heroic-epic-integration-0.4/.github/workflows/build.ymlname: Build
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build-win:
runs-on: ubuntu-22.04
steps:
- name: Checkout Repository
uses: actions/checkout@v3
- name: Install deps
run: sudo apt update && sudo apt install -y g++-mingw-w64-x86-64 gcc-mingw-w64-x86-64 mingw-w64-tools wget && sudo update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
- name: Build EXE
run: mkdir build && cd build && cmake -DCMAKE_TOOLCHAIN_FILE=../windows.cmake .. && make -j$(nproc)
- name: Upload EXE
uses: actions/upload-artifact@v4
with:
name: win-portable
path: build/heroic-epic-integration.exe
retention-days: 14
07070100000003000081A40000000000000000000000016896C44D0000000D000000000000000000000000000000000000002700000000heroic-epic-integration-0.4/.gitignore.vscode
build07070100000004000081A40000000000000000000000016896C44D000000ED000000000000000000000000000000000000002B00000000heroic-epic-integration-0.4/CMakeLists.txtcmake_minimum_required(VERSION 3.6)
project(heroic-epic-integration)
add_link_options(${LINK_OPTIONS})
add_executable(heroic-epic-integration ${CMAKE_SOURCE_DIR}/main.c)
target_link_libraries(heroic-epic-integration ${WIN_LIBRARIES})
07070100000005000081A40000000000000000000000016896C44D00000433000000000000000000000000000000000000002400000000heroic-epic-integration-0.4/LICENSEMIT License
Copyright (c) 2025 Etaash Mathamsetty
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
07070100000006000081A40000000000000000000000016896C44D0000015C000000000000000000000000000000000000002600000000heroic-epic-integration-0.4/README.md# Heroic Epic Integration
## How to Build
First install mingw on your distro, then
```
mkdir build
cd build
cmake -DCMAKE_TOOLCHAIN_FILE=../windows.cmake ..
make
mv heroic-epic-integration.exe EpicGamesLauncher.exe
```
Then copy the exe and use some bat script to run your game.
### Example:
```
start "" EpicGamesLauncher.exe PlayGTAV.exe %*
```
07070100000007000081A40000000000000000000000016896C44D000009F7000000000000000000000000000000000000002300000000heroic-epic-integration-0.4/main.c#include <windows.h>
#include <shellapi.h>
#include <tlhelp32.h>
#include <stdio.h>
#define CP_UNIXCP 65010 /* Wine extension */
WCHAR* convert_to_win32(const WCHAR *unixW) {
typedef WCHAR* (CDECL *wine_get_dos_file_name_PFN)(const char* path);
HMODULE k32 = LoadLibraryW(L"kernel32");
wine_get_dos_file_name_PFN pwine_get_dos_file_name =
(wine_get_dos_file_name_PFN)GetProcAddress(k32, "wine_get_dos_file_name");
if (!pwine_get_dos_file_name) return NULL;
int r = WideCharToMultiByte(CP_UNIXCP, 0, unixW, -1, NULL, 0, NULL, NULL);
if (!r) return NULL;
char *unixA = malloc(r);
if (!unixA) return NULL;
r = WideCharToMultiByte(CP_UNIXCP, 0, unixW, -1, unixA, r, NULL, NULL);
if (!r) return NULL;
WCHAR *ret = pwine_get_dos_file_name(unixA);
free(unixA);
return ret;
}
int wmain(int argc, WCHAR **argv) {
if (argc < 2) return -1;
WCHAR* args;
const WCHAR* exe = argv[1];
WCHAR* temp = NULL;
int len = 1;
SHELLEXECUTEINFOW info = {0};
for (int i = 2; i < argc; i++)
{
len += wcslen(argv[i]) + 1;
}
args = calloc(len, sizeof(*args));
if (!args) return -1;
for (int i = 2; i < argc; i++)
{
wcscat(args, L" ");
wcscat(args, argv[i]);
}
/* handle a unix path */
if (exe[0] == L'/' || (exe[0] == L'"' && exe[1] == L'/')) {
temp = convert_to_win32(exe);
if (!temp) return -1;
exe = temp;
}
printf("Wrapper: Executing: %ls %ls\n", exe, args);
/* guess and set working directory */
{
WCHAR *exe_cpy = calloc(wcslen(exe)+1, sizeof(*exe));
wcscpy(exe_cpy, exe);
WCHAR *last = wcsrchr(exe_cpy, '\\');
if (last)
{
*last = L'\0';
printf("Wrapper: Working dir: %ls\n", exe_cpy);
SetCurrentDirectoryW(exe_cpy);
}
free(exe_cpy);
}
SetEnvironmentVariable("SteamAppId", NULL);
info.cbSize = sizeof(info);
info.fMask = SEE_MASK_NOCLOSEPROCESS;
info.nShow = SW_SHOWNORMAL;
info.lpFile = exe;
info.lpParameters = args;
if (!ShellExecuteExW(&info)) return -1;
free(args);
ShowWindow(GetConsoleWindow(), SW_HIDE);
if (!info.hProcess) return -1;
Sleep(500);
printf("Wrapper: Waiting for process termination...\n");
WaitForSingleObject(info.hProcess, INFINITE);
printf("Wrapper: Process terminated!\n");
CloseHandle(info.hProcess);
if (temp) HeapFree(GetProcessHeap(), 0, temp);
return 0;
}
07070100000008000081A40000000000000000000000016896C44D000000C9000000000000000000000000000000000000002A00000000heroic-epic-integration-0.4/windows.cmakeset(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc)
set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++)
set(WIN_LIBRARIES mingw32 libgcc.a libgcc_eh.a)
set(LINK_OPTIONS -municode)
07070100000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000B00000000TRAILER!!!14 blocks