-
Notifications
You must be signed in to change notification settings - Fork 282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not compatible with Windows Insider Build 20150 #543
Comments
It seems that you are using it with ConEmu. You need to copy (not rename) |
Tested Clink v0.4.9 with ConEmu v20.06.15 on Microsoft Windows [Version 10.0.19041.329] For me it works, did you read instal-doc: https://conemu.github.io/en/TabCompletion.html#ConEmu_and_clink |
In "old" Windows versions, it worked fine for me (I'm using clink since more than two years now). Note that I explicitly provided my Windows version. It is higher than the version provided by you. Build
@return42 Would you mind to update to the "Beta Channel" and report whether it is broken, for you, too? And if it still works, could you update to the "Dev Channel"? |
Now, with renamed title it is more clear that you are not asking about Version 2004 :)
No please not .. costs me 1/2 day to get the 2004 update running .. I am glad that after the first start-up difficulties it is now working. I better not change anything, otherwise this MS-win crap will collapse again :-o Sorry, can't help. |
Works in beta channel for me, but not in dev. |
From what I'm seeing it's a bit more subtle. It seems to me that it does finish loading, but some of the pipes are broken. Maybe @bitcrazed or @craigaloewen can help triage this? |
i'm using Windows Terminal and have the same issue |
Can confirm having the same issue using Windows Terminal or Cmder on Windows build 20170. |
@mridgers is this project still alive? |
patched version is here: https://github.com/nikitalita/clink/tree/v0.4.9-insider-fix_mridgers |
Wow that's great news |
Thank you @nikitalita for identifying the issue and a workaround. The |
Not compatible with Windows Insider Build 20150 mridgers/clink#543 The write_trampoline_out function used a hard-coded location relative to the API it patched, and it verified that the hard-coded location contained only NOP/INT3 instructions. In recent Windows Insider builds, the hard-coded location no longer contains NOP/INT3 instructions, but there are plenty of nearby runs that are large enough to write the patched code into. This change now scans backwards nearby, looking for a large enough run of NOP/INT3 instructions to safely patch.
excellent! Thanks @chrisant996 ! |
Oh, and there's only a 2 byte "safe" region available preceding ReadConsoleW. Is there a 5+ byte region anywhere within 125 bytes before the beginning of ReadConsoleW? Or with 125 in either direction? I might need to set up an Insiders Dev channel VM after all. |
I'm evaluating using Microsoft Detours for hooking APIs. It handles a lot more edge cases/etc than what's currently in clink (and even supports multiple chipsets, though that's not currently needed by clink). Detours 4.x uses the MIT License. Detours should resolve this whole class of issues once and for all. That's attractive. 😉 |
@nikitalita You can click on the three dots and then choose "Edit" to change the markdown of a comment (and or instance update the screenshot). Another thing @nikitalita: Could you provide a binary? I did not have success building the thing on GitHub (chrisant996/clink#4 (comment)). |
Merged PR from @nikitalita, and will investigate switching to using Detours moving forward. |
@koppor BTW, as for fixing clink builds on github actions, take a look at what @cmderdev is doing with their appveyor setup: https://github.com/cmderdev/clink/tree/v0.4.9 |
BTW, here's a build of v0.4.9 with the fix backported: |
aw shit, it broke again on 20246. Investigating why. |
Looks like in the newest builds it no longer has that int3 block it had previously. @chrisant996 have you implemented detours in your fork yet? |
Not yet, but it sounds like that needs to be a priority. I was deferring it because it looks like there are some bugs in Detours that people have fixed in forks, and I'll need to collect + review fixes and determine what state of the code base to integrate into Clink. |
I think my original change walked past adjacent functions, and I think you restricted it to only search in the immediately adjacent space (which I agree is safer). Am I remembering correctly? Does removing that restriction enable it to work again at least for the moment? |
I had just restricted the backwards search to stop searching backwards if it hit a RET, I didn't restrict fowards searching. Lifting that wouldn't help here, as the closest int3 block started at exactly 126 bytes forward AND after another function. I just lifted the search size from 125 bytes to 135 bytes and it's working now. I'll submit a patch, but yeah, these kinds of fixes seem increasingly fragile. |
new v0.4.9 build with this fix: |
The reason I restricted it to less than 127 in either direction is it seemed to be producing a 2 byte relative jump that can go up to 127 bytes in either direction. How is the jump being successful when the distance is greater than 7 bits? Or did you change the instruction set? |
The long jump instruction is being written starting at offset byte 126. The two-byte relative jump can just barely make it there. I've adjusted the patch accordingly; It'll only check 127 bytes backwards, and 131 bytes forwards. |
Ok great, thank you. I'll start working on Detours sometime soon.
Get Outlook for Android<https://aka.ms/ghei36>
…________________________________
From: nikitalita <[email protected]>
Sent: Tuesday, November 3, 2020 9:32:22 AM
To: mridgers/clink <[email protected]>
Cc: Chris Antos <[email protected]>; Mention <[email protected]>
Subject: Re: [mridgers/clink] Not compatible with Windows Insider Build 20150 (#543)
The long jump instruction is being written starting at offset byte 126. The two-byte relative jump can just barely make it there. I've adjusted the patch accordingly; It'll only check 127 bytes backwards, and 131 bytes forwards.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub<#543 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AEFB4NY5C4YXR5OI7RZQ5BTSOA5CNANCNFSM4OKQHR4Q>.
|
BTW, for people still getting bit by this issue, I recommend using chrisant996's version of clink instead of my patch: https://github.com/chrisant996/clink |
Version 0.4.9:
Version 1.0.0a1 does not start at all. cmd.exe hangs during start.
The text was updated successfully, but these errors were encountered: