You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I'm trying to decompile the whole program and do some analysis with the lifted. For large programs, it's time-consuming to do the decompilation every time, I wish to save the Funcdata as XML and load it back to restore the decompilation result.
Describe the solution you'd like
restoreXmlTree method implemented for Funcdata and some options to support this when calling Architecture.saveXml.
Additional context
/// A single \<ast> tag is produced with children describing Varnodes, PcodeOps, and/// basic blocks making up \b this function's current syntax tree./// \param s is the output streamvoidFuncdata::saveXmlTree(ostream &s) const
{
s << "<ast>\n";
s << "<varnodes>\n";
for(int4 i=0;i<glb->numSpaces();++i) {
AddrSpace *base = glb->getSpace(i);
if (base == (AddrSpace *)0 || base->getType()==IPTR_IOP) continue;
VarnodeLocSet::const_iterator iter = vbank.beginLoc(base);
VarnodeLocSet::const_iterator enditer = vbank.endLoc(base);
saveVarnodeXml(s,iter,enditer);
}
s << "</varnodes>\n";
list<PcodeOp *>::iterator oiter,endoiter;
PcodeOp *op;
BlockBasic *bs;
for(int4 i=0;i<bblocks.getSize();++i) {
bs = (BlockBasic *)bblocks.getBlock(i);
s << "<block";
a_v_i(s,"index",bs->getIndex());
s << ">\n";
bs->saveXmlBody(s);
oiter = bs->beginOp();
endoiter = bs->endOp();
while(oiter != endoiter) {
op = *oiter++;
op->saveXml(s);
s << '\n';
}
s << "</block>\n";
}
for(int4 i=0;i<bblocks.getSize();++i) {
bs = (BlockBasic *)bblocks.getBlock(i);
if (bs->sizeIn() == 0) continue;
s << "<blockedge";
a_v_i(s,"index",bs->getIndex());
s << ">\n";
bs->saveXmlEdges(s);
s << "</blockedge>\n";
}
s << "</ast>\n";
}
saveXml is here, but I cannot find a proper way to call this. Nor can I find the right API to restore the XmlTree from the dumped ast.
This discussion was converted from issue #4220 on March 21, 2023 14:55.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Is your feature request related to a problem? Please describe.
I'm trying to decompile the whole program and do some analysis with the lifted. For large programs, it's time-consuming to do the decompilation every time, I wish to save the Funcdata as XML and load it back to restore the decompilation result.
Describe the solution you'd like
restoreXmlTree method implemented for Funcdata and some options to support this when calling Architecture.saveXml.
Additional context
saveXml is here, but I cannot find a proper way to call this. Nor can I find the right API to restore the XmlTree from the dumped ast.
Beta Was this translation helpful? Give feedback.
All reactions