Skip to content

Commit

Permalink
get rid of all triton api references
Browse files Browse the repository at this point in the history
  • Loading branch information
illera88 committed Dec 1, 2022
1 parent eab235c commit 5eaef2b
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 29 deletions.
7 changes: 1 addition & 6 deletions .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,8 @@ jobs:
cd IDA_SDKs
unzip -n -q '*.zip'
- name: Install Triton (delete first two lines when Triton last port is in the CI)
- name: Install Triton
run: |
cd $VCPKG_INSTALLATION_ROOT
git reset --hard
git pull
./bootstrap-vcpkg.sh
echo "set(VCPKG_BUILD_TYPE release)" >> $VCPKG_INSTALLATION_ROOT/triplets/x64-linux.cmake
vcpkg install triton
Expand Down
5 changes: 0 additions & 5 deletions .github/workflows/ci-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@ jobs:
- name: Install Triton (delete first two lines when Triton last port is in the CI)
run: |
cd $VCPKG_INSTALLATION_ROOT
git reset --hard
git pull
./bootstrap-vcpkg.sh
echo "set(VCPKG_BUILD_TYPE release)" >> $VCPKG_INSTALLATION_ROOT/triplets/x64-osx.cmake
vcpkg install triton
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,8 @@ jobs:
cd IDA_SDKs
7z.exe x *.zip
- name: Install Triton (delete first two lines when Triton last port is in the CI)
- name: Install Triton
run: |
cd $env:VCPKG_INSTALLATION_ROOT
git reset --hard
git pull
".\bootstrap-vcpkg.bat"
"`r`nset(VCPKG_BUILD_TYPE release)" | Add-Content "$env:VCPKG_INSTALLATION_ROOT\triplets\x64-windows-static.cmake"
vcpkg install triton --triplet x64-windows-static
Expand Down
3 changes: 0 additions & 3 deletions src/formTaintSymbolizeInput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,6 @@
#include <loader.hpp>
#include <kernwin.hpp>

//Triton
#include <triton/api.hpp>

//Ponce
#include "formTaintSymbolizeInput.hpp"
#include "globals.hpp"
Expand Down
2 changes: 1 addition & 1 deletion src/globals.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,6 @@ extern std::map<ea_t, struct instruction_info> ponce_comments;
#define REG_XIP tritonCtx.registers.x86_rip
#else
#define MEM_FORMAT "%#" PRIx32
#define REG_XIP api.registers.x86_eip
#define REG_XIP tritonCtx.registers.x86_eip
#endif // __EA64__

16 changes: 8 additions & 8 deletions src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,14 +116,14 @@ ea_t get_args(int argument_number, bool skip_ret)
//On Linux - parameters are passed in RDI, RSI, RDX, RCX, R8, R9 for ints / ptrs and xmm0 - 7 for float types.
switch (argument_number)
{
case 0: return static_cast<ea_t>(IDA_getCurrentRegisterValue(api.registers.x86_rdi));
case 1: return static_cast<ea_t>(IDA_getCurrentRegisterValue(api.registers.x86_rsi));
case 2: return static_cast<ea_t>(IDA_getCurrentRegisterValue(api.registers.x86_rdx));
case 3: return static_cast<ea_t>(IDA_getCurrentRegisterValue(api.registers.x86_rcx));
case 4: return static_cast<ea_t>(IDA_getCurrentRegisterValue(api.registers.x86_r8));
case 5: return static_cast<ea_t>(IDA_getCurrentRegisterValue(api.registers.x86_r9));
case 0: return static_cast<ea_t>(IDA_getCurrentRegisterValue(tritonCtx.registers.x86_rdi));
case 1: return static_cast<ea_t>(IDA_getCurrentRegisterValue(tritonCtx.registers.x86_rsi));
case 2: return static_cast<ea_t>(IDA_getCurrentRegisterValue(tritonCtx.registers.x86_rdx));
case 3: return static_cast<ea_t>(IDA_getCurrentRegisterValue(tritonCtx.registers.x86_rcx));
case 4: return static_cast<ea_t>(IDA_getCurrentRegisterValue(tritonCtx.registers.x86_r8));
case 5: return static_cast<ea_t>(IDA_getCurrentRegisterValue(tritonCtx.registers.x86_r9));
default:
ea_t esp = static_cast<ea_t>(IDA_getCurrentRegisterValue(api.registers.x86_rsp));
ea_t esp = static_cast<ea_t>(IDA_getCurrentRegisterValue(tritonCtx.registers.x86_rsp));
ea_t arg = esp + (argument_number - 6 + skip_ret_index) * 8;
return get_qword(arg);
}
Expand Down Expand Up @@ -168,7 +168,7 @@ ea_t get_args_pointer(int argument_number, bool skip_ret)
case 4:
case 5:error("[!] In Linux/OsX 64 bits you can't get a pointer to the five first\n arguments since they are registers");
default:
ea_t esp = (ea_t)IDA_getCurrentRegisterValue(api.registers.x86_rsp);
ea_t esp = (ea_t)IDA_getCurrentRegisterValue(tritonCtx.registers.x86_rsp);
ea_t arg = esp + (argument_number - 6 + skip_ret_index) * 8;
return arg;
}
Expand Down

0 comments on commit 5eaef2b

Please sign in to comment.