Compare commits
No commits in common. "main" and "redos1.0" have entirely different histories.
@ -2,8 +2,7 @@
|
|||||||
from analyzer import PureAnalyzer # type: ignore
|
from analyzer import PureAnalyzer # type: ignore
|
||||||
from crawlers_core import CrawlerEngine
|
from crawlers_core import CrawlerEngine
|
||||||
from catch import CacheManager
|
from catch import CacheManager
|
||||||
from manger import ConnectionManager
|
|
||||||
from utils.logger import setup_logging
|
|
||||||
|
|
||||||
class PureInfoHunter:
|
class PureInfoHunter:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
@ -42,11 +41,6 @@ class PureInfoHunter:
|
|||||||
f.write(content)
|
f.write(content)
|
||||||
print(f"报告已保存到 reports/{safe_query}_report.txt")
|
print(f"报告已保存到 reports/{safe_query}_report.txt")
|
||||||
|
|
||||||
def sync_local_cache(self):
|
|
||||||
if self.mode == 'local':
|
|
||||||
cloud_data = self.cloud.execute("get_all_updates")
|
|
||||||
self.local.save_cache(cloud_data)
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
@ -65,27 +59,6 @@ if __name__ == "__main__":
|
|||||||
|
|
||||||
hunter = PureInfoHunter()
|
hunter = PureInfoHunter()
|
||||||
|
|
||||||
setup_logging()
|
|
||||||
|
|
||||||
parser = argparse.ArgumentParser()
|
|
||||||
parser.add_argument('command', help='执行指令或查询')
|
|
||||||
parser.add_argument('--local', action='store_true',
|
|
||||||
help='强制使用本地模式')
|
|
||||||
args = parser.parse_args()
|
|
||||||
|
|
||||||
manager = ConnectionManager()
|
|
||||||
try:
|
|
||||||
if args.local:
|
|
||||||
manager.mode = 'local'
|
|
||||||
|
|
||||||
result = manager.execute(args.command)
|
|
||||||
print(f"✅ 执行成功 (模式: {manager.mode.upper()})")
|
|
||||||
print(result)
|
|
||||||
|
|
||||||
except Exception as e:
|
|
||||||
print(f"❌ 执行失败: {str(e)}")
|
|
||||||
exit(1)
|
|
||||||
|
|
||||||
if force_update:
|
if force_update:
|
||||||
print("强制更新模式(忽略缓存)")
|
print("强制更新模式(忽略缓存)")
|
||||||
data = hunter.crawler.crawl(query) # 使用实际存在的方法名
|
data = hunter.crawler.crawl(query) # 使用实际存在的方法名
|
@ -1,37 +0,0 @@
|
|||||||
import requests
|
|
||||||
from ..security import decrypt_secret
|
|
||||||
from logger import log
|
|
||||||
|
|
||||||
class CloudConnector:
|
|
||||||
def __init__(self, config):
|
|
||||||
self.endpoint = config['Cloud']['endpoint']
|
|
||||||
self.timeout = int(config['Deployment']['cloud_timeout'])
|
|
||||||
self.retry = int(config['Cloud']['retry_times'])
|
|
||||||
self.token = decrypt_secret('api_token')
|
|
||||||
|
|
||||||
def _make_request(self, data):
|
|
||||||
headers = {
|
|
||||||
"Authorization": f"Bearer {self.token}",
|
|
||||||
"Content-Type": "application/json"
|
|
||||||
}
|
|
||||||
try:
|
|
||||||
resp = requests.post(
|
|
||||||
self.endpoint,
|
|
||||||
json=data,
|
|
||||||
headers=headers,
|
|
||||||
timeout=self.timeout
|
|
||||||
)
|
|
||||||
resp.raise_for_status()
|
|
||||||
return resp.json()
|
|
||||||
except requests.exceptions.RequestException as e:
|
|
||||||
log.error(f"Cloud request failed: {str(e)}")
|
|
||||||
raise ConnectionError("Cloud service unavailable")
|
|
||||||
|
|
||||||
def execute(self, command):
|
|
||||||
for attempt in range(self.retry):
|
|
||||||
try:
|
|
||||||
return self._make_request({"command": command})
|
|
||||||
except ConnectionError:
|
|
||||||
if attempt == self.retry - 1:
|
|
||||||
raise
|
|
||||||
log.warning(f"Retrying... ({attempt + 1}/{self.retry})")
|
|
@ -1,12 +0,0 @@
|
|||||||
[Deployment]
|
|
||||||
default_mode = cloud
|
|
||||||
cloud_timeout = 10
|
|
||||||
local_fallback = true
|
|
||||||
|
|
||||||
[Cloud]
|
|
||||||
endpoint = https://api.yourservice.com/v1
|
|
||||||
retry_times = 3
|
|
||||||
|
|
||||||
[Local]
|
|
||||||
db_path = ./local_data.db
|
|
||||||
max_rows = 1000
|
|
@ -1,11 +0,0 @@
|
|||||||
import configparser
|
|
||||||
import os
|
|
||||||
from pathlib import Path
|
|
||||||
|
|
||||||
def load_config():
|
|
||||||
config = configparser.ConfigParser()
|
|
||||||
config.read([
|
|
||||||
Path(__file__).parent.parent / 'config/config.ini',
|
|
||||||
# Path(__file__).parent.parent / 'config/secrets.enc'
|
|
||||||
])
|
|
||||||
return config
|
|
@ -1,17 +0,0 @@
|
|||||||
import sqlite3
|
|
||||||
from logger import log
|
|
||||||
|
|
||||||
class LocalConnector:
|
|
||||||
def __init__(self, config):
|
|
||||||
self.db_path = config['Local']['db_path']
|
|
||||||
self.max_rows = int(config['Local']['max_rows'])
|
|
||||||
|
|
||||||
def execute(self, query):
|
|
||||||
try:
|
|
||||||
with sqlite3.connect(self.db_path) as conn:
|
|
||||||
cursor = conn.cursor()
|
|
||||||
cursor.execute(query)
|
|
||||||
return cursor.fetchmany(self.max_rows)
|
|
||||||
except Exception as e:
|
|
||||||
log.error(f"Local DB error: {str(e)}")
|
|
||||||
raise ConnectionError("Local storage unavailable")
|
|
@ -1,27 +0,0 @@
|
|||||||
from logger import log
|
|
||||||
|
|
||||||
def main():
|
|
||||||
log.info("程序启动")
|
|
||||||
try:
|
|
||||||
# 你的代码
|
|
||||||
log.debug("调试信息: %s", some_var) # type: ignore
|
|
||||||
except Exception as e:
|
|
||||||
log.error("操作失败: %s", str(e), exc_info=True)
|
|
||||||
raise
|
|
||||||
# 自定义日志器
|
|
||||||
custom_log = setup_logging(
|
|
||||||
name="MyModule",
|
|
||||||
log_dir="custom_logs",
|
|
||||||
file_level=logging.INFO,
|
|
||||||
console_level=logging.DEBUG,
|
|
||||||
max_bytes=5*1024*1024, # 5MB
|
|
||||||
backup_count=3
|
|
||||||
)
|
|
||||||
|
|
||||||
# 使用示例
|
|
||||||
custom_log.warning("自定义日志记录")
|
|
||||||
# 使用示例
|
|
||||||
custom_log.warning("自定义日志记录")
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
|
||||||
main()
|
|
@ -1,40 +0,0 @@
|
|||||||
from cloud import CloudConnector
|
|
||||||
from local import LocalConnector
|
|
||||||
from ..FFAICilent.config.configloder import load_config
|
|
||||||
|
|
||||||
class ConnectionManager:
|
|
||||||
def __init__(self):
|
|
||||||
self.config = load_config()
|
|
||||||
self.mode = self.config['Deployment']['default_mode']
|
|
||||||
self._init_connectors()
|
|
||||||
|
|
||||||
def _init_connectors(self):
|
|
||||||
self.cloud = CloudConnector(self.config)
|
|
||||||
self.local = LocalConnector(self.config)
|
|
||||||
|
|
||||||
def execute(self, command):
|
|
||||||
# 优先使用默认模式
|
|
||||||
if self.mode == 'cloud':
|
|
||||||
try:
|
|
||||||
return self.cloud.execute(command)
|
|
||||||
except ConnectionError as e:
|
|
||||||
if self.config.getboolean('Deployment', 'local_fallback'):
|
|
||||||
return self._fallback_to_local(command)
|
|
||||||
raise
|
|
||||||
else:
|
|
||||||
return self.local.execute(command)
|
|
||||||
|
|
||||||
def _fallback_to_local(self, command):
|
|
||||||
"""自动降级到本地模式"""
|
|
||||||
from logger import log
|
|
||||||
log.warning("Falling back to local mode")
|
|
||||||
self.mode = 'local'
|
|
||||||
|
|
||||||
# 转换云指令到本地查询
|
|
||||||
local_query = self._adapt_command(command)
|
|
||||||
return self.local.execute(local_query)
|
|
||||||
|
|
||||||
def _adapt_command(self, cloud_cmd):
|
|
||||||
"""将云API指令转换为本地查询(示例)"""
|
|
||||||
# 这里添加你的业务逻辑转换规则
|
|
||||||
return f"SELECT * FROM cache WHERE key='{cloud_cmd}'"
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,37 +0,0 @@
|
|||||||
{
|
|
||||||
"Version": 1,
|
|
||||||
"WorkspaceRootPath": "D:\\FFnew\\FFCN\\ConsoleApplication2\\",
|
|
||||||
"Documents": [
|
|
||||||
{
|
|
||||||
"AbsoluteMoniker": "D:0:0:{BFD11069-1F1C-4A9B-9FAF-91A555B712BF}|ConsoleApplication2\\ConsoleApplication2.vcxproj|D:\\FFnew\\FFCN\\ConsoleApplication2\\ConsoleApplication2\\ConsoleApplication2.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
|
|
||||||
"RelativeMoniker": "D:0:0:{BFD11069-1F1C-4A9B-9FAF-91A555B712BF}|ConsoleApplication2\\ConsoleApplication2.vcxproj|solutionrelative:ConsoleApplication2\\ConsoleApplication2.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"DocumentGroupContainers": [
|
|
||||||
{
|
|
||||||
"Orientation": 0,
|
|
||||||
"VerticalTabListWidth": 256,
|
|
||||||
"DocumentGroups": [
|
|
||||||
{
|
|
||||||
"DockedWidth": 200,
|
|
||||||
"SelectedChildIndex": 0,
|
|
||||||
"Children": [
|
|
||||||
{
|
|
||||||
"$type": "Document",
|
|
||||||
"DocumentIndex": 0,
|
|
||||||
"Title": "ConsoleApplication2.cpp",
|
|
||||||
"DocumentMoniker": "D:\\FFnew\\FFCN\\ConsoleApplication2\\ConsoleApplication2\\ConsoleApplication2.cpp",
|
|
||||||
"RelativeDocumentMoniker": "ConsoleApplication2\\ConsoleApplication2.cpp",
|
|
||||||
"ToolTip": "D:\\FFnew\\FFCN\\ConsoleApplication2\\ConsoleApplication2\\ConsoleApplication2.cpp",
|
|
||||||
"RelativeToolTip": "ConsoleApplication2\\ConsoleApplication2.cpp",
|
|
||||||
"ViewState": "AgIAAP8AAAAAAAAAAAAAACYBAAAMAAAAAAAAAA==",
|
|
||||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
|
|
||||||
"WhenOpened": "2025-06-14T09:15:44.418Z",
|
|
||||||
"EditorCaption": ""
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,37 +0,0 @@
|
|||||||
{
|
|
||||||
"Version": 1,
|
|
||||||
"WorkspaceRootPath": "D:\\FFnew\\FFC\\REDOS\\",
|
|
||||||
"Documents": [
|
|
||||||
{
|
|
||||||
"AbsoluteMoniker": "D:0:0:{BFD11069-1F1C-4A9B-9FAF-91A555B712BF}|ConsoleApplication2\\ConsoleApplication2.vcxproj|D:\\FFnew\\FFC\\REDOS\\ConsoleApplication2\\ConsoleApplication2.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}",
|
|
||||||
"RelativeMoniker": "D:0:0:{BFD11069-1F1C-4A9B-9FAF-91A555B712BF}|ConsoleApplication2\\ConsoleApplication2.vcxproj|solutionrelative:ConsoleApplication2\\ConsoleApplication2.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"DocumentGroupContainers": [
|
|
||||||
{
|
|
||||||
"Orientation": 0,
|
|
||||||
"VerticalTabListWidth": 256,
|
|
||||||
"DocumentGroups": [
|
|
||||||
{
|
|
||||||
"DockedWidth": 200,
|
|
||||||
"SelectedChildIndex": 0,
|
|
||||||
"Children": [
|
|
||||||
{
|
|
||||||
"$type": "Document",
|
|
||||||
"DocumentIndex": 0,
|
|
||||||
"Title": "ConsoleApplication2.cpp",
|
|
||||||
"DocumentMoniker": "D:\\FFnew\\FFC\\REDOS\\ConsoleApplication2\\ConsoleApplication2.cpp",
|
|
||||||
"RelativeDocumentMoniker": "ConsoleApplication2\\ConsoleApplication2.cpp",
|
|
||||||
"ToolTip": "D:\\FFnew\\FFC\\REDOS\\ConsoleApplication2\\ConsoleApplication2.cpp",
|
|
||||||
"RelativeToolTip": "ConsoleApplication2\\ConsoleApplication2.cpp",
|
|
||||||
"ViewState": "AgIAAP8AAAAAAAAAAAAAACYBAAAMAAAAAAAAAA==",
|
|
||||||
"Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|",
|
|
||||||
"WhenOpened": "2025-06-14T09:15:44.418Z",
|
|
||||||
"EditorCaption": ""
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"CurrentProjectSetting": "无配置"
|
|
||||||
}
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"Version": 1,
|
|
||||||
"WorkspaceRootPath": "D:\\FFnew\\FFC\\REDOS\\",
|
|
||||||
"Documents": [],
|
|
||||||
"DocumentGroupContainers": [
|
|
||||||
{
|
|
||||||
"Orientation": 0,
|
|
||||||
"VerticalTabListWidth": 256,
|
|
||||||
"DocumentGroups": []
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
@ -1,8 +0,0 @@
|
|||||||
{
|
|
||||||
"ExpandedNodes": [
|
|
||||||
"",
|
|
||||||
"\\ConsoleApplication2"
|
|
||||||
],
|
|
||||||
"SelectedNode": "\\ConsoleApplication2\\ConsoleApplication2.cpp",
|
|
||||||
"PreviewInSolutionExplorer": false
|
|
||||||
}
|
|
Binary file not shown.
@ -1,31 +0,0 @@
|
|||||||
|
|
||||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
|
||||||
# Visual Studio Version 17
|
|
||||||
VisualStudioVersion = 17.14.36127.28 d17.14
|
|
||||||
MinimumVisualStudioVersion = 10.0.40219.1
|
|
||||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ConsoleApplication2", "ConsoleApplication2\ConsoleApplication2.vcxproj", "{BFD11069-1F1C-4A9B-9FAF-91A555B712BF}"
|
|
||||||
EndProject
|
|
||||||
Global
|
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
|
||||||
Debug|x64 = Debug|x64
|
|
||||||
Debug|x86 = Debug|x86
|
|
||||||
Release|x64 = Release|x64
|
|
||||||
Release|x86 = Release|x86
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
|
||||||
{BFD11069-1F1C-4A9B-9FAF-91A555B712BF}.Debug|x64.ActiveCfg = Debug|x64
|
|
||||||
{BFD11069-1F1C-4A9B-9FAF-91A555B712BF}.Debug|x64.Build.0 = Debug|x64
|
|
||||||
{BFD11069-1F1C-4A9B-9FAF-91A555B712BF}.Debug|x86.ActiveCfg = Debug|Win32
|
|
||||||
{BFD11069-1F1C-4A9B-9FAF-91A555B712BF}.Debug|x86.Build.0 = Debug|Win32
|
|
||||||
{BFD11069-1F1C-4A9B-9FAF-91A555B712BF}.Release|x64.ActiveCfg = Release|x64
|
|
||||||
{BFD11069-1F1C-4A9B-9FAF-91A555B712BF}.Release|x64.Build.0 = Release|x64
|
|
||||||
{BFD11069-1F1C-4A9B-9FAF-91A555B712BF}.Release|x86.ActiveCfg = Release|Win32
|
|
||||||
{BFD11069-1F1C-4A9B-9FAF-91A555B712BF}.Release|x86.Build.0 = Release|Win32
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
|
||||||
HideSolutionNode = FALSE
|
|
||||||
EndGlobalSection
|
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
|
||||||
SolutionGuid = {2071730D-E6BC-43D2-AE05-938F8BBDBFB5}
|
|
||||||
EndGlobalSection
|
|
||||||
EndGlobal
|
|
@ -1,448 +0,0 @@
|
|||||||
#include <iostream>
|
|
||||||
#include <string>
|
|
||||||
#include <vector>
|
|
||||||
#include <thread>
|
|
||||||
#include <mutex>
|
|
||||||
#include <atomic>
|
|
||||||
#include <chrono>
|
|
||||||
#include <ctime>
|
|
||||||
#include <iomanip>
|
|
||||||
#include <winsock2.h>
|
|
||||||
#include <ws2tcpip.h>
|
|
||||||
#include <windows.h>
|
|
||||||
|
|
||||||
#pragma comment(lib, "ws2_32.lib")
|
|
||||||
|
|
||||||
// 全局变量
|
|
||||||
std::mutex cout_mutex;
|
|
||||||
std::atomic<int> total_sent(0);
|
|
||||||
std::atomic<bool> stop_flag(false);
|
|
||||||
|
|
||||||
enum class Protocol { UDP, TCP };
|
|
||||||
|
|
||||||
// 获取当前时间字符串
|
|
||||||
std::string get_current_time() {
|
|
||||||
auto now = std::chrono::system_clock::now();
|
|
||||||
std::time_t now_time = std::chrono::system_clock::to_time_t(now);
|
|
||||||
std::tm now_tm;
|
|
||||||
localtime_s(&now_tm, &now_time);
|
|
||||||
|
|
||||||
char buffer[80];
|
|
||||||
strftime(buffer, sizeof(buffer), "%H:%M:%S", &now_tm);
|
|
||||||
return std::string(buffer);
|
|
||||||
}
|
|
||||||
|
|
||||||
std::string get_windows_error_message(int error_code) {
|
|
||||||
LPSTR buffer = nullptr;
|
|
||||||
FormatMessageA(
|
|
||||||
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM,
|
|
||||||
nullptr, error_code, 0,
|
|
||||||
(LPSTR)&buffer, 0, nullptr);
|
|
||||||
std::string message(buffer ? buffer : "Unknown error");
|
|
||||||
if (buffer) LocalFree(buffer);
|
|
||||||
return message;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 域名解析函数
|
|
||||||
std::string resolve_dns(const std::string& hostname) {
|
|
||||||
WSADATA wsaData;
|
|
||||||
if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) {
|
|
||||||
throw std::runtime_error("WSAStartup失败");
|
|
||||||
}
|
|
||||||
|
|
||||||
addrinfo hints = { 0 };
|
|
||||||
hints.ai_family = AF_INET; // IPv4
|
|
||||||
hints.ai_socktype = SOCK_STREAM;
|
|
||||||
hints.ai_protocol = IPPROTO_TCP;
|
|
||||||
|
|
||||||
addrinfo* result = nullptr;
|
|
||||||
int error = getaddrinfo(hostname.c_str(), nullptr, &hints, &result);
|
|
||||||
if (error != 0) {
|
|
||||||
WSACleanup();
|
|
||||||
throw std::runtime_error("域名解析失败: " + std::to_string(error));
|
|
||||||
}
|
|
||||||
|
|
||||||
char ip_str[INET_ADDRSTRLEN];
|
|
||||||
sockaddr_in* addr = reinterpret_cast<sockaddr_in*>(result->ai_addr);
|
|
||||||
inet_ntop(AF_INET, &addr->sin_addr, ip_str, INET_ADDRSTRLEN);
|
|
||||||
|
|
||||||
std::string ip_address(ip_str);
|
|
||||||
freeaddrinfo(result);
|
|
||||||
WSACleanup();
|
|
||||||
|
|
||||||
return ip_address;
|
|
||||||
}
|
|
||||||
|
|
||||||
// UDP发送线程
|
|
||||||
void udp_send_thread(const std::string& target_ip, int target_port,
|
|
||||||
const std::string& packet_data, float interval,
|
|
||||||
int thread_id, int packets_per_thread) {
|
|
||||||
WSADATA wsaData;
|
|
||||||
SOCKET sock;
|
|
||||||
sockaddr_in serverAddr;
|
|
||||||
|
|
||||||
if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) {
|
|
||||||
std::lock_guard<std::mutex> lock(cout_mutex);
|
|
||||||
std::cerr << "UDP线程" << thread_id << ": WSAStartup失败" << std::endl;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((sock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) == INVALID_SOCKET) {
|
|
||||||
std::lock_guard<std::mutex> lock(cout_mutex);
|
|
||||||
std::cerr << "UDP线程" << thread_id << ": 创建套接字失败" << std::endl;
|
|
||||||
WSACleanup();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
memset(&serverAddr, 0, sizeof(serverAddr));
|
|
||||||
serverAddr.sin_family = AF_INET;
|
|
||||||
serverAddr.sin_port = htons(target_port);
|
|
||||||
inet_pton(AF_INET, target_ip.c_str(), &serverAddr.sin_addr);
|
|
||||||
|
|
||||||
int sent = 0;
|
|
||||||
while (!stop_flag && (packets_per_thread == 0 || sent < packets_per_thread)) {
|
|
||||||
if (sendto(sock, packet_data.c_str(), packet_data.size(), 0,
|
|
||||||
(sockaddr*)&serverAddr, sizeof(serverAddr)) == SOCKET_ERROR) {
|
|
||||||
std::lock_guard<std::mutex> lock(cout_mutex);
|
|
||||||
std::cerr << "UDP线程" << thread_id << ": 发送失败" << std::endl;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
sent++;
|
|
||||||
total_sent++;
|
|
||||||
|
|
||||||
if (sent % 100 == 0) {
|
|
||||||
std::lock_guard<std::mutex> lock(cout_mutex);
|
|
||||||
std::cout << "[" << get_current_time() << "] "
|
|
||||||
<< "UDP线程" << thread_id << ": 已发送 " << sent << " 个包" << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (interval > 0) {
|
|
||||||
std::this_thread::sleep_for(
|
|
||||||
std::chrono::milliseconds(static_cast<int>(interval * 1000)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
closesocket(sock);
|
|
||||||
WSACleanup();
|
|
||||||
|
|
||||||
std::lock_guard<std::mutex> lock(cout_mutex);
|
|
||||||
std::cout << "UDP线程" << thread_id << ": 已完成,共发送 " << sent << " 个包" << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
// TCP发送线程
|
|
||||||
void tcp_send_thread(const std::string& target_ip, int target_port,
|
|
||||||
const std::string& packet_data, float interval,
|
|
||||||
int thread_id, int packets_per_thread) {
|
|
||||||
WSADATA wsaData;
|
|
||||||
SOCKET sock = INVALID_SOCKET;
|
|
||||||
int sent_count = 0;
|
|
||||||
const int timeout_ms = 2000; // 2秒超时
|
|
||||||
|
|
||||||
// 1. 初始化Winsock
|
|
||||||
if (WSAStartup(MAKEWORD(2, 2), &wsaData) != 0) {
|
|
||||||
std::lock_guard<std::mutex> lock(cout_mutex);
|
|
||||||
std::cerr << "[" << get_current_time() << "] TCP线程" << thread_id
|
|
||||||
<< " WSAStartup失败: " << WSAGetLastError() << std::endl;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 2. 创建socket
|
|
||||||
if ((sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) == INVALID_SOCKET) {
|
|
||||||
std::lock_guard<std::mutex> lock(cout_mutex);
|
|
||||||
std::cerr << "[" << get_current_time() << "] TCP线程" << thread_id
|
|
||||||
<< " 创建socket失败: " << get_windows_error_message(WSAGetLastError()) << std::endl;
|
|
||||||
WSACleanup();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 3. 设置超时选项
|
|
||||||
setsockopt(sock, SOL_SOCKET, SO_SNDTIMEO, (const char*)&timeout_ms, sizeof(timeout_ms));
|
|
||||||
|
|
||||||
// 4. 准备目标地址
|
|
||||||
sockaddr_in serverAddr;
|
|
||||||
memset(&serverAddr, 0, sizeof(serverAddr));
|
|
||||||
serverAddr.sin_family = AF_INET;
|
|
||||||
serverAddr.sin_port = htons(target_port);
|
|
||||||
if (inet_pton(AF_INET, target_ip.c_str(), &serverAddr.sin_addr) <= 0) {
|
|
||||||
std::lock_guard<std::mutex> lock(cout_mutex);
|
|
||||||
std::cerr << "[" << get_current_time() << "] TCP线程" << thread_id
|
|
||||||
<< " 无效的IP地址: " << target_ip << std::endl;
|
|
||||||
closesocket(sock);
|
|
||||||
WSACleanup();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 5. 建立连接
|
|
||||||
{
|
|
||||||
std::lock_guard<std::mutex> lock(cout_mutex);
|
|
||||||
std::cout << "[" << get_current_time() << "] TCP线程" << thread_id
|
|
||||||
<< " 正在连接 " << target_ip << ":" << target_port << "..." << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (connect(sock, (sockaddr*)&serverAddr, sizeof(serverAddr)) == SOCKET_ERROR) {
|
|
||||||
int err = WSAGetLastError();
|
|
||||||
std::lock_guard<std::mutex> lock(cout_mutex);
|
|
||||||
std::cerr << "[" << get_current_time() << "] TCP线程" << thread_id
|
|
||||||
<< " 连接失败: " << err << " - " << get_windows_error_message(err) << std::endl;
|
|
||||||
closesocket(sock);
|
|
||||||
WSACleanup();
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 6. 连接成功,开始发送数据
|
|
||||||
{
|
|
||||||
std::lock_guard<std::mutex> lock(cout_mutex);
|
|
||||||
std::cout << "[" << get_current_time() << "] TCP线程" << thread_id
|
|
||||||
<< " 连接成功,开始发送数据..." << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
const char* data_ptr = packet_data.c_str();
|
|
||||||
const int data_len = static_cast<int>(packet_data.size());
|
|
||||||
|
|
||||||
while (!stop_flag && (packets_per_thread == 0 || sent_count < packets_per_thread)) {
|
|
||||||
// 7. 发送数据包
|
|
||||||
int bytes_sent = send(sock, data_ptr, data_len, 0);
|
|
||||||
|
|
||||||
if (bytes_sent == SOCKET_ERROR) {
|
|
||||||
int err = WSAGetLastError();
|
|
||||||
std::lock_guard<std::mutex> lock(cout_mutex);
|
|
||||||
std::cerr << "[" << get_current_time() << "] TCP线程" << thread_id
|
|
||||||
<< " 发送失败: " << err << " - " << get_windows_error_message(err) << std::endl;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
sent_count++;
|
|
||||||
total_sent++;
|
|
||||||
|
|
||||||
// 8. 输出进度
|
|
||||||
if (sent_count % 10 == 0) {
|
|
||||||
std::lock_guard<std::mutex> lock(cout_mutex);
|
|
||||||
std::cout << "[" << get_current_time() << "] TCP线程" << thread_id
|
|
||||||
<< " 已发送 " << sent_count << " 个包 ("
|
|
||||||
<< sent_count * data_len << " 字节)" << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 9. 间隔控制
|
|
||||||
if (interval > 0) {
|
|
||||||
std::this_thread::sleep_for(
|
|
||||||
std::chrono::milliseconds(static_cast<int>(interval * 1000)));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 10. 关闭连接
|
|
||||||
{
|
|
||||||
std::lock_guard<std::mutex> lock(cout_mutex);
|
|
||||||
std::cout << "[" << get_current_time() << "] TCP线程" << thread_id
|
|
||||||
<< " 关闭连接,共发送 " << sent_count << " 个包" << std::endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
shutdown(sock, SD_SEND);
|
|
||||||
closesocket(sock);
|
|
||||||
WSACleanup();
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取用户输入
|
|
||||||
void getUserInput(std::string& target_ip, int& target_port, std::string& packet_data,
|
|
||||||
float& interval, int& total_count, int& thread_count, Protocol& protocol) {
|
|
||||||
std::cout << "=== 多协议网络数据包发送工具 ===" << std::endl;
|
|
||||||
|
|
||||||
// 选择协议
|
|
||||||
while (true) {
|
|
||||||
std::cout << "请选择协议 (1-UDP, 2-TCP): ";
|
|
||||||
std::string protocol_input;
|
|
||||||
std::getline(std::cin, protocol_input);
|
|
||||||
|
|
||||||
if (protocol_input == "1") {
|
|
||||||
protocol = Protocol::UDP;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else if (protocol_input == "2") {
|
|
||||||
protocol = Protocol::TCP;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
std::cout << "错误: 请输入1或2" << std::endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取目标地址(IP或域名)
|
|
||||||
while (true) {
|
|
||||||
std::cout << "请输入目标地址(IP或域名): ";
|
|
||||||
std::getline(std::cin, target_ip);
|
|
||||||
if (!target_ip.empty()) {
|
|
||||||
// 尝试解析域名
|
|
||||||
try {
|
|
||||||
// 检查是否是有效的IP地址
|
|
||||||
sockaddr_in sa;
|
|
||||||
if (inet_pton(AF_INET, target_ip.c_str(), &(sa.sin_addr)) != 1) {
|
|
||||||
std::cout << "正在解析域名: " << target_ip << "..." << std::endl;
|
|
||||||
std::string resolved_ip = resolve_dns(target_ip);
|
|
||||||
std::cout << "解析成功: " << target_ip << " -> " << resolved_ip << std::endl;
|
|
||||||
target_ip = resolved_ip;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
catch (const std::exception& e) {
|
|
||||||
std::cout << "错误: " << e.what() << std::endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
std::cout << "错误: 地址不能为空" << std::endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取端口号
|
|
||||||
while (true) {
|
|
||||||
std::cout << "请输入目标端口(1-65535): ";
|
|
||||||
std::string port_input;
|
|
||||||
std::getline(std::cin, port_input);
|
|
||||||
|
|
||||||
try {
|
|
||||||
target_port = std::stoi(port_input);
|
|
||||||
if (target_port >= 1 && target_port <= 65535) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
std::cout << "错误: 端口必须在1-65535范围内" << std::endl;
|
|
||||||
}
|
|
||||||
catch (...) {
|
|
||||||
std::cout << "错误: 请输入有效的端口号" << std::endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取发送内容
|
|
||||||
std::cout << "请输入要发送的内容(默认为'ping'): ";
|
|
||||||
std::getline(std::cin, packet_data);
|
|
||||||
if (packet_data.empty()) {
|
|
||||||
packet_data = "ping";
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取发送间隔
|
|
||||||
while (true) {
|
|
||||||
std::cout << "请输入发送间隔(秒,0表示无间隔,默认为0): ";
|
|
||||||
std::string interval_input;
|
|
||||||
std::getline(std::cin, interval_input);
|
|
||||||
|
|
||||||
if (interval_input.empty()) {
|
|
||||||
interval = 0.0f;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
interval = std::stof(interval_input);
|
|
||||||
if (interval >= 0) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
std::cout << "错误: 间隔时间不能为负数" << std::endl;
|
|
||||||
}
|
|
||||||
catch (...) {
|
|
||||||
std::cout << "错误: 请输入有效的数字" << std::endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取总发送次数
|
|
||||||
while (true) {
|
|
||||||
std::cout << "请输入总发送次数(0表示无限,默认为0): ";
|
|
||||||
std::string count_input;
|
|
||||||
std::getline(std::cin, count_input);
|
|
||||||
|
|
||||||
if (count_input.empty()) {
|
|
||||||
total_count = 0;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
total_count = std::stoi(count_input);
|
|
||||||
if (total_count >= 0) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
std::cout << "错误: 次数不能为负数" << std::endl;
|
|
||||||
}
|
|
||||||
catch (...) {
|
|
||||||
std::cout << "错误: 请输入有效的整数" << std::endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 获取线程数
|
|
||||||
while (true) {
|
|
||||||
std::cout << "请输入线程数(1-100,默认为4): ";
|
|
||||||
std::string thread_input;
|
|
||||||
std::getline(std::cin, thread_input);
|
|
||||||
|
|
||||||
if (thread_input.empty()) {
|
|
||||||
thread_count = 4;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
|
||||||
thread_count = std::stoi(thread_input);
|
|
||||||
if (thread_count >= 1 && thread_count <= 100) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
std::cout << "错误: 线程数必须在1-100范围内" << std::endl;
|
|
||||||
}
|
|
||||||
catch (...) {
|
|
||||||
std::cout << "错误: 请输入有效的整数" << std::endl;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int main() {
|
|
||||||
std::string ip, data;
|
|
||||||
int port, total_count, thread_count;
|
|
||||||
float interval;
|
|
||||||
Protocol protocol;
|
|
||||||
|
|
||||||
// 获取用户输入
|
|
||||||
getUserInput(ip, port, data, interval, total_count, thread_count, protocol);
|
|
||||||
|
|
||||||
// 计算每个线程需要发送的包数
|
|
||||||
int packets_per_thread = total_count == 0 ? 0 : total_count / thread_count;
|
|
||||||
int remaining_packets = total_count == 0 ? 0 : total_count % thread_count;
|
|
||||||
|
|
||||||
std::cout << "\n开始发送..." << std::endl;
|
|
||||||
std::cout << "协议: " << (protocol == Protocol::UDP ? "UDP" : "TCP") << std::endl;
|
|
||||||
std::cout << "目标: " << ip << ":" << port << std::endl;
|
|
||||||
std::cout << "内容: " << data << std::endl;
|
|
||||||
std::cout << "间隔: " << interval << "秒" << std::endl;
|
|
||||||
std::cout << "线程数: " << thread_count << std::endl;
|
|
||||||
std::cout << "总发送次数: " << (total_count == 0 ? "无限" : std::to_string(total_count)) << std::endl;
|
|
||||||
std::cout << "按回车键停止发送...\n" << std::endl;
|
|
||||||
|
|
||||||
// 启动发送线程
|
|
||||||
std::lock_guard<std::mutex> lock(cout_mutex);
|
|
||||||
std::vector<std::thread> threads;
|
|
||||||
for (int i = 0; i < thread_count; ++i) {
|
|
||||||
int this_thread_packets = packets_per_thread;
|
|
||||||
if (i == thread_count - 1 && remaining_packets > 0) {
|
|
||||||
this_thread_packets += remaining_packets;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (protocol == Protocol::UDP) {
|
|
||||||
threads.emplace_back(udp_send_thread, ip, port, data, interval,
|
|
||||||
i + 1, this_thread_packets);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
threads.emplace_back(tcp_send_thread, ip, port, data, interval,
|
|
||||||
i + 1, this_thread_packets);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// 等待用户输入停止
|
|
||||||
std::cin.get();
|
|
||||||
stop_flag = true;
|
|
||||||
|
|
||||||
// 等待所有线程结束
|
|
||||||
for (auto& t : threads) {
|
|
||||||
if (t.joinable()) {
|
|
||||||
t.join(); // 确保所有线程完成
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
std::cout << "\n发送已停止,总共发送 " << total_sent << " 个包" << std::endl;
|
|
||||||
std::cout << "按回车键退出...";
|
|
||||||
std::cin.ignore();
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
@ -1,131 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<ItemGroup Label="ProjectConfigurations">
|
|
||||||
<ProjectConfiguration Include="Debug|Win32">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|Win32">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>Win32</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Debug|x64">
|
|
||||||
<Configuration>Debug</Configuration>
|
|
||||||
<Platform>x64</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
<ProjectConfiguration Include="Release|x64">
|
|
||||||
<Configuration>Release</Configuration>
|
|
||||||
<Platform>x64</Platform>
|
|
||||||
</ProjectConfiguration>
|
|
||||||
</ItemGroup>
|
|
||||||
<PropertyGroup Label="Globals">
|
|
||||||
<VCProjectVersion>17.0</VCProjectVersion>
|
|
||||||
<Keyword>Win32Proj</Keyword>
|
|
||||||
<ProjectGuid>{bfd11069-1f1c-4a9b-9faf-91a555b712bf}</ProjectGuid>
|
|
||||||
<RootNamespace>ConsoleApplication2</RootNamespace>
|
|
||||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v143</PlatformToolset>
|
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v143</PlatformToolset>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
|
||||||
<UseDebugLibraries>true</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v143</PlatformToolset>
|
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
|
||||||
<ConfigurationType>Application</ConfigurationType>
|
|
||||||
<UseDebugLibraries>false</UseDebugLibraries>
|
|
||||||
<PlatformToolset>v143</PlatformToolset>
|
|
||||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
|
||||||
<CharacterSet>Unicode</CharacterSet>
|
|
||||||
</PropertyGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
|
||||||
<ImportGroup Label="ExtensionSettings">
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="Shared">
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
|
||||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
|
||||||
</ImportGroup>
|
|
||||||
<PropertyGroup Label="UserMacros" />
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<SDLCheck>true</SDLCheck>
|
|
||||||
<PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<ConformanceMode>true</ConformanceMode>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
|
||||||
<ClCompile>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
|
||||||
<SDLCheck>true</SDLCheck>
|
|
||||||
<PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<ConformanceMode>true</ConformanceMode>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
|
||||||
<ClCompile>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<SDLCheck>true</SDLCheck>
|
|
||||||
<PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<ConformanceMode>true</ConformanceMode>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
|
||||||
<ClCompile>
|
|
||||||
<WarningLevel>Level3</WarningLevel>
|
|
||||||
<FunctionLevelLinking>true</FunctionLevelLinking>
|
|
||||||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
|
||||||
<SDLCheck>true</SDLCheck>
|
|
||||||
<PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
|
||||||
<ConformanceMode>true</ConformanceMode>
|
|
||||||
</ClCompile>
|
|
||||||
<Link>
|
|
||||||
<SubSystem>Console</SubSystem>
|
|
||||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
|
||||||
</Link>
|
|
||||||
</ItemDefinitionGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClCompile Include="ConsoleApplication2.cpp" />
|
|
||||||
</ItemGroup>
|
|
||||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
|
||||||
<ImportGroup Label="ExtensionTargets">
|
|
||||||
</ImportGroup>
|
|
||||||
</Project>
|
|
@ -1,22 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<ItemGroup>
|
|
||||||
<Filter Include="源文件">
|
|
||||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
|
||||||
<Extensions>cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="头文件">
|
|
||||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
|
||||||
<Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="资源文件">
|
|
||||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
|
||||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
|
||||||
</Filter>
|
|
||||||
</ItemGroup>
|
|
||||||
<ItemGroup>
|
|
||||||
<ClCompile Include="ConsoleApplication2.cpp">
|
|
||||||
<Filter>源文件</Filter>
|
|
||||||
</ClCompile>
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
|
@ -1,4 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
|
||||||
<PropertyGroup />
|
|
||||||
</Project>
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -1 +0,0 @@
|
|||||||
D:\FFnew\FFCN\ConsoleApplication2\ConsoleApplication2\ConsoleApplication2.cpp;D:\FFnew\FFCN\ConsoleApplication2\ConsoleApplication2\x64\Release\ConsoleApplication2.obj
|
|
@ -1,2 +0,0 @@
|
|||||||
PlatformToolSet=v143:VCToolArchitecture=Native64Bit:VCToolsVersion=14.44.35207:TargetPlatformVersion=10.0.26100.0:
|
|
||||||
Release|x64|D:\FFnew\FFCN\ConsoleApplication2\|
|
|
Binary file not shown.
Binary file not shown.
@ -1,3 +0,0 @@
|
|||||||
^D:\FFNEW\FFCN\CONSOLEAPPLICATION2\CONSOLEAPPLICATION2\X64\RELEASE\CONSOLEAPPLICATION2.OBJ
|
|
||||||
D:\FFnew\FFCN\ConsoleApplication2\ConsoleApplication2\x64\Release\ConsoleApplication2.IPDB
|
|
||||||
D:\FFnew\FFCN\ConsoleApplication2\ConsoleApplication2\x64\Release\ConsoleApplication2.iobj
|
|
Binary file not shown.
@ -1,11 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
|
||||||
<Project>
|
|
||||||
<ProjectOutputs>
|
|
||||||
<ProjectOutput>
|
|
||||||
<FullPath>D:\FFnew\FFCN\ConsoleApplication2\x64\Release\ConsoleApplication2.exe</FullPath>
|
|
||||||
</ProjectOutput>
|
|
||||||
</ProjectOutputs>
|
|
||||||
<ContentFiles />
|
|
||||||
<SatelliteDlls />
|
|
||||||
<NonRecipeFileRefs />
|
|
||||||
</Project>
|
|
Binary file not shown.
Binary file not shown.
@ -1,8 +0,0 @@
|
|||||||
ConsoleApplication2.cpp
|
|
||||||
D:\FFnew\FFCN\ConsoleApplication2\ConsoleApplication2\ConsoleApplication2.cpp(104,63): warning C4267: “参数”: 从“size_t”转换到“int”,可能丢失数据
|
|
||||||
正在生成代码
|
|
||||||
5 of 323 functions ( 1.5%) were compiled, the rest were copied from previous compilation.
|
|
||||||
1 functions were new in current compilation
|
|
||||||
22 functions had inline decision re-evaluated but remain unchanged
|
|
||||||
已完成代码的生成
|
|
||||||
ConsoleApplication2.vcxproj -> D:\FFnew\FFCN\ConsoleApplication2\x64\Release\ConsoleApplication2.exe
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user