JonathanSalwan / Triton

Triton is a dynamic binary analysis library. Build your own program analysis tools, automate your reverse engineering, perform software verification or just emulate code.
https://triton-library.github.io
Apache License 2.0
3.53k stars 539 forks source link

Build Errors on sln.file through VS2015 #634

Closed Xdecosee closed 6 years ago

Xdecosee commented 6 years ago

I followed the steps in the Triton installation page and was able to generate the .sln file.

I tried building the .sln file that was generated but there were build errors. Following is a screenshot of the error and output in a .pdf file. Is there a way to resolve them or am I missing a step?

Output.pdf

JonathanSalwan commented 6 years ago
diff --git a/src/libtriton/ast/astContext.cpp b/src/libtriton/ast/astContext.cpp
index d3caec56..ab47ef39 100644
--- a/src/libtriton/ast/astContext.cpp
+++ b/src/libtriton/ast/astContext.cpp
@@ -487,7 +487,7 @@ namespace triton {
     void AstContext::updateVariable(const std::string& name, const triton::uint512& value) {
       for (auto& kv: this->astGarbageCollector.getAstVariableNodes()) {
         if (kv.first == name) {
-          assert(kv.second[0]->getType() == triton::ast::VARIABLE_NODE);
+          assert(kv.second[0]->getKind() == triton::ast::VARIABLE_NODE);
           this->valueMapping[dynamic_cast<VariableNode*>(kv.second[0])->getVar().getName()] = value;
           for (auto* N: kv.second)
             N->init();

Is this patch fixes your issue?

Xdecosee commented 6 years ago

Yes, it fixed the issue. Thank you for your help. I got the LNK1104 error after using the patch, but I read #363 and run the build in release mode instead. The dll file managed to be generated and there were no build errors.