genericPySysdriver.cpp
75 lines
| 1.8 KiB
| text/x-c
|
CppLexer
Jeandet Alexis
|
r0 | |||
#include <genericPySysdriver.h> | ||||
#include <socexplorerplugin.h> | ||||
#ifdef WIN32 | ||||
#include <stdlib.h> | ||||
#define socexplorerBswap32(X) _byteswap_ulong(X) | ||||
#else | ||||
#ifdef UNIX | ||||
#include <byteswap.h> | ||||
#define socexplorerBswap32(X) bswap_32(X) | ||||
#endif | ||||
#endif | ||||
r71 | #include <socexplorerengine.h> | |||
Jeandet Alexis
|
r0 | |||
genericPySysdriver::genericPySysdriver(socexplorerplugin* plugin,QObject* parent): | ||||
QObject(parent) | ||||
{ | ||||
Q_UNUSED(parent) | ||||
this->plugin = plugin; | ||||
} | ||||
QVariantList genericPySysdriver::Read(unsigned int address,unsigned int count) | ||||
{ | ||||
unsigned int data[count]; | ||||
QVariantList result; | ||||
this->plugin->Read(data,count,address); | ||||
for(unsigned int i = 0;i<count;i++) | ||||
{ | ||||
result.append(QVariant((int)data[i])); | ||||
} | ||||
return result; | ||||
} | ||||
void genericPySysdriver::Write(unsigned int address,QList<QVariant> dataList) | ||||
{ | ||||
unsigned int data[dataList.count()]; | ||||
for(int i = 0;i<dataList.count();i++) | ||||
{ | ||||
data[i] = (unsigned int)dataList.at(i).toUInt(); | ||||
} | ||||
this->plugin->Write(data,dataList.count(),address); | ||||
} | ||||
bool genericPySysdriver::dumpMemory(unsigned int address,unsigned int count,QString file) | ||||
{ | ||||
r71 | return this->plugin->dumpMemory(address,count,file); | |||
Jeandet Alexis
|
r0 | } | ||
bool genericPySysdriver::memSet(unsigned int address,int value, unsigned int count) | ||||
{ | ||||
r71 | return this->plugin->memSet(address,value,count); | |||
Jeandet Alexis
|
r0 | } | ||
bool genericPySysdriver::loadbin(unsigned int address,QString file) | ||||
{ | ||||
r71 | return this->plugin->loadbin(address,file); | |||
} | ||||
Jeandet Alexis
|
r0 | |||
r71 | bool genericPySysdriver::loadfile(abstractBinFile *file) | |||
{ | ||||
return this->plugin->loadfile(file); | ||||
} | ||||
bool genericPySysdriver::dumpMemory(unsigned int address, unsigned int count, QString file, const QString &format) | ||||
{ | ||||
return this->plugin->dumpMemory(address,count,file,format); | ||||
Jeandet Alexis
|
r0 | } | ||
QString genericPySysdriver::instance() | ||||
{ | ||||
r10 | return plugin->instanceName(); | |||
Jeandet Alexis
|
r0 | } | ||