mirror of
https://github.com/HIllya51/LunaHook.git
synced 2024-11-23 05:45:37 +08:00
sock
This commit is contained in:
parent
1e7d410f9f
commit
72f01321fe
@ -4,7 +4,7 @@ if(${CMAKE_SIZEOF_VOID_P} EQUAL 8)
|
||||
set(enginepath "engine64")
|
||||
set(collector "enginecollection64.cpp")
|
||||
else()
|
||||
set(enginessrc AGE_System AksysGames RPGMaker Stronger TACTICS Onscripter Sceplay DISCOVERY Erogos godot A98SYS GuruGuruSMF4 TeethingRing Fizz CoffeeMaker VALKYRIA mirage CisLugI tamasoft FrontWing solfasys Diskdream splushwave ransel akatombo GASTRO GSX Aksys ScrPlayer SYSD KISS IGScript Jellyfish BKEngine Overflow SRPGStudio Suika2 FVP LCScript Ohgetsu RPGMakerRGSS3 ONScripterru OVERDRIVE HXP Palette Purple Ruf RUNE Tarte Tomato Sakuradog Troy VitaminSoft Unknown TSSystem Xbangbang Anisetta Nijyuei Interheart LovaGame Giga Jisatu101 EntisGLS Ciel ACTGS TerraLunar PPSSPP jukujojidai PCSX2 VanillawareGC cef V8 mono pchooks PONScripter Bishop sakanagl Lightvn KiriKiri SideB BGI Bootup morning shyakunage Regista NNNConfig Eushully Majiro littlecheese Elf Silkys CMVS Wolf Circus1 Circus2 Cotopha Artemis CatSystem Atelier Tenco QLIE Pal AIL2 NeXAS LunaSoft Unicorn Rejet Interlude AdobeAir Retouch Malie Live Nexton Lucifen Waffle TinkerBell SystemAoi Yuris Nitroplus2 Bruns EME RRE Candy Speed ApricoT Triangle AB2Try MBLMED GameMaker DxLib CodeX Minori Sprite RpgmXP Eagls Debonosu C4 WillPlus Tanuki GXP AOS Mink YukaSystem2 sakusesu Exp Syuntada Pensil Anim hibiki Nitroplus Reallive Siglus Taskforce2 RUGP IronGameSystem Anex86 ShinyDaysGame MarineHeart ShinaRio CaramelBox UnisonShift Escude Ryokucha Alice Footy2 utawarerumono System4x Abalone Abel 5pb HorkEye XUSE Leaf Nekopack AXL AGS AdobeFlash10 FocasLens Tamamo Ages3ResT)
|
||||
set(enginessrc AGE_System AksysGames RPGMaker Stronger TACTICS Onscripter Sceplay DISCOVERY Erogos godot A98SYS GuruGuruSMF4 TeethingRing Fizz CoffeeMaker VALKYRIA mirage CisLugI tamasoft FrontWing solfasys Diskdream splushwave ransel akatombo GASTRO GSX Aksys ScrPlayer SYSD KISS IGScript Jellyfish BKEngine Overflow SRPGStudio Suika2 FVP LCScript Ohgetsu RPGMakerRGSS3 ONScripterru OVERDRIVE HXP Palette Purple Ruf RUNE Tarte Tomato Sakuradog Troy VitaminSoft UnknownEngine TSSystem Xbangbang Anisetta Nijyuei Interheart LovaGame Giga Jisatu101 EntisGLS Ciel ACTGS TerraLunar PPSSPP jukujojidai PCSX2 VanillawareGC cef V8 mono pchooks PONScripter Bishop sakanagl Lightvn KiriKiri SideB BGI Bootup morning shyakunage Regista NNNConfig Eushully Majiro littlecheese Elf Silkys CMVS Wolf Circus1 Circus2 Cotopha Artemis CatSystem Atelier Tenco QLIE Pal AIL2 NeXAS LunaSoft Unicorn Rejet Interlude AdobeAir Retouch Malie Live Nexton Lucifen Waffle TinkerBell SystemAoi Yuris Nitroplus2 Bruns EME RRE Candy Speed ApricoT Triangle AB2Try MBLMED GameMaker DxLib CodeX Minori Sprite RpgmXP Eagls Debonosu C4 WillPlus Tanuki GXP AOS Mink YukaSystem2 sakusesu Exp Syuntada Pensil Anim hibiki Nitroplus Reallive Siglus Taskforce2 RUGP IronGameSystem Anex86 ShinyDaysGame MarineHeart ShinaRio CaramelBox UnisonShift Escude Ryokucha Alice Footy2 utawarerumono System4x Abalone Abel 5pb HorkEye XUSE Leaf Nekopack AXL AGS AdobeFlash10 FocasLens Tamamo Ages3ResT)
|
||||
set(enginepath "engine32")
|
||||
set(collector "enginecollection32.cpp")
|
||||
endif()
|
||||
@ -51,4 +51,4 @@ target_precompile_headers(LunaHook REUSE_FROM pchhook)
|
||||
|
||||
set_target_properties(LunaHook PROPERTIES OUTPUT_NAME "LunaHook${bitappendix}")
|
||||
|
||||
target_link_libraries(LunaHook Version httpapi Shlwapi pch minhook commonengine utils ${YY_Thunks_for_WinXP} ${Detours})
|
||||
target_link_libraries(LunaHook Version httpapi ws2_32 Shlwapi pch minhook commonengine utils ${YY_Thunks_for_WinXP} ${Detours})
|
@ -1,5 +1,5 @@
|
||||
#include"Unknown.h"
|
||||
bool Unknown::attach_function() {
|
||||
#include"UnknownEngine.h"
|
||||
bool UnknownEngine::attach_function() {
|
||||
//ABANDONER - THE SEVERED DREAMS
|
||||
//https://vndb.org/v1182
|
||||
const BYTE bytes[] = {
|
@ -1,8 +1,8 @@
|
||||
|
||||
|
||||
class Unknown:public ENGINE{
|
||||
class UnknownEngine:public ENGINE{
|
||||
public:
|
||||
Unknown(){
|
||||
UnknownEngine(){
|
||||
|
||||
check_by=CHECK_BY::FILE;
|
||||
is_engine_certain=false;
|
@ -58,7 +58,7 @@
|
||||
#include "engine32/Cotopha.h"
|
||||
#include "engine32/Xbangbang.h"
|
||||
#include "engine32/TeethingRing.h"
|
||||
#include "engine32/Unknown.h"
|
||||
#include "engine32/UnknownEngine.h"
|
||||
#include "engine32/Artemis.h"
|
||||
#include "engine32/CatSystem.h"
|
||||
#include "engine32/Atelier.h"
|
||||
@ -299,7 +299,7 @@ std::vector<ENGINE *> check_engines()
|
||||
new ACTGS,
|
||||
new Nijyuei,
|
||||
new Xbangbang,
|
||||
new Unknown,
|
||||
new UnknownEngine,
|
||||
new TSSystem,
|
||||
new Troy,
|
||||
new Tomato,
|
||||
|
@ -241,54 +241,51 @@ auto makeserveronce(int port)
|
||||
}
|
||||
int GetRandomAvailablePort()
|
||||
{
|
||||
static int xx = 9000 + GetCurrentProcessId() % 20000;
|
||||
return xx++;
|
||||
WSADATA wsaData;
|
||||
int result = WSAStartup(MAKEWORD(2, 2), &wsaData);
|
||||
if (result != 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
// WSADATA wsaData;
|
||||
// int result = WSAStartup(MAKEWORD(2, 2), &wsaData);
|
||||
// if (result != 0)
|
||||
// {
|
||||
// return 0;
|
||||
// }
|
||||
// 创建一个 TCP 套接字
|
||||
SOCKET sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||
if (sock == INVALID_SOCKET)
|
||||
{
|
||||
WSACleanup();
|
||||
return 0;
|
||||
}
|
||||
|
||||
// // 创建一个 TCP 套接字
|
||||
// SOCKET sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
|
||||
// if (sock == INVALID_SOCKET)
|
||||
// {
|
||||
// WSACleanup();
|
||||
// return 0;
|
||||
// }
|
||||
// 绑定到随机端口
|
||||
sockaddr_in addr;
|
||||
addr.sin_family = AF_INET;
|
||||
addr.sin_addr.s_addr = INADDR_ANY;
|
||||
addr.sin_port = 0; // 0 表示让系统自动选择一个可用端口
|
||||
|
||||
// // 绑定到随机端口
|
||||
// sockaddr_in addr;
|
||||
// addr.sin_family = AF_INET;
|
||||
// addr.sin_addr.s_addr = INADDR_ANY;
|
||||
// addr.sin_port = 0; // 0 表示让系统自动选择一个可用端口
|
||||
result = bind(sock, (SOCKADDR *)&addr, sizeof(addr));
|
||||
if (result == SOCKET_ERROR)
|
||||
{
|
||||
closesocket(sock);
|
||||
WSACleanup();
|
||||
return 0;
|
||||
}
|
||||
|
||||
// result = bind(sock, (SOCKADDR *)&addr, sizeof(addr));
|
||||
// if (result == SOCKET_ERROR)
|
||||
// {
|
||||
// closesocket(sock);
|
||||
// WSACleanup();
|
||||
// return 0;
|
||||
// }
|
||||
// 获取实际绑定的端口号
|
||||
int addrLen = sizeof(addr);
|
||||
result = getsockname(sock, (SOCKADDR *)&addr, &addrLen);
|
||||
if (result == SOCKET_ERROR)
|
||||
{
|
||||
closesocket(sock);
|
||||
WSACleanup();
|
||||
return 0;
|
||||
}
|
||||
|
||||
// // 获取实际绑定的端口号
|
||||
// int addrLen = sizeof(addr);
|
||||
// result = getsockname(sock, (SOCKADDR *)&addr, &addrLen);
|
||||
// if (result == SOCKET_ERROR)
|
||||
// {
|
||||
// closesocket(sock);
|
||||
// WSACleanup();
|
||||
// return 0;
|
||||
// }
|
||||
// 关闭套接字
|
||||
closesocket(sock);
|
||||
WSACleanup();
|
||||
|
||||
// // 关闭套接字
|
||||
// closesocket(sock);
|
||||
// WSACleanup();
|
||||
|
||||
// // 返回实际绑定的端口号
|
||||
// return ntohs(addr.sin_port);
|
||||
// 返回实际绑定的端口号
|
||||
return ntohs(addr.sin_port);
|
||||
}
|
||||
|
||||
int makehttpgetserverinternal()
|
||||
|
@ -1,5 +1,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <Winsock2.h>
|
||||
#define _WINSOCKAPI_
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
#include <Windows.h>
|
||||
#include <windowsx.h>
|
||||
|
Loading…
Reference in New Issue
Block a user