Skip to content
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

Error when hooking Discord #9

Open
Skrity opened this issue Sep 22, 2019 · 3 comments
Open

Error when hooking Discord #9

Skrity opened this issue Sep 22, 2019 · 3 comments
Labels

Comments

@Skrity
Copy link

Skrity commented Sep 22, 2019

When hooking something basic (e.g. powershell) it works fine as does ForceBindIP. ForceBindIP does nothing for discord seemingly because it only hooks launcher process. Network Adapter selector causes crash.
When using shell extension, discord won't run: being stuck at "Starting" screen.
After increasing delay I'm getting this:

C:\Users\skrit\AppData\Local\Discord\app-0.0.305>"C:\Program Files (x86)\Network Adapter Selector\NetworkAdapterSelector.Hook.exe" --network "{CCE174E9-2112-4CE7-B892-7AB3795AAF25}" --execute "Discord.exe" --delay 10000
--network {CCE174E9-2112-4CE7-B892-7AB3795AAF25} --execute Discord.exe --delay 10000

 Discord 0.0.305
Starting app.
Starting updater.
[Modules] Modules initializing
[Modules] Distribution: remote
[Modules] Host updates: enabled
[Modules] Module updates: enabled
[Modules] Module install path: C:\Users\skrit\AppData\Roaming\discord\0.0.305\modules
[Modules] Module installed file path: C:\Users\skrit\AppData\Roaming\discord\0.0.305\modules\installed.json
[Modules] Module download path: C:\Users\skrit\AppData\Roaming\discord\0.0.305\modules\pending
[Modules] No updates to install
[Modules] Checking for host updates.
[Modules] Host is up to date.
[Modules] Checking for module updates at https://discordapp.com/api/modules/stable/versions.json
[Modules] No module updates available.
[000:000] [5656] (audio_send_stream.cc:519): Unable to create encoder for {name: opus, clockrate_hz: 48000, num_channels: 1, parameters: {minplr: 0, stereo: 0, usedtx: 0, useinbandfec: 0}}
[000:000] [5656] (audio_send_stream.cc:261): Failed to set up send codec state.
[000:032] [5656] (audio_send_stream.cc:519): Unable to create encoder for {name: opus, clockrate_hz: 48000, num_channels: 1, parameters: {minplr: 30, stereo: 0, usedtx: 0, useinbandfec: 1}}
[000:032] [5656] (audio_send_stream.cc:261): Failed to set up send codec state.
[000:034] [5656] (audio_device_generic.cc:31): BuiltInAECIsAvailable: Not supported on this platform
[000:128] [5656] (audio_send_stream.cc:519): Unable to create encoder for {name: opus, clockrate_hz: 48000, num_channels: 1, parameters: {minplr: 30, stereo: 0, usedtx: 0, useinbandfec: 1}}
[000:128] [5656] (audio_send_stream.cc:261): Failed to set up send codec state.

C:\Users\skrit\AppData\Local\Discord\app-0.0.305>
Unhandled Exception: System.InvalidOperationException: Sequence contains more than one matching element
   at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
   at NetworkAdapterSelector.Hook.Guest.GetNetworkInterfaceIPAddress(AddressFamily family)
   at NetworkAdapterSelector.Hook.Guest.GenerateCaptionText()
   at NetworkAdapterSelector.Hook.Guest.Do_SetWindowText(IntPtr windowHandle, IntPtr text, Boolean unicode)
   at NetworkAdapterSelector.Hook.Guest.<Run>b__8_4(IntPtr handle, IntPtr text)

Error: async hook stack has become corrupted (actual: 626, expected: 0)
 1: 040E41DA
 2: 02FDCFDC
 3: 040E07FB
 4: 040E06AB
 5: 02FD6221
 6: 02FD6431
 7: 040DD548
 8: 041A2929
 9: 02FF86FA
10: 02FF58DF
11: 0273478D
12: 027938B0
13: 0159A892
14: 0273478D
15: 02758E7E
16: 02759193
17: 02759313
18: 02759D17
19: 02758BDF
20: 0277298E
21: 02FAE5F7
22: 0271BFEB
23: 0271C5F9
24: 0271BCD3
25: 02C140A2
26: 0271BF03
27: 0123133E
28: 04F201AA
29: 74F10419
30: 7786662D
31: 778665FD

C:\Users\skrit\AppData\Local\Discord\app-0.0.305>
@falahati
Copy link
Owner

It seems that your network adapter has multiple IP addresses and this program doesn't know which one to select. This is a bug. Sorry that I missed this issue and thanks for reporting it.

@user674574
Copy link

Hello falahati, i tried this as an alternative to forcebindip, im using wireguard VPN and trying to get some applications run without VPN, unfortunately this didnt do it either, the weird thing is that some programs work and some dont (most).

I have another question, how do u uninstall this? :D it wants to stop explorer to uninstall it, and then it hangs and gives an error.

thank you, good work regardless!

@CalebFenton
Copy link

I'm also getting this error. Here's the relevant stack trace:

18:32:57 |  Error   | fatal error when receiving:
System.InvalidOperationException: Sequence contains more than one matching element
   at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
   at NetworkAdapterSelector.Hook.Guest.GetNetworkInterfaceIPAddress(AddressFamily family)
   at NetworkAdapterSelector.Hook.Guest.GenerateCaptionText()
   at NetworkAdapterSelector.Hook.Guest.Do_SetWindowText(IntPtr windowHandle, IntPtr text, Boolean unicode)
   at SDL2.SDL.INTERNAL_SDL_SetWindowTitle(IntPtr window, Byte* title)

Seems like an easy fix. Probably just needs an [0] somewhere, but that GetNetworkInterfaceIPAddress function seems to have been refactored out. In any case, I fixed by disabling ipv6 on my VPN because it's been 20 years and ipv6 is still not ready.

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

No branches or pull requests

4 participants