traison Posted July 2 Posted July 2 (edited) Since this is something that can't be unseen, I'll put the nightmare stuff in spoiler tags below. If you have some form of OCPD and you're currently living a happy life in Skyrim and you're not looking for a bytecode patching adventure then read no further, it's not worth the trouble. If you do not care about unmeasurable micro-optimizations then there's no point in reading further either. If you already think Skyrim is burning a hole in your storage device then this *may* be worth looking into. Spoiler Every 0.5 seconds SkryimSE.exe (through setupapi.dll) polls the registry for your HID devices (i.e. keyboard/mouse) then attempts to query the information of these registry keys as file directories in the Skyrim install directory. Seems like a bug to me. Not too unlike what Steam was doing with SDL/SDL2 a decade ago. This is ~20 IO events depending on your setup, every second, for an eternity. Registry queries go out to select GUIDs in HKLM\System\CurrentControlSet\Control\DeviceClasses\. Then it queries some select subkeys in the install directory of Skyrim for whatever reason: QueryOpen ...\Skyrim Special Edition\hid#vid_1111&pid_2222&mi_01&col03#8&99dab39&0&0001#{4d1e55b2-f6ff-1103-77cb-022111010070} The fix (as I implemented it) is to bytecode patch the unpacked SkyrimSE.exe: 1170 offset: 0xCE5E07 Pattern: 0F85F8F3FFFFC6051C064F0200C60525064F0200C6052E064F0200C60537064F0200E842E7FFFF90 Fix: Replace the 2nd byte in pattern with 0x84 Fixed pattern for reference: 0F84F8F3FFFFC6051C064F0200C60525064F0200C6052E064F0200C60537064F0200E842E7FFFF90 Q: Unpacked exe? A: Your SkyrimSE.exe is not unpacked, if you do not already know what that means - this does not happen by accident. Q: So how do I unpack my exe? A: That would be breaking the EULA, and (if you're living in a civilized country) your local laws. Q: Why do you have an unpacked exe then? A: Because I do not subscribe to "you will own nothing and be happy". I buy it, I own it. Q: Ok so what's the point of this thread then? A: If someone wants to squeeze this into a dll, feel free to do so. You can find the pattern in memory when Skyrim is running, and this should work regardless of whether the exe has been unpacked or not (not tested). You'll need a generic process memory scanner, of which I'm sure there's plenty of examples online. No credits needed for discovery. Q: What is this going to break? Surely it's not polling just to be annoying? A: If I had to guess, it's going to break input for those of us that like to rip out and insert usb cables mid-gameplay. I'm old-school though so that's already a no-no for me, even if it was technically possible. Edited July 2 by traison
Just Don't Posted July 2 Posted July 2 1 hour ago, traison said: Every 0.5 seconds SkryimSE.exe (through setupapi.dll) polls the registry for your HID devices (i.e. keyboard/mouse) then attempts to query the information of these registry keys as file directories in the Skyrim install directory. And yet it can't recognize multiple input devices on the fly. This is very weird, I'm not that tech savvy but I almost understand what needs to be done. I'm curious about compatibility with SKSE and other mods. I know from some tests and common knowledge some SKSE plugins don't work on cracked executables, I'm not sure if editing the exe in this way would create similar incompatibilities. Will keep an eye on this for sure. And if someone implements a DLL solution, I hope it's not vibe-coded bs like the usual Nexus hot files fix-your-broken-modlist-and-load-20x-faster garbage.
traison Posted July 2 Author Posted July 2 1 hour ago, Just Don't said: I'm curious about compatibility with SKSE and other mods. I know from some tests and common knowledge some SKSE plugins don't work on cracked executables... I can't comment on what a typical cracked exe can or can't do, I just know mine works without further edits. I guess the others do it some other way. 1 hour ago, Just Don't said: ...I'm not sure if editing the exe in this way would create similar incompatibilities. It did not.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now