diff options
Diffstat (limited to 'dump.cpp')
-rw-r--r-- | dump.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/dump.cpp b/dump.cpp new file mode 100644 index 0000000..ccbb349 --- /dev/null +++ b/dump.cpp @@ -0,0 +1,23 @@ +#include "nvlib.h" + +int main(int argc, char** argv) +{ + std::auto_ptr<nv_device> dev; + dev.reset(nv_device::open_default()); + + unsigned base = strtoul(argv[1], 0, 0); + unsigned size = strtoul(argv[2], 0, 0); + for(unsigned i = 0; i < size; i += 4) { + if(!(i & 15)) { + if(i) + printf("\n"); + printf("%08x:", base + i); + } + printf(" %08x", dev->rd32(base + i)); + } + if(size) + printf("\n"); + + return 0; +} + |