Jump to content

Kext: DIY KernelEx extensions


Recommended Posts

I got kernelex installed but not sure how to install these mods? can anyone help a noob out?

Look into the Kstub Spoiler on the first page. Or here (Api GetSystemWow64DirectoryA=z2e120 for Java 6 updates 32 and higher).

Edited by schwups
Link to comment
Share on other sites


oh i see what happened the directions are now wrong because the updates change the ini file name

Please give us more details! I don't understand what happened. What exactly have you done? Which directions are wrong, which ini file do you mean has changed? Reinstall KernelEX if you run into problems.

Edited by schwups
Link to comment
Share on other sites

I've happily followed all the activity here and in related topics over the last few days, but have been a bit busy. It seems there is much energy in 2013, and much to do!

I'll catch up on responding to each issue later tonight, but for now here are some new stub definitions to verify:


  • ;
Remote Access Service Functions (Windows)
[RASAPI32.dll]
RasGetAutodialAddressW=t5
RasGetAutodialEnableW=t2
RasGetAutodialParamW=t3
RasSetAutodialAddressW=t5
[;RASDLG.dll] --- see Lz32 ---
RasDialDlgW=f4 ;needs error set in struct
RasPhonebookDlgW=f3 ;needs error set in struct
; Authentication Functions (Windows)
[secur32.dll]
AcquireCredentialsHandleW=t9
DecryptMessage=t4
EncryptMessage=t4
GetComputerObjectNameW=z3e120
GetUserNameExA=z3e
GetUserNameExW=z3e
InitSecurityInterfaceW=z0
InitializeSecurityContextW=t12
LsaEnumerateLogonSessions=t2
LsaFreeReturnBuffer=t1
LsaGetLogonSessionData=t2
QueryContextAttributesW=t3

Link to comment
Share on other sites

oh i see what happened the directions are now wrong because the updates change the ini file name

Please give us more details! I don't understand what happened. What exactly have you done? Which directions are wrong, which ini file do you mean has changed? Reinstall KernelEX if you run into problems.

the directions say to do this

modify contents= line in Core.ini to read:

contents=std,kexbases,kexbasen,Kstub730

but the version I downloaded was version 822 so I had to change kstub730 to kstub822

Edited by togermano
Link to comment
Share on other sites

oh i see what happened the directions are now wrong because the updates change the ini file name

Please give us more details!  I don't understand what happened. What exactly have you done? Which directions are wrong, which ini file do you mean has changed?  Reinstall KernelEX if you run into problems.

the directions say to do this

modify contents= line in Core.ini to read:

    contents=std,kexbases,kexbasen,Kstub730

but the version I downloaded was version 822 so I had to change kstub730 to kstub822

Of course you must must write Kstub822, if you installed version 822!

My sequence: contents=Kstub822,std,kexbases,kexbasen. The sequence can have an effect on your system. Read topic - posts 65 and 66.

Link to comment
Share on other sites

The new stub definitions of secur32.dll seem to be OK so far. There are no new log entries. 

[secur32.dll]

AcquireCredentialsHandleW=t9

DecryptMessage=t4

EncryptMessage=t4

GetComputerObjectNameW=z3e120

InitializeSecurityContextW=t12

QueryContextAttributesW=t3

But I don't know which apps need them.

Link to comment
Share on other sites

  • 3 weeks later...

OK so, I have finally installed KxStub and there is some good and bad. I'll start with the bad as it's very bad:

it seems I can't use any program requiring msvcr90.dll anymore.

When I attempt to launch any such program I get first a Microsoft Visual C++ Runtime Library popup message which says:

Runtime Error!

Program: path to whatever program dependant on msvcr90.dll

R6034

An application has made an attempt to load the C runtime library incorrectly

Please contact the application's support team for more information.

and then after I click on the OK button I get another message that says that msvcr90 can't start.

I couldn't find a single program dependant on msvcr90 that would run at all.

Examples: Audacity 2.0.3, Blender 2.49, FreeCAD, Scribus, TapinRadio

I deleted the whole block of msvcr90 entries in kxstub821.ini, thinking this was the problem but it made no difference.

And then I realized that most programs dependant on mscvr80 were also unusable, some crashing exactly like above and the others merely crashing in kernel32 on launch.

Examples: SEO Note, Seamonkey 10.0.0.4407, K-Meleon 1.6.0.0, Google Sketchup 8

