mirror of
https://github.com/AxioDL/nod.git
synced 2025-12-09 05:28:00 +00:00
Initial extractor automation
This commit is contained in:
37
driver/main.cpp
Normal file
37
driver/main.cpp
Normal file
@@ -0,0 +1,37 @@
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "NODLib.hpp"
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
if (argc < 2)
|
||||
{
|
||||
fprintf(stderr, "Usage: nodlib <image-in>\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
std::unique_ptr<NOD::DiscBase> disc = NOD::OpenDiscFromImage(argv[1]);
|
||||
if (!disc)
|
||||
return -1;
|
||||
|
||||
disc->extractToDirectory("/home/jacko/Desktop/TrilogyDump2");
|
||||
|
||||
const NOD::DiscBase::IPartition* dataPart = disc->getDataPartition();
|
||||
if (dataPart)
|
||||
{
|
||||
for (const NOD::DiscBase::IPartition::Node& node : dataPart->getFSTRoot())
|
||||
{
|
||||
if (node.getKind() == NOD::DiscBase::IPartition::Node::NODE_FILE)
|
||||
printf("FILE: %s\n", node.getName().c_str());
|
||||
else if (node.getKind() == NOD::DiscBase::IPartition::Node::NODE_DIRECTORY)
|
||||
{
|
||||
printf("DIR: %s\n", node.getName().c_str());
|
||||
for (const NOD::DiscBase::IPartition::Node& subnode : node)
|
||||
printf("SUBFILE: %s\n", subnode.getName().c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user