
C++
friendan
快乐源于分享丶
展开
-
我的VS2013版本
有关 NuGet 的详细信息,请访问 http://docs.nuget.org/。此程序包将 Windows Phone 8.1 SDK 的工具集成到 Visual Studio 菜单和控件中。Visual Studio 2013 代码分析拼写检查器 06181-004-0451047-02055。Visual Studio 2013 的团队资源管理器 06181-004-0451047-02055。通过 Azure 移动服务和 Windows Azure 工具提供通用服务。原创 2022-09-03 13:25:27 · 647 阅读 · 0 评论 -
CUDA 11.2.targets(606,9): error : The CUDA Toolkit v11.2 directory ‘‘ does not exist. Please verify
Check for working CUDA compiler: C:/sdk/CUDA/11.2/bin/nvcc.exeCheck for working CUDA compiler: C:/sdk/CUDA/11.2/bin/nvcc.exe - brokenCMake Error at D:/huangyx/sdk/opencv/cmake-3.21.2-windows-x86_64/share/cmake-3.21/Modules/CMakeTestCUDACompiler.cmake:56原创 2022-01-15 22:41:11 · 4199 阅读 · 1 评论 -
图片相似度比较
// ImageCmp.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include "ImageSimilar.h"#include <iostream>#include <Psapi.h>int _tmain(int argc, _TCHAR* argv[]){ ImageSimilar::initGdiPlus(); HANDLE h = GetCurrentProcess(); for (int i = 1; .原创 2022-01-03 17:46:41 · 692 阅读 · 0 评论 -
hook __thiscall
IDA找到一个函数声明如下:int __thiscall CDialogBuilder::Create(DWORD *this, int a2, int a3, int a4){//.....}查看汇编代码调用如下:.text:10C7184B 00C push [ebp+arg_10] // 参数a4.text:10C7184E 010 mov ecx, esi // 参数this.原创 2021-11-14 17:29:58 · 776 阅读 · 0 评论 -
hook虚表
int VtblHelper::hijack(void* pObject, int index, int newMethod){ int** vtbl = (int**)pObject; DWORD oldProtect = 0; int oldMethod = (*vtbl)[index]; VirtualProtect(*vtbl, 1024, PAGE_READWRITE, &oldProtect); (*vtbl)[index] = newMethod; VirtualPro.原创 2021-03-14 00:30:33 · 162 阅读 · 0 评论 -
GetPrivateProfileStringA读不到数据问题
std::string CAppConfig::getAppConfig(LPCSTR szKeyName){ char szData[1024] = { 0 }; GetPrivateProfileStringA("App", szKeyName, "", szData, sizeof(szData), mAppIni.c_str()); return std::string(szData);}发现参数正常的情况下 GetPrivateProfileStringA 获取不到数据经排查..原创 2020-08-08 11:02:21 · 1833 阅读 · 1 评论 -
frida根据偏移地址HOOK函数
function get_rva(module, offset) { var base_addr = Module.findBaseAddress(module); if (base_addr == null) base_addr = enum_to_find_module(module); console.log(module + ':' + base_...转载 2020-03-23 15:00:30 · 4339 阅读 · 0 评论 -
C/C++异常捕获try{}catch(...) // __try{ //...}__except(EXCEPTION_EXECUTE_HANDLER){ //...}
// TestVS2003.cpp : Defines the entry point for the console application.//#include "stdafx.h"#include #include VOID TestException_MS(VOID);VOID TestException_StdCPP(VOID);int _tmain(int argc原创 2015-12-29 11:12:58 · 3780 阅读 · 1 评论 -
判断字符串中第一位字符是否是ASCII字符( 0–127),ASCII字符占一个字节
// Note:Your choice is C++ IDE#include using namespace std;#define NULL 0bool IsASCIIChar(char *pszStr);int main(){ printf("%s \n", IsASCIIChar("hello") ? "true" : "false"); prin原创 2015-10-12 14:02:29 · 8010 阅读 · 0 评论 -
构造64位时间DWORD64
DWORD64 SystemTimeToDword64(SYSTEMTIME st){ struct tm tm_time; memset(&tm_time, 0, sizeof(tm_time)); tm_time.tm_year = st.wYear - 1900; tm_time.tm_mon = st.wMonth - 1; tm_time.tm_mday = st.wDay原创 2015-09-22 10:54:47 · 2311 阅读 · 0 评论 -
WinHttpOpenRequest第6个参数如何传?LPCWSTR*
WinHttpOpenRequest第6个参数MSDN的解释如下:ppwszAcceptTypes [in]Pointer to a null-terminated array of string pointers that specifies media types accepted by the client. If this parameter is set to WIN原创 2015-09-27 17:17:44 · 2132 阅读 · 0 评论 -
VC解析64位时间DWORD64 dw64TimeMS
DWORD64 dw64TimeMS = 87373737337;time_t timeTmp = dw64TimeMS / 1000; struct tm *ptmReal = localtime(&timeTmp); char szTime[64] = {0}; if(ptmReal != NULL) { sprintf(szTim原创 2015-09-04 21:43:42 · 1779 阅读 · 0 评论 -
记一次switch使用不当引起的错误,是哥粗心了哈。。。
例子代码如下:// Note:Your choice is C++ IDE#include using namespace std;int main(){ int i = 0; switch(i) { printf("这行代码永远不会被执行哈!。。。"); printf("当时XX,将代码写在这里,害得哥加班调试了几个小时呀!");原创 2015-08-02 11:48:50 · 3908 阅读 · 1 评论 -
获取程序入口地址
// GetExeEntryPoint.cpp : 定义控制台应用程序的入口点。//#include "stdafx.h"#include #include #pragma comment(lib, "Psapi.lib")int _tmain(int argc, _TCHAR* argv[]){ printf("GetCurrentProcess:0x%d \n", Ge原创 2015-02-23 21:12:24 · 8748 阅读 · 0 评论 -
VC显示网页验证码
效果截图:原创 2014-07-10 19:55:57 · 3686 阅读 · 0 评论 -
两个字节按二进制位进行比较
思路就是二进制位的操作,主要用到原创 2014-07-10 19:52:33 · 7287 阅读 · 0 评论 -
C/C++ int 高16位赋值,低16位赋值 //int 高16位取值,低16位取值
因工作的关系,我需要对一个int类型的bianl原创 2014-04-29 00:42:13 · 13197 阅读 · 0 评论 -
显示一个整数的所有二进制位
原理:1.位移操作(这里用右移>>) 2.逻辑操作,1&1=1,1&0=0------------------------------------------------------------------------------------------------------------------我测试时的代码如下:#include using namespace std原创 2013-10-24 21:45:30 · 2068 阅读 · 2 评论 -
ZwQuerySystemInformation
ZwQuerySystemInformation.h#ifndef ZwQuerySystemInformation_H_#define ZwQuerySystemInformation_H_#include typedef enum _SYSTEM_INFORMATION_CLASS { SystemBasicInformation,原创 2016-09-11 14:08:36 · 3208 阅读 · 1 评论 -
Privoxy代码下载
官网官网如何下载Privoxy的说明如下:https://sourceforge.net/p/ijbswa/code/?source=navbarAnonymous CVS AccessThis project's SourceForge.net CVS repository can be checked out through anonymous (pserver) CVS wi原创 2016-09-04 18:38:11 · 1902 阅读 · 0 评论 -
C/CPP UTF8编码转成汉字 \u7528\u6237\u4e0d
参考文章:http://www.qingfengju.com/article.asp?id=245现在的网站,经常返回下面这样的字符串:"error":"\u7528\u6237\u4e0d\u5b58\u5728\u6216\u5bc6\u7801\u9519\u8bef"}其中的\u7528等就是汉字的UTF8编码了,如何将其还原成相应的字符呢?代码如下:#原创 2016-08-14 23:02:47 · 76346 阅读 · 0 评论 -
VC获取系统分辩率 屏幕分辩率
获取系统分辩率获取屏幕分辩率HDC hdcScreen = GetDC(NULL); int cx = GetDeviceCaps(hdcScreen, DESKTOPHORZRES); int cy = GetDeviceCaps(hdcScreen, DESKTOPVERTRES); ReleaseDC(NULL, hdcScreen);...原创 2019-10-06 16:25:37 · 179 阅读 · 0 评论 -
易语言 ExecuteInDefaultAppDomain
参考https://xz.aliyun.com/t/3050使用C++封装了一个DLL,导出接口给易语言调用在C++的DLL中加载了一个C#的DLL直接在易语言IDE中启动程序测试,调用不成功易语言编译出来exe后,一切正常c++代码如下:HRESULT hr = mICLRRuntimeHost->ExecuteInDefaultAppDomain(L"OSSC...原创 2019-08-05 13:04:45 · 559 阅读 · 0 评论 -
error LNK2019: 无法解析的外部符号 _MQTTClient_create
extern "C"{#include <MQTTClient.h>#include <MQTTClientPersistence.h>}#pragma comment(lib, "paho-mqtt3a.lib")1>MQTT.obj : error LNK2019: 无法解析的外部符号 _MQTTClient_create,该符号在函数 "publi...原创 2019-07-27 11:50:19 · 2250 阅读 · 0 评论 -
cef OnBeforeResourceLoad
xxx.h#pragma once#include <cef\include\cef_app.h>#include <cef\include\cef_client.h>#include <cef\include\cef_command_line.h>#include <cef\include\cef_load_handler.h>#in...原创 2019-06-24 21:35:32 · 3321 阅读 · 1 评论 -
c++产生指定范围随机数
#include <ctime>int ToolRandInt(int min, int max){ srand((unsigned)time(NULL)); int r = rand() % (max - min + 1) + min; return r;}原创 2019-07-07 16:03:17 · 3802 阅读 · 0 评论 -
c++遍历目录文件
#include <string>#include <vector>#include<regex>#include <Windows.h>#include <stdio.h>#include <io.h>using std::string;using std::wstring;void ToolGetD...原创 2019-07-07 15:51:51 · 259 阅读 · 0 评论 -
error C2039: “bad_alloc”: 不是“std”的成员
error C2039: “bad_alloc”: 不是“std”的成员error C3861: “bad_alloc”: 找不到标识符解决方法:#include <exception>原创 2019-06-08 10:45:42 · 2126 阅读 · 0 评论 -
无法解析的外部符号 public: class AlibabaCloud::OSS::Outcome
使用阿里云的oss c++ sdk出现如下错误:1> 正在创建库 ../build/AliOss.lib 和对象 ../build/AliOss.exp1>AliOss.obj : error LNK2001: 无法解析的外部符号 "public: class AlibabaCloud::OSS::Outcome<class AlibabaCloud::OSS::O...原创 2019-06-05 18:25:01 · 1690 阅读 · 0 评论 -
获取C++成员函数地址
参考文章:https://www.cnblogs.com/nbsofer/p/get_member_function_address_cpp.htmlAppleDemo.h:class CAppleDemo{public: CAppleDemo(); ~CAppleDemo(); void fun1(void); void fun2(int a, int b); in...原创 2019-05-04 15:05:23 · 6874 阅读 · 3 评论 -
发送消息WM_COPYDATA需要注意的点
A程序通过消息 WM_COPYDATA 给B程序发送数据A程序发送代码片段如下typedef struct tagVCodeData{ int X; int Y; int Width; int Height; int DataLen; int pngDataAddr; char* szName; tagVCodeData()...原创 2019-05-01 21:58:40 · 5096 阅读 · 0 评论 -
libthriftnb.so: undefined reference to `evutil_make_socket_closeonexec'
https://www.cnblogs.com/zhaochunhua/p/7069054.html/../lib/cpp/.libs/libthriftnb.so /usr/local/boost/lib64/libboost_unit_test_framework.a -levent -lssl -lcrypto -lrt -lpthread../../../lib/cpp/.libs/...原创 2018-10-27 14:59:29 · 1354 阅读 · 0 评论 -
下列组件安装失败 Microsoft Visual Studio Web 创作组件
参考文章:http://www.cnblogs.com/shunyao8210/archive/2009/06/26/1511683.html-------------------------------------------------------------------------------------------------------------------------------原创 2013-10-06 13:24:47 · 6806 阅读 · 0 评论 -
MFC dll注入框架
HOOK API或其它什么时,我们经常需要注入dll,而在WIN7系统,通过远程线程的方式来注入dll,貌似不好用,而通过安装钩子的方式注入dll时,会把dll注入到很多个程序,本文就是为了方便对指定的程序注入dll而写的。框架搭好后,以后注入dll就方便多了。文章后面本例子VS2008源码下载地址。-----------------------------------------原创 2013-10-05 20:00:04 · 4373 阅读 · 0 评论 -
VS2008创建工程 没有权限
今天重装VS2008,装完后,以为天下太平了,哪知道用新装的VS2008打开原来的工程,竟然打不开。打不开,那我就新建一个吧,新建工程时竟然提示:没有权限。真实悲催到家了。网上找了一下,没发现什么解决的方法,也许碰到这问题的人比较少吧。VS2008创建工程,竟然没有权限,我可是用管理员打开VS2008的呀,心想会不会是安装过程有错呀,就卸载了VS2008,然后重新安装,装完后,问题还是原创 2013-10-06 19:19:37 · 2197 阅读 · 0 评论 -
凯撒加密
凯撒加密其实就是把每个字母往后面移动3个位置,文章后面附有凯撒加解密VC6工程下载,主要代码如下:----------------------------------------------------------------------------------------------//凯撒加密string KaiSaEnc(string str){ char c; st原创 2013-05-03 23:31:09 · 1859 阅读 · 0 评论 -
C++获取输入的空格
在控制台输入输出中,有时候我们想获取用户输入的空格,该如何做呢?在C++中通常的获取输入的方法如下:#include "stdafx.h"#include#include using namespace std;int main(int argc, char* argv[]){ string str; cin>>str; //注意这样获取输入是获取不到空格的,按空格时原创 2013-05-03 22:04:07 · 3926 阅读 · 0 评论 -
C++追加单个字符
在C++中如何在字符串的后面追加单个的字符呢?代码如下: string str; for (char i='A';i<='Z';i++) { str+=i; } cout-------------------------------------------------------------------------------------------------------原创 2013-05-03 23:20:16 · 1785 阅读 · 0 评论 -
反转串
有这样一道题目:我们把“cba”称为“abc”的反转串。下面的代码可以把buf中的字符反转。其中n表示buf中待反转的串的长度。请补充缺少的代码。void reverse_str(char* buf, int n){if(nchar tmp = buf[0]; //保存缓冲区第一个字符buf[0] = buf[n-1]; //最后一个字符放到最前面buf[n-1原创 2013-05-02 13:09:46 · 1202 阅读 · 0 评论 -
VC无法打开包括文件:“afxcontrolbars.h”: No such file or directory
今天用VS2008编译别人的一个MFC工程时,出现了一个错误,提示如下:无法打开包括文件:“afxcontrolbars.h”: No such file or directory//截图如下--------------------------------------------------------------------------------------------原创 2013-04-30 11:50:55 · 7204 阅读 · 1 评论