After some further testing I can say that no program dependant on msvcr70, msvcr71, msvcr100 or msvcr110 appears affected.

LuxRender 0.8, 0.9 and 1.0 which rely on msvcr90 all crash but versions 1.1 and 1.2, which rely on msvcr100, run normally.I have many programs dependant on msvcr100 and they are mostly, like LuxRender develloped using the Nokia QT toolkit. I have only one program dependant on msvcr110 and that is the latest version of the fractal flame renderer Chaotica. I can run msvcr100 and 110 thanks to hexing them as explained in my little hex hacks thread, all functions not catered for by KernelEx being replaced by SetLastError as KxStub appears to crash native mscvr100.

Now for the good: if the ActCtx entries of KxStub.ini crash msvcr100 and don't appear to allow starting programs needing those functions, they have however allowed me to run VST audio plugins which I haven't otherwise been able to run.

Plugins made with the latest versions of Synthmaker which require the function FindActCtxSectionStringA can run normally with KxStub. I hadn't been able to attempt hexing of that function to SetLast Error as those plugins are UPX compressed in a special way that breaks the dll when unUPXing them. Plugins made with the latest versions of Synthedit which require all 5 ActCtx functions can be loaded and they work normally as far as DSP and host interfacing goes but unfortunately they only display a blank UI which is another story. I couldn't manage to get those plugins to run by hexing the ActCtx functions to SetLastError but the ActCtx entries of KxStub.ini do.

Now of course, I'd like to be able to run those plugins but without not being able to run msvcr80 and 90 dependant programs. I have no clue as to whether I can do something about it with the KxStub ini file?

Edited by loblo
Link to comment
Share on other sites

loblo, excellent report with lots of precise details! :thumbup

The Active Context function stubs have been giving us more trouble than anything else. As you noted, some apps need them present, others need them to be missing. Here are the options we currently have for dealing with this problem:

  1. Implement the functions with real code (ala PrintDlgEx/ComDlgEx and IpHlpApi)
    + Best solution for all apps, even if we just fake it!
    + Wine/ReactOS should provide implementation ideas
  2. Find better stub definitions that will satisfy all apps
    + Everyone is welcome to help search
    + Just edit stubs.ini and save, then restart test app (no reboot needed!)
  3. Hex the MSVCRT 8 & 9 dll's to look for ActCxx instead of ActCtx
    + If ActCtx api's are missing, they work; so hex to look for something known to be missing
    - might not fix all apps--others may need hexing, too, or help from (2.)
  4. Use custom Core.ini profiles, possibly with multiple Kexstubs versions/definitions
    ~ I've had mixed success with custom profiles, but should be able to derive a non-ActCtx profile that inherits from W2K and disables ActCtx support
    + If core.ini can't do it alone, a second version of Kexstubs can be loaded to provide alternate definitions to the custom profile

I'll get to working on (4). It'll require some reboots and creation of a test app. I'll update the post when I get it working.


Update: Method 4 is ready for testing. Add the seven ActCtx api's back into stubs.ini and copy the Core.ini from the spoiler below, then reboot. :)

After removing two Core.ini profiles to make room under the cap, these lines did the trick:


[ApiConfigurations]
6=NOAC

[NOAC]
inherit=NT2K
desc=Win2000 SP4, no ActCtx (for MSVCRT 8+)

[NOAC.names]
KERNEL32.ActivateActCtx=none
KERNEL32.CreateActCtxA=none
KERNEL32.CreateActCtxW=none
KERNEL32.DeactivateActCtx=none
KERNEL32.FindActCtxSectionStringA=none
KERNEL32.FindActCtxSectionStringW=none
KERNEL32.ReleaseActCtx=none

I found that any profile past number ten gets displayed in the pick list, but won't "stick". So to make room for this new profile plus one more in the future, I removed the Win2003 and Win2008 profiles. Here is my complete Core.ini:

[ApiConfigurations]
default=2
0=DCFG1
1=WIN95
2=WIN98
3=WINME
4=NT40
5=NT2K
6=NOAC
7=WINXP
8=VISTA
9=NOHEAP

[DCFG1]
contents=Kexstubs,std,kexbases,kexbasen
desc=Base enhancements

