Skip to content

Conversation

mrexodia
Copy link
Contributor

@mrexodia mrexodia commented Mar 17, 2024

Just some local experiments in a Docker image if anyone is interested (not ready for merging obviously)...

@mrexodia mrexodia marked this pull request as draft March 17, 2024 19:12
@mrexodia
Copy link
Contributor Author

Unfortunately this crashes right away when lifting a mov instruction: 140001000 4889c8 mov rax, rcx

liftme.exe.zip

I'll have to compile this with address sanitizer and see what's going on in more detail...

@NaC-L
Copy link
Owner

NaC-L commented Mar 17, 2024

Only reason I could think is apparently I havent implement jnb instruction, its implemented now and binary is lifted on windows correctly right now.

@NaC-L NaC-L self-assigned this Mar 17, 2024
@mrexodia
Copy link
Contributor Author

Yeah it doesn’t even get there, it crashes in the mov right away with some memory corruption error on the command line. I’ll investigate it properly tomorrow and see what could be going on. My LLVM is also at 15, so that might be an issue as well…

@NaC-L NaC-L marked this pull request as ready for review March 22, 2024 12:56
@NaC-L
Copy link
Owner

NaC-L commented Mar 22, 2024

I figured out it crashes, can you update to latest version so I can merge your branch?

@mrexodia
Copy link
Contributor Author

Yes, I will rebase it!

@mrexodia
Copy link
Contributor Author

mrexodia commented Mar 22, 2024

Done, I rebased on the latest development branch and removed the CMake changes. I think the CMake needs to be rewritten fully, but I don't have time for this now...

Currently this will not compile, because you need to add linux-pe to the project yourself. Feel free to push and update to my branch in a way that works for you. Locally it looks something like this for me:

include(FetchContent)

# Fix warnings about DOWNLOAD_EXTRACT_TIMESTAMP
if(POLICY CMP0135)
	cmake_policy(SET CMP0135 NEW)
endif()
message(STATUS "Fetching linux-pe (58249d9)...")
FetchContent_Declare(linux-pe
	GIT_REPOSITORY
		"https://github.com/can1357/linux-pe"
	GIT_TAG
		58249d9
)
FetchContent_MakeAvailable(linux-pe)

message(STATUS "Fetching Zydis (v4.1.0)...")
FetchContent_Declare(Zydis
	GIT_REPOSITORY
		"https://github.com/zyantific/zydis"
	GIT_TAG
		v4.1.0
)
FetchContent_MakeAvailable(Zydis)

And then:

target_link_libraries(lifter PRIVATE
	Zydis
	linux-pe
)

The crash isn't fixed though, but I will debug it more next week...

@mrexodia mrexodia changed the base branch from main to development/v0.1 March 22, 2024 14:43
@NaC-L NaC-L merged commit 167025e into NaC-L:development/v0.1 Mar 22, 2024
@NaC-L
Copy link
Owner

NaC-L commented Mar 22, 2024

LGTM, I'll push the commit to fix the crash in a bit. Thanks for your contributions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants