Skip to content

Commit

Permalink
dsfgsdfg
Browse files Browse the repository at this point in the history
  • Loading branch information
altalk23 committed Jun 2, 2024
1 parent 7bb7c98 commit 8b95688
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion src/Handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ void Handler::reorderFunctions() {
auto& vec = m_content->m_functions;
std::cout << "functions size " << m_content->m_functions.size() << " this " << (void*)this << std::endl;
std::sort(m_content->m_functions.begin(), m_content->m_functions.end(), [this](auto const a, auto const b) {
std::cout << "reordering this" << a << " " << b << " "<< (void*)this << std::endl;
// std::cout << "reordering this" << a << " " << b << " "<< (void*)this << std::endl;
return a < b;
});
// std::sort(vec.begin(), vec.end(), [this](auto const a, auto const b) {
Expand Down
3 changes: 0 additions & 3 deletions src/generator/X64Generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,8 +363,6 @@ Result<> X64HandlerGenerator::generateTrampoline(uint64_t target) {
X64Assembler a(reinterpret_cast<uint64_t>(m_trampoline));
using enum X64Register;

a.ret();

if (m_metadata.m_convention->needsWrapper(m_metadata.m_abstract)) {
a.push(RBP);
a.mov(RBP, RSP);
Expand All @@ -385,7 +383,6 @@ Result<> X64HandlerGenerator::generateTrampoline(uint64_t target) {

auto difference = a.currentAddress() - reinterpret_cast<int64_t>(m_address) + 5 - code.m_originalOffset;

a.ret();
if (difference <= 0x7fffffffll && difference >= -0x80000000ll) {
std::cout << "short jmp offset " << code.m_originalOffset << std::endl;
a.jmp(reinterpret_cast<uint64_t>(m_address) + code.m_originalOffset);
Expand Down

0 comments on commit 8b95688

Please sign in to comment.