[DCFG1.names.98]
KERNEL32.GetVersion=std
GDI32.SetWorldTransform=kexbases.0
GDI32.GetRandomRgn=std
GDI32.SetGraphicsMode=std
GDI32.GetTextMetricsA=std
GDI32.GetWorldTransform=std
GDI32.ModifyWorldTransform=std
GDI32.SetMapMode=std
KERNEL32.VerSetConditionMask=none
KERNEL32.VerifyVersionInfoA=none
KERNEL32.VerifyVersionInfoW=none
KERNEL32.CreateIoCompletionPort=std
SHELL32.SHParseDisplayName=none

[DCFG1.names.Me]
KERNEL32.GetVersion=std
GDI32.SetWorldTransform=kexbases.0
GDI32.GetRandomRgn=std
GDI32.SetGraphicsMode=std
GDI32.GetTextMetricsA=std
GDI32.GetWorldTransform=std
GDI32.ModifyWorldTransform=std
GDI32.SetMapMode=std
KERNEL32.VerSetConditionMask=none
KERNEL32.VerifyVersionInfoA=none
KERNEL32.VerifyVersionInfoW=none
KERNEL32.CreateIoCompletionPort=std
USER32.AllowSetForegroundWindow=std
USER32.LockSetForegroundWindow=std
USER32.GetMouseMovePointsEx=std
SHELL32.SHParseDisplayName=none

[WIN95]
inherit=DCFG1
desc=Windows 95

[WIN95.names]
ComDlg32.PrintDlgExA=Kexstubs.0
ComDlg32.PrintDlgExW=Kexstubs.0
KERNEL32.GetVersion=kexbases.0
KERNEL32.GetVersionExA=kexbases.1
KERNEL32.GetVersionExW=kexbases.1

[WIN98]
inherit=WIN95
desc=Windows 98 SE

[WIN98.names]
KERNEL32.GetVersion=kexbases.1
KERNEL32.GetVersionExA=kexbases.2
KERNEL32.GetVersionExW=kexbases.2

[WINME]
inherit=WIN98
desc=Windows Millennium

[WINME.names]
KERNEL32.GetVersion=kexbases.2
KERNEL32.GetVersionExA=kexbases.3
KERNEL32.GetVersionExW=kexbases.3

[NT40]
inherit=WIN95
desc=Windows NT 4.0 SP6

[NT40.names]
KERNEL32.GetVersion=kexbases.3
KERNEL32.GetVersionExA=kexbases.4
KERNEL32.GetVersionExW=kexbases.4
KERNEL32.CreateIoCompletionPort=kexbases.0
GDI32.GetRandomRgn=kexbases.0
GDI32.SetGraphicsMode=kexbases.0
GDI32.GetTextMetricsA=kexbases.0
GDI32.GetWorldTransform=kexbases.0
GDI32.ModifyWorldTransform=kexbases.0
GDI32.SetMapMode=kexbases.0
GDI32.SetWorldTransform=kexbases.1

[NT2K]
inherit=NT40
desc=Windows 2000 SP4

[NT2K.names]
KERNEL32.GetVersion=kexbases.4
KERNEL32.GetVersionExA=kexbases.5
KERNEL32.GetVersionExW=kexbases.5
KERNEL32.VerSetConditionMask=kexbases.0
KERNEL32.VerifyVersionInfoA=kexbases.0
KERNEL32.VerifyVersionInfoW=kexbases.0

[NOAC]
inherit=NT2K
desc=Win2000 SP4, no ActCtx (for MSVCRT 8+)

[NOAC.names]
KERNEL32.ActivateActCtx=none
KERNEL32.CreateActCtxA=none
KERNEL32.CreateActCtxW=none
KERNEL32.DeactivateActCtx=none
KERNEL32.FindActCtxSectionStringA=none
KERNEL32.FindActCtxSectionStringW=none
KERNEL32.ReleaseActCtx=none

[WINXP]
inherit=NT2K
desc=Windows XP SP2

[WINXP.names]
KERNEL32.GetVersion=kexbases.5
KERNEL32.GetVersionExA=kexbases.6
KERNEL32.GetVersionExW=kexbases.6
KERNEL32.VerifyVersionInfoA=kexbases.1
KERNEL32.VerifyVersionInfoW=kexbases.1
SHELL32.SHParseDisplayName=kexbasen.0

[VISTA]
inherit=WINXP
desc=Windows Vista

