Maximus5 / ConEmu

Customizable Windows terminal with tabs, splits, quake-style, hotkeys and more
https://conemu.github.io/
BSD 3-Clause "New" or "Revised" License
8.56k stars 572 forks source link

Feature request: ARM64 build for Windows 10 #1488

Open tycho opened 6 years ago

tycho commented 6 years ago

Windows 10 for ARM64 is out, and it has proper Windows desktop development support (none of this "Windows RT" nonsense). It even runs x86 (and on Windows 11, x86_64) apps under a transparent emulation layer. So ConEmu can sort of run on my ARM64 device, but it's slow and it's not able to hook into the ARM native conhost or anything like that.

It would be very nice to have support for the new architecture. The big things blocking this from what I can see are:

The MinHook stuff looks rather hairy and I don't know where to begin on that.

EDIT: Corrected statements about emulation capabilities.

matbech commented 6 years ago

Detours offers ARM64 support: https://github.com/microsoft/Detours

Maximus5 commented 6 years ago

Definitely, I need to check Detours and compare them with Minhook. If there will no speed drawbacks, I may use this package.

chrisant996 commented 2 years ago

@Maximus5 if ConEmu uses IAT style hooking, then Detours might not be a viable alternative: I made Clink use Detours, but eventually had to disable the Detours support and go back to IAT hooking because they have different side effects and the order that hooks are called is different.

Switching libraries changes the relative order of hooks being injected, and so if other things are using IAT style hooks on the same APIs ConEmu is hooking, then if ConEmu uses Detours then they will precede ConEmu's hooks. That may or may not cause problems for ConEmu. For Clink, it definitely caused problems.

Maximus5 commented 2 years ago

Thanks for the info @chrisant996 As I know, Detours works exactly the same way as minhooks I used in ConEmu (replace of first instructions in the API function body)

chrisant996 commented 2 years ago

@Maximus5 @DRSDavidSoft oh, my mistake -- I got minhook mixed up. Yes, both minhook and Detours do jmp hooking, not IAT hooking. In that case, Detours should be compatible.

I thought I read that ARM hooking was the only/main thing preventing an ARM version of ConEmu. But it sounds like Detours should be compatible, so maybe the only thing standing in the way is some time investment?

And if necessary I could probably make Clink use Detours for ARM, since incompatibilities like AnsiCon won't be a problem on ARM (since they don't have ARM versions anyway).

DRSDavidSoft commented 2 years ago

@chrisant996 I appreciate it nonetheless, this appears to be a (somewhat) straightforward thing to do, I'm willing to spend some time to see if I can make some examples to work on ARM.

P.S. A great ARM64 device to run Windows 11 ARM (albeit, a bit slower than Apple M1) is a Raspberry Pi 4. If interested, see the Windows on Raspberry Pi project. It certainly beats using an emulator, as it's bare metal hardware, and reasonably priced.

@Maximus5 Sorry to bother you, but may I ask if you could take a look at or do some tests with Detour on x86_64? Unfortunately I don't think that I have enough experience or expertise to modify the existing implementation, without some working reference code.

grealish commented 1 year ago

Any update here? many new WoA devices comming into the picture, like MS DevKit and Thinkpad X13s (both on Qualcomm Snapdragon)

Sim-md commented 1 week ago

I have notebook with Snapdragon X Elite processor. Do you have an update for ARM64 support?

RussianE39 commented 1 week ago

ConEmu in current state is buildable for ARM64EC, process is basically straightforward. Two things were issue: 1) Linker for ARM64 not support /DYNAMICBASE:NO so you need to adjust Linker options 2) Editing .def files for CD and HK: `--- a/src/ConEmuCD/export.def +++ b/src/ConEmuCD/export.def @@ -1,4 +1,4 @@ -LIBRARY +LIBRARY ConEmuCD64

EXPORTS ; functions @@ -12,10 +12,11 @@ EXPORTS GuiMacro

; LLKeyHooks (ConEmu GUI)