Comments (3)
Comes with some other samples:
<This is setting 1> >> 1
<This is setting 2> >> 2
auto vObject = plist_new_array();
if(vObject)
{
plist_array_append_item(vObject, plist_new_string("$null")); // 0
auto vNode1 = plist_new_dict(); // 1
if(vNode1)
{
// <key>$class</key>
plist_dict_set_item(vNode1, "$class", plist_new_uid(6));
// <key>NS.keys</key>
auto vNS_Keys = plist_new_array();
if(vNS_Keys)
{
plist_array_append_item(vNS_Keys, plist_new_uid(2));
plist_array_append_item(vNS_Keys, plist_new_uid(3));
plist_dict_set_item(vNode1, "NS.keys", vNS_Keys);
}
// <key>NS.objects</key>
auto vNS_Objects = plist_new_array();
if(vNS_Objects)
{
plist_array_append_item(vNS_Objects, plist_new_uid(4));
plist_array_append_item(vNS_Objects, plist_new_uid(5));
plist_dict_set_item(vNode1, "NS.objects", vNS_Objects);
}
plist_array_append_item(vObject, vNode1);
}
plist_array_append_item(vObject, plist_new_string("This is setting 1")); // 2
plist_array_append_item(vObject, plist_new_string("This is setting 2")); // 3
plist_array_append_item(vObject, plist_new_int(1)); // 4
plist_array_append_item(vObject, plist_new_int(2)); // 5
auto vNode2 = plist_new_dict(); // 6
if(vNode2)
{
// <key>$classes</key>
auto vNS_Classes = plist_new_array();
if(vNS_Classes)
{
plist_array_append_item(vNS_Classes, plist_new_string("NSDictionary"));
plist_array_append_item(vNS_Classes, plist_new_string("NSObject"));
plist_dict_set_item(vNode2, "$classes", vNS_Classes);
}
// <key>$classname</key>
plist_dict_set_item(vNode2, "$classname", plist_new_string("NSDictionary"));
plist_array_append_item(vObject, vNode2);
}
}
from libplist.
These transfers belong to DTXMessage dependencies, which can provide preparations for us to add the instrument interface in the future.
These transfers belong to DTXMessage dependencies, which can provide preparations for us to add the instrument interface in the future.
See the format: https://github.com/troybowman/dtxmsg
and:
https://recon.cx/2018/montreal/schedule/system/event_attachments/attachments/000/000/043/original/RECON-MTL-2018-Discovering_the_iOS_Instruments_Server.pdf
from libplist.
like this
static plist_err_t plist_node_from_objc(plist_t objc, plist_t *plist)
{
return PLIST_ERR_UNKNOWN;
}
static plist_err_t plist_node_to_objc(plist_t node, plist_t *objc)
{
plist_t objc_array = plist_new_array();
if(NULL == objc_array)
{
return PLIST_ERR_NO_MEM;
}
plist_type type = plist_get_node_type(node);
plist_array_append_item(objc_array, plist_new_string("$null"));
if (type == PLIST_ARRAY)
{
uint32_t vSize = plist_array_get_size(objc_array);
// Add child information
plist_t node_desc_i = plist_new_dict(); // 1
if(node_desc_i)
{
// <key>$class</key>
plist_dict_set_item(node_desc_i, "$class", plist_new_uid(2));
// <key>NS.objects</key>
plist_t vNS_Objects = plist_new_array();
if(vNS_Objects)
{
for(uint32_t vIndex = 0; vIndex < vSize; ++vIndex)
{
plist_array_append_item(vNS_Objects, plist_new_uid(vIndex + 2));
}
plist_dict_set_item(node_desc_i, "NS.objects", vNS_Objects);
}
plist_array_append_item(objc_array, node_desc_i);
}
// Add object information
plist_t node_desc_o = plist_new_dict(); // 2
if(vNode2)
{
// <key>$classes</key>
plist_t vNS_Classes = plist_new_array();
if(vNS_Classes)
{
plist_array_append_item(vNS_Classes, plist_new_string("NSArray"));
plist_array_append_item(vNS_Classes, plist_new_string("NSObject"));
plist_dict_set_item(node_desc_o, "$classes", vNS_Classes);
}
// <key>$classname</key>
plist_dict_set_item(node_desc_o, "$classname", plist_new_string("NSArray"));
plist_array_append_item(objc_array, node_desc_o);
}
// Add child information
for(uint32_t vIndex = 0; vIndex < vSize; ++vIndex)
{
plist_t child_node = plist_array_get_item(objc_array, vIndex);
plist_type child_type = plist_get_node_type(child_node);
if(child_type == PLIST_ARRAY || child_type == PLIST_DICT)
{
plist_t node_objc = NULL;
plist_node_to_objc(child_node, &node_objc);
plist_array_append_item(objc_array, node_objc);
}
else
{
plist_array_append_item(objc_array, plist_copy(child_node));
}
}
}
else if (type == PLIST_DICT)
{
}
else
{
plist_array_append_item(objc_array, plist_copy(node));
*objc = objc_array;
return PLIST_ERR_SUCCESS;
}
plist_free(objc_array);
return PLIST_ERR_UNKNOWN;
}
plist_err_t plist_from_objc(plist_t objc, plist_t *plist)
{
return PLIST_ERR_UNKNOWN;
}
plist_err_t plist_to_objc(plist_t plist, plist_t *objc)
{
if(NULL == plist || NULL == objc)
{
return PLIST_ERR_INVALID_ARG;
}
plist_err_t err = plist_node_to_objc(plist, objc);
if(PLIST_ERR_SUCCESS == err)
{
plist_t root = plist_new_dict();
if(NULL == root)
{
plist_free(*objc);
*objc = NULL;
return PLIST_ERR_NO_MEM;
}
plist_dict_set_item(root, "$archiver", plist_new_string("NSKeyedArchiver"));
plist_dict_set_item(root, "$objects", *objc);
auto top = plist_new_dict();
if(NULL == top)
{
plist_free(root);
plist_free(*objc);
*objc = NULL;
return PLIST_ERR_NO_MEM;
}
plist_dict_set_item(top, "root", plist_new_uid(1));
plist_dict_set_item(root, "$top", top);
plist_dict_set_item(root, "$version", plist_new_uint(100000));
*objc = root;
}
return err;
}
from libplist.
Related Issues (20)
- `make check -j16` fails due to .out file collisions HOT 3
- Failed to build
- ERROR: Input file is too small to contain valid plist data. HOT 1
- Cython crash when referencing objects after free() is called
- OOB access in `plist_from_memory` HOT 3
- Debian/Ubuntu `libplist-dev` package is outdated HOT 1
- Linker error: ld: archive member '/' not a mach-o file when trying to link libcnary.a HOT 1
- m4/ax_python_devel.m4 is outdated and fails with python 3.12 due to no longer present distutils
- Mistaken issue submission
- Cannot find python in your system PATH
- No autogen.sh in release file HOT 8
- FromBin parse bplist failed!
- ERROR: Input plist data is not compatible with output format.
- [Bug] plistutil cannot read from stdin - ERROR: Could not parse plist data (-3)
- About SIGSEGV (Address boundary error) when using C++ PList::Array
- I found a SEGV on unknown address crash by using AFL++
- plist_from_json() fails on JSON numbers containing e+ exponents HOT 1
- Building fails with python 3.12 due to removed Distutils package
- please dont change the API as you again did in latest release. HOT 5
- "Error: Cython version >= 3.0.0 is required. You have 0.26.1. You should look at http://www.cython.org" HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libplist.