[VISTA.names]
KERNEL32.GetVersion=kexbases.7
KERNEL32.GetVersionExA=kexbases.8
KERNEL32.GetVersionExW=kexbases.8
KERNEL32.VerifyVersionInfoA=kexbases.3
KERNEL32.VerifyVersionInfoW=kexbases.3

[NOHEAP]
inherit=DCFG1
desc=Disable custom heap

[NOHEAP.names]
KERNEL32.HeapCreate=std
KERNEL32.HeapDestroy=std
KERNEL32.HeapAlloc=std
KERNEL32.HeapFree=std
KERNEL32.HeapSize=std
KERNEL32.HeapReAlloc=std

Other changes to note:

  • [ApiConfigurations] default=2
    "2" for SE, "3" for ME users; probably should be "0" to autoselect.
    Should NOT be "5" for 2K--we aren't 2K and at best can only partially fake it when absolutely necessary!
  • ComDlg32.PrintDlgEx overrides are in the Win95 section.
  • DCFG1 description changed to "Base enhancements" to avoid the confusing overuse of the term "default".
  • Make sure you have renamed Kstub822.dll to Kexstubs.dll :yes:

Edited by jumper
Link to comment
Share on other sites

SeaMonkey 2.0.14 works fine but OpenOffice crashes on start and the message box states Runtime Error R6034.

Do I have to use iphlpapi4 here ?

Edited by MiKl
Link to comment
Share on other sites

[*] Hex the MSVCRT 8 & 9 dll's to look for ActCxx instead of ActCtx

+ If ActCtx api's are missing, they work; so hex to look for something known to be missing

- might not fix all apps--others may need hexing, too, or help from (2.)

I read your unedited post yesterday and choose to do the above as the safest, most foolproof and almost 100% guaranteed to work immediately method.

At the end, I got an almost 100% fix for all the crashing programs I had after hexing out actctx strings in the following dlls I have in the winsys dir:

atl80.dll

mfc80.dll

mfc80d.dll

mfc80ud.dll

mfc90.dll

mfc90u

msvcr80.dll

msvr80d.dll

msvcr90.dll

msvcr90d.dll

vcomp.dll

vcomp90.dll

After doing this I had only 2 progs out of around 200 that still wouldn't run including K-Meleon 1.6. It turned out that they had those actctx strings in themselves, probably statically linked at compile with one of the above dlls, and hexing the strings out of the programs fixed them too.

So I have a perfect 100% fix for all the issues I had and can run my VST plugins relying on actctx functions.

:thumbup

I'll be reading up the rest you've written now.

Cheers.

Link to comment
Share on other sites

Thanks Jumper for the new solution but I am going to stick with the hexed crt80+ runtimes as it's done now, can't theoretically break anything and avoids me to have to put all the affected programs and any similar new ones I'll install in a specific compatibility mode.

Link to comment
Share on other sites


Iphlpapi wrapper

Usage without Kexstubs (or without KernelEx):

* Put a copy renamed to iphlpapi.dll in the folder with any app that needs it.

I did try that before trying to integrate it into KexStub but I get an error message that says:

C:\WINDOWS\SYSTEM\iphlpapi.dll : IpHlpDllEntry not found. (7b610000 0)

Presumably it does work only with the Windows 98SE version and not the ME one and I guess it wouldn't work with KexStub either.

Edited by loblo
Link to comment
Share on other sites

Btw I added a couple of minor definitions to my KexStub ini file:

[Kernel32.dll]

AttachConsole=f1

Works with Xaos 3.5 http://wmi.math.u-szeged.hu/xaos/doku.php

[sHELL32.DLL]

PathCleanupSpec=f1

Works with Lite Radio 2.3: http://hase85.wordpress.com/2013/01/30/light-radio-v2-3-released/

In both cases any values would work so I did put f1 for both at the end, I am not sure if it's optimal as I frankly can't figure out those return codes yet.

Link to comment
Share on other sites

SeaMonkey 2.0.14 works fine but OpenOffice crashes on start and the message box states Runtime Error R6034.

Do I have to use iphlpapi4 here ?

What did you do to make SeaMonkey 2.0.14 work fine?

What have you tried since you last reported this OpenOffice failure?

Set the compatibility mode on all MSVCR 8 and 9 dll's to "Win2000 SP4, no ActCtx (for MSVCRT 8+)". You can find them by searching for dll's containing the text "ActCtx" and by looking at loblo's list.

Iphlpapi4 might help and shouldn't hurt...Please report your findings.

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...