I am able to access and print the data field as follows.
1 2 3 4 5 6 7 8 9 10 11
_node* First=(node *)address;//Address is a pointer that i get from intercepting an application
_header* nodeHeader=(_header*)First->data;
char *bodyPtr=(char *)(nodeHeader+1);
_body* nodeBody=(_body *)(bodyPtr);
unsignedlonglongint offset=0;
while(!(nodeBody->v1 & 1) && offset< nodeHeader->length)
{
nodeBody=(_body*)(bodyPtr+offset);
offset=nodeBody->v2+nodeBody->v3;
}
I want to write the struct node instance into a text file and be able to read it back into a struct instance later. What is the best way to do it? I want an answer in c++
I want a c++ code because the code I am working on is in c++. The code i posted here has typedef because people who wrote the structure has written it in C.