-
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
🐛
- Loading branch information
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
cmake_minimum_required(VERSION 3.22) | ||
|
||
project ("SOCK5Server" CXX) | ||
|
||
set(CMAKE_CXX_STANDARD 20) | ||
|
||
# MSVC Static linking. | ||
if(MSVC) | ||
if (${CMAKE_BUILD_TYPE} MATCHES "Release") | ||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded") | ||
elseif(${CMAKE_BUILD_TYPE} MATCHES "Debug") | ||
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>") | ||
endif() | ||
endif() | ||
|
||
# set the path to our cmake modules & generated cmake files from Conan. | ||
set(CMAKE_PREFIX_PATH "${PROJECT_SOURCE_DIR}/cmake") | ||
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake") | ||
|
||
# CONFIG option is important so that CMake doesnt search for modules into the default modules directory | ||
find_package(imgui CONFIG) | ||
find_package(glfw3 CONFIG) | ||
find_package(glew CONFIG) | ||
|
||
include_directories( "src" "src/UI" "src/UI/include" "src/bindings/imgui_backend" "src/bindings/stb" "src/bindings/mINI/src/mini") | ||
|
||
# Locate all needed source & header files. | ||
file(GLOB source_files CONFIGURE_DEPENDS | ||
"src/UI/*.cpp" | ||
"src/UI/*.h" | ||
"src/UI/Font/*.h" | ||
"src/UI/src/*.cpp" | ||
"src/UI/include/*.h" | ||
"src/UI/src/Sock5/*.cpp" | ||
"src/UI/include/Sock5/*.h" | ||
"src/bindings/imgui_backend/*.cpp" | ||
"src/bindings/imgui_backend/*.h" | ||
) | ||
# Add source to this project's executable. | ||
add_executable (SOCK5Server WIN32 | ||
"src/SOCK5Server.cpp" | ||
"src/SOCK5Server.h" | ||
${source_files} | ||
"src/bindings/mINI/src/mini/ini.h" | ||
"${CMAKE_CURRENT_SOURCE_DIR}/info.rc") | ||
|
||
target_sources(SOCK5Server PRIVATE dpi-aware.manifest) | ||
|
||
# Linker Options | ||
target_compile_definitions(SOCK5Server PUBLIC IMGUI_IMPL_OPENGL_LOADER_GLEW) | ||
target_link_libraries(SOCK5Server imgui::imgui GLEW::glew_s glfw::glfw ws2_32) | ||
|
||
# Static linking libgcc, libstdc++ and winpthread. | ||
if(NOT MSVC) | ||
if (${CMAKE_BUILD_TYPE} MATCHES "Release") | ||
# -fuse-ld=lld | ||
target_link_options(SOCK5Server PRIVATE -static-libgcc -static-libstdc++ -static -lwinpthread -dynamic -pthread -O3) | ||
elseif(${CMAKE_BUILD_TYPE} MATCHES "Debug") | ||
target_link_options(SOCK5Server PRIVATE -static-libgcc -static-libstdc++ -static -lwinpthread -dynamic -pthread -O0) | ||
endif() | ||
endif() | ||
|
||
if (CMAKE_VERSION VERSION_GREATER 3.12) | ||
set_property(TARGET SOCK5Server PROPERTY CXX_STANDARD 20) | ||
endif() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"version": 3, | ||
"configurePresets": [ | ||
{ | ||
"name": "windows-base", | ||
"hidden": true, | ||
"generator": "Ninja", | ||
"binaryDir": "${sourceDir}/build/${presetName}", | ||
"installDir": "${sourceDir}/install/${presetName}", | ||
"cacheVariables": { | ||
"CMAKE_C_COMPILER": "cl.exe", | ||
"CMAKE_CXX_COMPILER": "cl.exe" | ||
}, | ||
"condition": { | ||
"type": "equals", | ||
"lhs": "${hostSystemName}", | ||
"rhs": "Windows" | ||
} | ||
}, | ||
{ | ||
"name": "x64-debug", | ||
"displayName": "x64 Debug", | ||
"inherits": "windows-base", | ||
"architecture": { | ||
"value": "x64", | ||
"strategy": "external" | ||
}, | ||
"cacheVariables": { | ||
"CMAKE_BUILD_TYPE": "Debug" | ||
} | ||
}, | ||
{ | ||
"name": "x86-debug", | ||
"displayName": "x86 Debug", | ||
"inherits": "windows-base", | ||
"architecture": { | ||
"value": "x86", | ||
"strategy": "external" | ||
}, | ||
"cacheVariables": { | ||
"CMAKE_BUILD_TYPE": "Debug" | ||
} | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
[requires] | ||
imgui/cci.20220621+1.88.docking | ||
glfw/3.3.7 | ||
glew/2.2.0 | ||
|
||
[generators] | ||
cmake_find_package_multi | ||
|
||
[options] | ||
glew:shared=False | ||
|
||
[imports] | ||
./res/bindings, imgui_impl_glfw.cpp -> ../src/bindings/imgui_backend | ||
./res/bindings, imgui_impl_opengl3.cpp -> ../src/bindings/imgui_backend | ||
./res/bindings, imgui_impl_glfw.h -> ../src/bindings/imgui_backend | ||
./res/bindings, imgui_impl_opengl3.h -> ../src/bindings/imgui_backend | ||
./res/bindings, imgui_impl_opengl3_loader.h -> ../src/bindings/imgui_backend |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0"?> | ||
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> | ||
<application xmlns="urn:schemas-microsoft-com:asm.v3"> | ||
<windowsSettings> | ||
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true/PM</dpiAware> | ||
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2, PerMonitor</dpiAwareness> | ||
</windowsSettings> | ||
</application> | ||
</assembly> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
GLFW_ICON ICON DISCARDABLE ICON.ico | ||
1 VERSIONINFO | ||
FILEVERSION 0,0,1 | ||
PRODUCTVERSION 0,0,1 | ||
FILEOS 0x40004 | ||
FILETYPE 0x1 | ||
{ | ||
BLOCK "StringFileInfo" | ||
{ | ||
BLOCK "040904b0" | ||
{ | ||
VALUE "CompanyName", "Coldroot" | ||
VALUE "FileDescription", "Coldroot Sock5 Server" | ||
VALUE "FileVersion", "0.0.1" | ||
VALUE "Full Version", "0.0.1" | ||
VALUE "InternalName", "Coldroot" | ||
VALUE "LegalCopyright", "Copyright \xA9 2022" | ||
VALUE "OriginalFilename", "SOCK5Server.exe" | ||
VALUE "ProductName", "Coldroot Sock5 Server" | ||
VALUE "ProductVersion", "0.0.1" | ||
} | ||
} | ||
BLOCK "VarFileInfo" | ||
{ | ||
VALUE "Translation", 0x0409, 0x04B0 | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
cd .. | ||
if exist Build ( | ||
rmdir Build /Q /S | ||
) | ||
mkdir Build | ||
if exist cmake ( | ||
rmdir cmake /Q /S | ||
) | ||
mkdir cmake | ||
|
||
cd cmake | ||
del *.txt *.cmake *.json *.lock | ||
conan install .. -s build_type=Debug --build missing -s compiler=gcc -s compiler.libcxx=libstdc++11 -s compiler.version=12 -s compiler.cppstd=20 -if ../cmake | ||
|
||
cd ../Build | ||
cmake -DCMAKE_BUILD_TYPE=Debug -G Ninja -S .. -B . | ||
cmake --build . --target SOCK5Server -j 12 | ||
|
||
cd ../scripts | ||
pause |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
cd .. | ||
if exist Build ( | ||
rmdir Build /Q /S | ||
) | ||
mkdir Build | ||
if exist cmake ( | ||
rmdir cmake /Q /S | ||
) | ||
mkdir cmake | ||
|
||
cd cmake | ||
del *.txt *.cmake *.json *.lock | ||
conan install .. -s build_type=Release --build missing -s compiler=gcc -s compiler.libcxx=libstdc++11 -s compiler.version=12 -s compiler.cppstd=20 -if ../cmake | ||
|
||
cd ../Build | ||
cmake -DCMAKE_BUILD_TYPE=Release -G Ninja -S .. -B . | ||
cmake --build . --target SOCK5Server -j 12 --config Release | ||
|
||
cd ../scripts | ||
pause |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
@echo off | ||
cd .. | ||
if exist Build ( | ||
rmdir Build /Q /S | ||
) | ||
mkdir Build | ||
if exist cmake ( | ||
rmdir cmake /Q /S | ||
) | ||
mkdir cmake | ||
|
||
cd cmake | ||
|
||
conan install .. -s build_type=Debug --build missing -s compiler.runtime=MTd -s compiler="Visual Studio" -s compiler.cppstd=20 -if ../cmake | ||
if %ERRORLEVEL% GEQ 1 EXIT /B 1 | ||
|
||
cd ../Build | ||
cmake -DCMAKE_BUILD_TYPE=Debug -S .. -B . | ||
if %ERRORLEVEL% GEQ 1 EXIT /B 1 | ||
cmake --build . --target SOCK5Server -j 12 --config Debug | ||
if %ERRORLEVEL% GEQ 1 EXIT /B 1 | ||
cd ../scripts | ||
|
||
pause |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
@echo off | ||
cd .. | ||
if exist Build ( | ||
rmdir Build /Q /S | ||
) | ||
mkdir Build | ||
if exist cmake ( | ||
rmdir cmake /Q /S | ||
) | ||
mkdir cmake | ||
|
||
cd cmake | ||
conan install .. -s build_type=Release --build missing -s compiler.runtime=MT -s compiler="Visual Studio" -s compiler.cppstd=20 -if ../cmake | ||
if %ERRORLEVEL% GEQ 1 EXIT /B 1 | ||
|
||
cd ../Build | ||
cmake -DCMAKE_BUILD_TYPE=Release -S .. -B . | ||
if %ERRORLEVEL% GEQ 1 EXIT /B 1 | ||
cmake --build . --target SOCK5Server -j 12 --config Release | ||
if %ERRORLEVEL% GEQ 1 EXIT /B 1 | ||
cd ../scripts | ||
|
||
pause |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/** | ||
* Reverse TCP Sock5 Proxy | ||
* Copyright(c) 2022 - Coldzer0 <Coldzer0 [at] protonmail.ch> @Coldzer0x0 | ||
*/ | ||
|
||
#ifdef _DIST | ||
#pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup") | ||
#endif | ||
|
||
#include "UI/GUI_backend.h" | ||
#include <Windows.h> | ||
|
||
extern "C" { | ||
[[maybe_unused]] __declspec(dllexport) uint32_t NvOptimusEnablement = 1; | ||
[[maybe_unused]] __declspec(dllexport) uint32_t AmdPowerXpressRequestHighPerformance = 1; | ||
} | ||
|
||
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nShowCmd) { | ||
InitServerGui(); | ||
return 0; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#pragma once | ||
#include <Windows.h> | ||
|