rapidjson

Processing arrays of arrays of integer with rapidjson

拜拜、爱过 提交于 2021-01-29 05:53:26
问题 Looking to rapidjson documentation this code is suggested to query an array: for (Value::ConstValueIterator itr = a.Begin(); itr != a.End(); ++itr) printf("%d ", itr->GetInt()); However, I have an array of arrays, something like: [ [0,2], [1,2], [4, 5], ... ] I would like to have some two-levels for for processing it, something like this: for (Value::ConstValueIterator itr = a.Begin(); itr != a.End(); ++itr) for (Value::ConstValueIterator itr2 = itr->GetArray().Begin(); itr2 != itr->GetArray(

Processing arrays of arrays of integer with rapidjson

荒凉一梦 提交于 2021-01-29 05:50:52
问题 Looking to rapidjson documentation this code is suggested to query an array: for (Value::ConstValueIterator itr = a.Begin(); itr != a.End(); ++itr) printf("%d ", itr->GetInt()); However, I have an array of arrays, something like: [ [0,2], [1,2], [4, 5], ... ] I would like to have some two-levels for for processing it, something like this: for (Value::ConstValueIterator itr = a.Begin(); itr != a.End(); ++itr) for (Value::ConstValueIterator itr2 = itr->GetArray().Begin(); itr2 != itr->GetArray(

Is it valid json (schema) to say that an element can be a single item or an array

浪尽此生 提交于 2021-01-28 06:22:01
问题 Is it possible to specify that a particular json value can be either a single element or an array? E.g. Can both of following json documents be valid according to a given single json schema. "person": { "name": "john", "friends": "jack" } "person": { "name": "john", "friends": ["jack", "jill"] } It's certainly possible (I believe) if you ignore the concept of schema, and simply when you are parsing using a parser such as rapidjson, to simply check if the element is an array or not before

微信3.1.0.41逆向-微信3.1.0.41HOOK接口(WeChatHelper3.1.0.41.dll)-VC++调用实例方法(win32)

北城以北 提交于 2021-01-06 10:29:23
WeChatHelper3.1.0.41.dll接口适用所有语言,今天我来讲一下用VC++(win32)来做个实例调用。 第一步:添加 rapidjson 类库 VC++用到的JSON库为: rapidjson , rapidjson 头文件经在项目目录中了,我们把它包含到项目中: 第二步:创建HTTP类 VC++用wininet进行HTTP通信, HttpHelper.h #pragma once #include <iostream> #include <windows.h> #include <wininet.h> using namespace std; //每次读取的字节数 #define READ_BUFFER_SIZE 4096 enum HttpInterfaceError { Hir_Success = 0, //成功 Hir_InitErr, //初始化失败 Hir_ConnectErr, //连接HTTP服务器失败 Hir_SendErr, //发送请求失败 Hir_QueryErr, //查询HTTP请求头失败 Hir_404, //页面不存在 Hir_IllegalUrl, //无效的URL Hir_CreateFileErr, //创建文件失败 Hir_DownloadErr, //下载失败 Hir_QueryIPErr, //获取域名对应的地址失败

Why I receive error while compiling RapidJSON

这一生的挚爱 提交于 2020-12-15 04:16:17
问题 Using RapidJSON for parsing a JSON file, I get these errors. This is part of the JSON file: { "header":{ "protocolVersion":2, "messageID":2, "stationID":224 }, "cam":{ "generationDeltaTime":37909, "camParameters":{ "basicContainer":{ "stationType":5, This is the code doc.Parse(pr); const auto& header = doc["header"]; header.protocolVersion = doc["header"]["protocolVersion"].GetInt(); header.messageID = doc["header"]["messageID"].GetInt(); header.stationID = doc["header"]["stationID"].GetInt()

[转载]手把手用C++解密Chrome80版本数据库

ぐ巨炮叔叔 提交于 2020-05-08 15:33:06
谷歌浏览器Google Chrome 80正式版例行更新详细版本80.0.3987.163。Google Chrome浏览器又称谷歌浏览器采用Chromium内核全球最受欢迎的免费网页浏览器追求速度、隐私安全的网络浏览器。 先说下吧。chrome80以前的版本是直接可以通过DPAPI来进行解密的。关于DPAPI 大家可以 看这里的介绍 DPAPI是Windows系统级对数据进行加解密的一种接口无需自实现加解密代码微软已经提供了经过验证的高质量加解密算法提供了用户态的接口对密钥的推导存储数据加解密实现透明并提供较高的安全保证 DPAPI提供了两个用户态接口`CryptProtectData`加密数据`CryptUnprotectData`解密数据加密后的数据由应用程序负责安全存储应用无需解析加密后的数据格式。但是加密后的数据存储需要一定的机制因为该数据可以被其他任何进程用来解密当然`CryptProtectData`也提供了用户输入额外`数据`来参与对用户数据进行加密的参数但依然无法放于暴力破解。 总体来说程序可以使用DPAPI来对自己敏感的数据进行加解密也可持久化存储程序或系统重启后可解密密文获取原文。如果应用程序对此敏感数据只是暂存于内存为了防止被黑客dump内存后进行破解也对此数据无需进行持久化存储微软还提供了加解密内存的接口`CryptProtectMemory`和

How do I pass protobuf's boost::shared_ptr pointer to function?

邮差的信 提交于 2020-01-24 17:07:10
问题 I have to pass a boost::shared_ptr : boost::shared_ptr<Protobuf::Person::Profile> pProfile = boost::make_shared<Protobuf::Person::Profile>(); which is protobuf's pointer, to a protobuf's function oPerson.set_allocated_profile(pProfile) but oPerson.set_allocated() expects a pointer to Protobuf::Person::Profile . I have tried couple of ways but I think when I try to convert protobuf object to JSON using pbjson::pb2Json which is a library function built on rapid json, the pointer goes out of

How do I pass protobuf's boost::shared_ptr pointer to function?

馋奶兔 提交于 2020-01-24 17:06:26
问题 I have to pass a boost::shared_ptr : boost::shared_ptr<Protobuf::Person::Profile> pProfile = boost::make_shared<Protobuf::Person::Profile>(); which is protobuf's pointer, to a protobuf's function oPerson.set_allocated_profile(pProfile) but oPerson.set_allocated() expects a pointer to Protobuf::Person::Profile . I have tried couple of ways but I think when I try to convert protobuf object to JSON using pbjson::pb2Json which is a library function built on rapid json, the pointer goes out of

C++ 学习笔记

不想你离开。 提交于 2020-01-22 12:05:44
目录 前言 C++ 小技巧 rapidjson 简单使用 调试技巧 窗口程序新建控制台进行调试输出 前言 学习和工作中经常会遇到一些小问题或者一些技巧性的东西,在此处作一份记录,保持更新。 C++ 小技巧 文件文本读取到 std::string : std :: string filename = "xxxx.txt" ; std :: ifstream fin ( filename ) ; std :: string str ( ( std :: istreambuf_iterator < char > ( fin ) ) , std :: istreambuf_iterator < char > ( ) ) ; rapidjson 简单使用 从文本中解析json: /*test.json*/ { "type" : "login" , "user_id" : 4294967202 , "ver" : 262 , "lang" : "zh-CN" , "state" : { } , "guest" : true , "uinfo" : { "id" : 4294967202 , "true_name" : "hello" } , "property" : { } , "code" : 0 } 读取文件到string,并解析 std :: ifstream fin (

RapidJson的使用

▼魔方 西西 提交于 2020-01-19 17:34:57
rapidJson的使用 写Json:创建一个简单的json结构 方式一:使用rapidjson # define JSON_KEY_NAME_CONTENT "body" # define JSON_KEY_NAME_DATATYPE "type" # define JSON_KEY_REPORT_NAME_ACTIONRESULT "ActionRes" # define JSON_DATA_TYPE_WEAK_PASSWORD_OPTION_CHANGE "reportWeakPasswordOptionChange" rapidjson :: StringBuffer reportBuff ; rapidjson :: Writer < rapidjson :: StringBuffer > reportwriter ( reportBuff ) ; reportwriter . StartObject ( ) ; reportwriter . Key ( JSON_KEY_NAME_CONTENT ) ; reportwriter . StartArray ( ) ; reportwriter . StartObject ( ) ; reportwriter . Key ( JSON_KEY_REPORT_NAME_ACTIONRESULT ) ;