| 96 | } |
| 97 | |
| 98 | bool Decoder::run() |
| 99 | { |
| 100 | if (_config == nullptr || _image == nullptr) |
| 101 | { |
| 102 | LOG << "[ABORT] Config or object image is not available.\n"; |
| 103 | return false; |
| 104 | } |
| 105 | |
| 106 | initTranslator(); |
| 107 | initDryRunCsInstruction(); |
| 108 | initEnvironment(); |
| 109 | initRanges(); |
| 110 | initJumpTargets(); |
| 111 | |
| 112 | LOG << _ranges << std::endl; |
| 113 | LOG << _jumpTargets << std::endl; |
| 114 | |
| 115 | decode(); |
| 116 | |
| 117 | if (debug_enabled && fs::exists(_config->getOutputDirectory())) |
| 118 | { |
| 119 | dumpModuleToFile(_module, _config->getOutputDirectory()); |
| 120 | } |
| 121 | |
| 122 | resolvePseudoCalls(); |
| 123 | patternsRecognize(); |
| 124 | finalizePseudoCalls(); |
| 125 | |
| 126 | if (debug_enabled && fs::exists(_config->getOutputDirectory())) |
| 127 | { |
| 128 | dumpControFlowToJson(_module, _config->getOutputDirectory()); |
| 129 | dumpModuleToFile(_module, _config->getOutputDirectory()); |
| 130 | } |
| 131 | |
| 132 | initConfigFunctions(); |
| 133 | |
| 134 | if (debug_enabled && fs::exists(_config->getOutputDirectory())) |
| 135 | { |
| 136 | dumpModuleToFile(_module, _config->getOutputDirectory()); |
| 137 | } |
| 138 | |
| 139 | initializeGpReg_mips(); |
| 140 | |
| 141 | return false; |
| 142 | } |
| 143 | |
| 144 | void Decoder::decode() |
| 145 | { |
nothing calls this directly
no test coverage detected