04 2014 档案
HOOK技术演示
摘要:前提:64位系统需要用64位编译dll一、首先创建一个dll工程,取名为KeyboardHookDll,代码如下:// KeyboardHookDll.cpp : 定义 DLL 应用程序的导出函数。//#include "stdafx.h"#include using namespace std;#... 阅读全文
posted @ 2014-04-30 12:28 上海—Michael 阅读(300) 评论(0) 推荐(0)
终止其他进程
摘要:#include"stdafx.h"#include #include #include using namespace std;BOOL KillProcess(DWORD ProcessId){ HANDLE hProcess=OpenProcess(PROCESS_TERMINATE,FALS... 阅读全文
posted @ 2014-04-29 18:10 上海—Michael 阅读(237) 评论(0) 推荐(0)
c++访问mysql数据库
摘要:首先,把mysql目录下的include放到项目目录下,然后把libmysql.lib和libmysql.dll放到debug目录下。#include之前一定要加上#include否则会产生编译错误。#include "stdafx.h"#include #include "include\mysq... 阅读全文
posted @ 2014-04-29 14:13 上海—Michael 阅读(2374) 评论(0) 推荐(0)
findwindow\sendmessage向第三方软件发送消息演示
摘要:这里仅仅是以putty作为演示消息发送机制和控件搜索机制程序一:代填IP和端口,并建立远程连接#include"stdafx.h"#include #include using namespace std;HWND FindTextBox(HWND hWnd,DWORD select_edit=1)... 阅读全文
posted @ 2014-04-28 18:01 上海—Michael 阅读(763) 评论(0) 推荐(0)
system中有空格怎么办
摘要:原始路径:C:\\Program Files\\putty\\putty.exe改为:char *cmd="C:\\\"Program Files\"\\putty\\putty.exe";system(cmd);实现putty自动代填:system("C:\\\"Program Files\"\\... 阅读全文
posted @ 2014-04-28 16:37 上海—Michael 阅读(366) 评论(0) 推荐(0)
c++ 虚函数详解
摘要:下面是对C++的虚函数的理解。一,定义简单地说,那些被virtual关键字修饰的成员函数,就是虚函数。虚函数的作用,用专业术语来解释就是实现多态性(Polymorphism),多态性是将接口与实现进行分离;用形象的语言来解释就是实现以共同的方法,但因个体差异而采用不同的策略。下面来看一段简单的代码1... 阅读全文
posted @ 2014-04-27 15:23 上海—Michael 阅读(319) 评论(0) 推荐(0)
extern "C" 的作用
摘要:被extern "C"修饰的变量和函数是按照C语言方式编译和连接的;未加extern“C”声明时的编译方式。首先看看C++中对类似C的函数是怎样编译的。作为一种面向对象的语言,C++支持函数重载,而过程式语言C则不支持。函数被C++编译后在符号库中的名字与C语言的不同。例如,假设某个函数的原型为:v... 阅读全文
posted @ 2014-04-26 10:43 上海—Michael 阅读(178) 评论(0) 推荐(0)
DLL 演示
摘要:编写DLL时的函数与一般的函数方法基本一样。但要对库中的函数进行必要的声明,以说明哪些函数是可以导出的,哪些函数是不可以导出的。把DLL中的函数声明为导出函数的方法有两种:一是使用关键字_declspec(dllexport)来声明。二是在.def文件中声明。一、使用关键字_declspec(dll... 阅读全文
posted @ 2014-04-25 17:29 上海—Michael 阅读(261) 评论(0) 推荐(0)
C++中L和_T()之区别
摘要:字符串前面加L表示该字符串是Unicode字符串。_T是一个宏,如果项目使用了Unicode字符集(定义了UNICODE宏),则自动在字符串前面加上L,否则字符串不变。因此,Visual C++里边定义字符串的时候,用_T来保证兼容性。VC支持ascii和unicode两种字符类型,用_T可以保证从... 阅读全文
posted @ 2014-04-25 16:48 上海—Michael 阅读(3783) 评论(0) 推荐(0)
VMware:Configuration file was created by a VMware product with more features than this version
摘要:Few days ago,I opened the Genesys demo VM by VMware Server 1.0.4 and got an error like this: "Configuration file was created by a VMware product with... 阅读全文
posted @ 2014-04-23 09:38 上海—Michael 阅读(971) 评论(0) 推荐(0)
使用内存映射来对文件排序
摘要:#include"stdafx.h"#include #define DATALEN 56#define KEY_SIZE 8typedef struct _RECORD { TCHAR key[KEY_SIZE]; TCHAR data[DATALEN];} RECORD;#define RECS... 阅读全文
posted @ 2014-04-21 17:56 上海—Michael 阅读(377) 评论(0) 推荐(0)
平衡二叉树的插入删除操作
摘要:平衡二叉树(Balanced binary tree)是由阿德尔森-维尔斯和兰迪斯(Adelson-Velskii and Landis)于1962年首先提出的,所以又称为AVL树。定义:平衡二叉树或为空树,或为如下性质的二叉排序树:(1)左右子树深度之差的绝对值不超过1;(2)左右子树仍然为平衡二... 阅读全文
posted @ 2014-04-17 16:58 上海—Michael 阅读(7108) 评论(3) 推荐(0)
volatile关键字的使用
摘要:volatile变量直接在CPU和内存之间交换,不通过一级、二级缓存。考虑下面的代码:代码:123456789101112131415161718class Gadget{public:void Wait() {while (!flag_){Sleep(1000); // sleeps for 10... 阅读全文
posted @ 2014-04-15 15:47 上海—Michael 阅读(230) 评论(0) 推荐(0)
HeapCreate深入研究
摘要:本机:win7(x86),4G内存#include"stdafx.h"#include#include#include#includeusing namespace std;HANDLE hHeap;int _tmain(int argc, _TCHAR* argv[]){ SYSTEM_INFO ... 阅读全文
posted @ 2014-04-15 13:23 上海—Michael 阅读(1029) 评论(0) 推荐(0)
GetSystemInfo
摘要:#include #include #include using namespace std; int main() { SYSTEM_INFO systemInfo; GetSystemInfo(&systemInfo); cout <<setw(20) << "处理器掩... 阅读全文
posted @ 2014-04-15 12:37 上海—Michael 阅读(352) 评论(0) 推荐(0)
语法错误: 标识符“acosf”
摘要:1>e:\vs2010\vc\include\cmath(19):errorC2061:语法错误:标识符“acosf”1>e:\vs2010\vc\include\cmath(19):errorC2059:语法错误:“;”1>e:\vs2010\vc\include\cmath(19):errorC... 阅读全文
posted @ 2014-04-14 11:05 上海—Michael 阅读(1367) 评论(0) 推荐(0)
面试者应向公司问什么问题?
摘要:下面是一些你可以问的典型问题。 问题一:你们为什么要招聘这个职位? Q1: Why are you currently recruiting for this position? 这个问题会使得面试官开始谈论当前的项目,或者谈论前一位离职人员。无论哪种情况,都会让你了解,一些与你最密切相关的公... 阅读全文
posted @ 2014-04-14 10:34 上海—Michael 阅读(619) 评论(0) 推荐(0)
简单的触发黑名单阻断演示 control+c
摘要:#include "stdafx.h"#include #include #include using namespace std;void cs(int n){ if(n==SIGINT) { cout>ch; for(int i=0;i<sizeof(str... 阅读全文
posted @ 2014-04-13 15:43 上海—Michael 阅读(531) 评论(0) 推荐(0)
SetConsoleCtrlHandler演示
摘要:#include "stdafx.h"#include static BOOL WINAPI Handler(DWORD cntrlEvent);static BOOL exitFlag = FALSE;int _tmain(int argc, LPTSTR argv[])/* Beep perio... 阅读全文
posted @ 2014-04-11 17:59 上海—Michael 阅读(369) 评论(0) 推荐(0)
windows异常演示,指定异常类型,然后生成异常
摘要:#include "stdafx.h"#include #include DWORD Filter (LPEXCEPTION_POINTERS, LPDWORD);double x = 1.0, y = 0.0;int _tmain (int argc, LPTSTR argv[]){ DWORD ... 阅读全文
posted @ 2014-04-10 10:48 上海—Michael 阅读(408) 评论(0) 推荐(0)
RegisterUserFunc为测试对象添加新方法或重写已有方法
摘要:QTP中为了提高扩展性,提供了一个为测试对象添加一个新的自定义方法,或者重写测试对象已有的方法的函数RegisterUserFunc,在此给大家分享一下。RegisterUserFunc:为测试对象添加一个新的自定义方法,或者重写测试对象已有的方法语法:RegisterUserFunc TOClas... 阅读全文
posted @ 2014-04-08 17:43 上海—Michael 阅读(345) 评论(0) 推荐(0)
suse 源的添加与删除,以及源地址
摘要:地址一个是上海交大的,http://ftp.sjtu.edu.cn/opensuse/update/葡萄牙的:http://ftp.nux.ipb.pt/pub/dists/opensuse/update/10.3/http://ftp.nux.ipb.pt/pub/dists/opensuse/distribution/10.3/repo/non-oss/http://ftp.nux.ipb.pt/pub/dists/opensuse/distribution/10.3/repo/oss/再加一个葡萄牙的:http://cesium.di.uminho.pt/pub/opensuse/dis 阅读全文
posted @ 2014-04-04 15:13 上海—Michael 阅读(6997) 评论(0) 推荐(0)
Ubuntu下设置VNCServer
摘要:Ubuntu下设置VNCServerVirtual Network Computing(VNC)是进行远程桌面控制的一个软件。客户端的键盘输入和鼠标操作通过网络传输到远程服务器,控制服务器的操作。服务器的图形界面 通过网络传输会客户端显示给用户。给你的感觉就像直接在操作本地计算机一样,只是所有的程序... 阅读全文
posted @ 2014-04-03 17:03 上海—Michael 阅读(676) 评论(0) 推荐(0)
Ubuntu 开启telnet、ftp服务
摘要:Telnet这里我们就来对Ubuntu Linux telnet的安装设置进行一下讲解。 1. sudo apt-get install xinetd telnetd 2. Ubuntu Linux telnet安装后,系统也会有相应提示: sudo vi /etc/inetd.conf并加入... 阅读全文
posted @ 2014-04-03 11:28 上海—Michael 阅读(1103) 评论(0) 推荐(0)
debian7 安装VMware Tools
摘要:前提:需要安装gcc、kernel 1. apt-get install gcc 2. apt-get install kernel问题描述: 安装时如果提示更换介质 :请把标有 " debian gun/linux 7.2.0 _ Wheezy_ - official i368 DVD ... 阅读全文
posted @ 2014-04-02 14:42 上海—Michael 阅读(520) 评论(0) 推荐(0)
Debian7 apt源设置
摘要:刚装完系统时是没有 apt-spy 的,这时候我们可以暂时先找个可用的源代替,如(写在 /etc/apt/sources.list 中):deb http://http.us.debian.org/debian/ stable main执行以下命令更新软件包列表:apt-get update然后执行... 阅读全文
posted @ 2014-04-02 10:13 上海—Michael 阅读(1962) 评论(0) 推荐(0)
Debian 7开启ssh、telnet
摘要:SSH1. 安装ssh服务 apt-get install openssh-server2. 开启ssh /etc/init.d/ssh startTelnet 1. 安装telnetapt-get install xinetdapt-get install telnetd(备注:如果提示未发现软件... 阅读全文
posted @ 2014-04-02 09:23 上海—Michael 阅读(2166) 评论(0) 推荐(0)
SUSE 安装mysql
摘要:1.下载mysql rpm包在该网站选择相应的包 http://dev.mysql.com/downloads/mysql/5.0.html这里选择:MySQL-server-5.6.17-1.sles11.x86_64.rpm 和 MySQL-client-5.6.17-1.sles11.x86_... 阅读全文
posted @ 2014-04-01 17:33 上海—Michael 阅读(1511) 评论(0) 推荐(0)
SUSE 开启ssh、telnet
摘要:SSH1、 /etc/ssh/sshd_config [SSH的配置文件]2、 SuSEfirewall2 stop #关闭防火墙 如图,输入命令 vi /etc/ssh/sshd_config如图:默认红色框标识的#PermitRootLogin yes ... 阅读全文
posted @ 2014-04-01 10:50 上海—Michael 阅读(1849) 评论(0) 推荐(0)
SUSE 设置IP地址、网关、DNS
摘要:说明:ip:172.18.4.107子网掩码:255.255.255.0网关:172.18.4.254dns:172.18.0.61、设置ip地址vi /etc/sysconfig/network/ifcfg-eth0 #编辑配置文件BOOTPROTO='static' #静态IPBROADCAST... 阅读全文
posted @ 2014-04-01 10:01 上海—Michael 阅读(2042) 评论(0) 推荐(0)