资源简介
Htran1.0 源代码
Lvhu4na[F.s.T]修改免杀版
代码片段和文件信息
#include
#include
#include
#include
#include
#include
#pragma comment(lib “ws2_32.lib“)
#define VERSION “1.00“
#define TIMEOUT 300
#define MAXSIZE 20480
#define HOSTLEN 40
#define CONNECTNUM 5
// define 2 socket struct
struct transocket
{
SOCKET fd1;
SOCKET fd2;
};
// define function
void ver();
void usage(char *prog);
void transmitdata(LPVOID data);
void getctrlc(int j);
void closeallfd();
void makelog(char *buffer int length);
void proxy(int port);
void bind2bind(int port1 int port2);
void bind2conn(int port1 char *host int port2);
void conn2conn(char *host1 int port1 char *host2 int port2);
int testifisvalue(char *str);
int create_socket();
int create_server(int sockfd int port);
int client_connect(int sockfd char* server int port);
// define GLOBAL variable here
extern int errno;
FILE *fp;
int method=0;
//int connectnum=0;
//************************************************************************************
//
// function main
//
//************************************************************************************
VOID main(int argc char* argv[])
{for( int lvhuana=0;lvhuana<=100;lvhuana++){ lvhuana+3; }
char **p;
char sConnectHost[HOSTLEN] sTransmitHost[HOSTLEN];
int iConnectPort=0 iTransmitPort=0;
char *logfile=NULL;
ver();
memset(sConnectHost 0 HOSTLEN);
memset(sTransmitHost 0 HOSTLEN);
p=argv;
while(*p)
{
if(stricmp(*p “-log“) == 0)
{
if(testifisvalue(*(p+1)))
{
logfile = *(++p);
}
else
{
printf(“[-] ERROR: Must supply logfile name.\r\n“);
return;
}
p++;
continue;
}
p++;
}
if(logfile !=NULL)
{
fp=fopen(logfile“a“);
if(fp == NULL )
{
printf(“[-] ERROR: open logfile“);
return;
}
makelog(“====== Start ======\r\n“ 22);
}
// Win Start Winsock.
WSADATA wsadata;
WSAStartup(MAKEWORD(1 1) &wsadata);
signal(SIGINT &getctrlc);
if(argc > 2)
{
if(stricmp(argv[1] “-listen“) == 0 && argc >= 4)
{
iConnectPort = atoi(argv[2]);
iTransmitPort = atoi(argv[3]);
method = 1;
}
else
if(stricmp(argv[1] “-tran“) == 0 && argc >= 5)
{
iConnectPort = atoi(argv[2]);
strncpy(sTransmitHost argv[3] HOSTLEN);
iTransmitPort = ato
- 上一篇:C++ jpeg图像编码与解码
- 下一篇:CVSD编解码C语言程序
评论
共有 条评论