void Decompile::work() { auto context = std::make_shared<core::Context>(); context->setModule(project_->module()); context->setInstructions(instructions_); context->setCancellationToken(cancellationToken()); context->setLogToken(project_->logToken()); project_->setContext(context); delegate(std::make_unique<Decompilation>(context)); }
int main(const int argc, const char * argv[]) { std::pair<Program, RunInfo> prog; if (argc >= 2 && strcmp(argv[1], "--") != 0) { std::ifstream in(argv[1]); if (!in.good()) { std::cerr << "Unable to read file: " << argv[1] << std::endl; return 1; } prog = setInstructions(in); } else { prog = setInstructions(std::cin); } Values output = execute(prog.first, prog.second); bool f = false; for (int16_t v : output) { if (f) std::cout << ", "; std::cout << getName(v); f = true; } std::cout << std::endl; return 0; }
int main() {error = fopen("error_dump.rpt", "w"); snap = fopen("snapshot.rpt", "w"); /* code */ Read_DMEMORY(); Read_IMEMORY(); initialize(); setInstructions(); execute_pipeline(); fclose(error); fclose(snap); return 0; }
void MainWindow::open(const QStringList &filenames) { if (filenames.empty()) { return; } auto context = std::make_shared<core::Context>(); context->setLogToken(logToken_); foreach (const QString &filename, filenames) { try { core::Driver::parse(*context, filename); } catch (const nc::Exception &e) { QMessageBox::critical(this, tr("Error"), e.unicodeWhat()); return; } catch (const std::exception &e) { QMessageBox::critical(this, tr("Error"), e.what()); return; } } auto project = std::make_unique<gui::Project>(); project->setName(QFileInfo(filenames.front()).fileName()); project->setContext(context); project->setImage(context->image()); project->setInstructions(context->instructions()); open(std::move(project)); if (project_->instructions()->empty()) { project_->disassemble(); } if (decompileAutomatically()) { project_->decompile(); } }
void XDataWidget::setForm(const XMPP::XData& d) { setInstructions(d.instructions()); setFields(d.fields()); }
Scene *Manager::initMap1(ShaderProgram* shProg) { setInstructions(); //Piece* p; std::vector<Drawable*> *ps = new std::vector<Drawable*>; std::vector<Vertex> *vs = new std::vector<Vertex>; std::vector<unsigned int> *is = new std::vector<unsigned int>; Scene* scene = new Scene(ps); Vertex vert = *(new Vertex()); float size = TILESIZE; std::vector<Tile*> *totaltiles = new std::vector<Tile*>; std::vector<Vertex> *tilevertexes = new std::vector<Vertex>; std::vector<unsigned int> *tileindexes = new std::vector<unsigned int>; Tile * t; for (int i = 0; i < NUMTILESY; i++){ for (int k = 0; k < NUMTILESX; k++){ vert.XYZW = glm::vec4(k, i, 0.0f, 1.0f), vert.RGBA = glm::vec4(0.9f, 0.0f, 0.0f, 1.0f), vert.NORMAL = glm::vec4(0.0f, 1.0, 0.0f, 1.0f), vert.UV = glm::vec2(1.0f, 0.0f); // 2 vs->push_back(vert); tilevertexes->push_back(vert); vert.XYZW = glm::vec4(k + size, i, 0.0f, 1.0f), vert.RGBA = glm::vec4(0.9f, 0.0f, 0.0f, 1.0f), vert.NORMAL = glm::vec4(0.0f, 1.0, 0.0f, 1.0f), vert.UV = glm::vec2(1.0f, 0.0f); // 3 vs->push_back(vert); tilevertexes->push_back(vert); vert.XYZW = glm::vec4(k + size, i + size, 0.0f, 1.0f), vert.RGBA = glm::vec4(0.9f, 0.0f, 0.0f, 1.0f), vert.NORMAL = glm::vec4(0.0f, 1.0, 0.0f, 1.0f), vert.UV = glm::vec2(0.0f, 1.0f); // 0 - FRONT vs->push_back(vert); tilevertexes->push_back(vert); vert.XYZW = glm::vec4(k, i + size, 0.0f, 1.0f), vert.RGBA = glm::vec4(0.9f, 0.0f, 0.0f, 1.0f), vert.NORMAL = glm::vec4(0.0f, 1.0, 0.0f, 1.0f), vert.UV = glm::vec2(1.0f, 1.0f); // 1 vs->push_back(vert); tilevertexes->push_back(vert); for (int j = 0; j < 4; j++) { is->push_back(j); } t = new Tile(glm::vec3(k, i, 0)); totaltiles->push_back(t); vs->clear(); is->clear(); } } for (unsigned int l = 0; l < tilevertexes->size(); l++) { tileindexes->push_back(l); } glm::vec3 pos; float index, index0, index1, index2, index3; for (std::vector<Tile*>::iterator it = totaltiles->begin(); it != totaltiles->end(); ++it) { pos = (*it)->getPos(); index = std::floor(pos.x) + std::floor(pos.y)*NUMTILESX; index0 = std::floor(pos.x + TILESIZE) + std::floor(pos.y)*NUMTILESX; if (index0 < NUMTILESX * NUMTILESY) (*it)->addAdj(totaltiles->at(index0)); index1 = std::floor(pos.x - TILESIZE) + std::floor(pos.y)*NUMTILESX; if (index1 >= 0 ) (*it)->addAdj(totaltiles->at(index1)); index2 = std::floor(pos.x) + std::floor(pos.y + TILESIZE)*NUMTILESX; if (index2 < NUMTILESX * NUMTILESY) (*it)->addAdj(totaltiles->at(index2)); index3 = std::floor(pos.x) + std::floor(pos.y - TILESIZE)*NUMTILESX; if (index3 >= 0 ) (*it)->addAdj(totaltiles->at(index3)); } Piece* tgrid = new TileGrid(*tilevertexes, *tileindexes, shProg, *totaltiles, scene->getId()); ps->push_back(tgrid); //createEnemy(sh); return(scene); }