Not exactly a plugin

May 20, 2008
11,411
99
Syracuse, NY, USA
For a long time I have used a SHRALIAS.DLL which is loaded by PowerPro (via my logon script).

Recently I wrote an INJECTDLL.EXE which will cause any process (except the kernel) to load a specified DLL. In the process of doing that, I discovered (or at least was told) that it's safe to CreateThread() in DllMain (since the thread's entry point won't be called until DLL initialization is finished).

So, in principle, I could re-write SHRALIAS.DLL to work when loaded by any process. The ideal process would be Explorer since it's running at logon and stays running for the entire session. So a logon script could load all the shralias-protected lists and then inject SHRALIAS.DLL into Explorer.

Would anyone be interested in this?

At the moment there's no facility for unloading the DLL (and there might not be for a while.

Also, my SHRALIAS.DLL contains a (global) hotkey server and I have an external SHRHOTKEY.EXE to interface with it (some details below). Is anyone interested in that?

Code:
v:\> shrhotkey /?
Usage:  SHRHOTKEY [[Alt-][Ctrl-][Shift-][Win-]]<key> [<command> <directory>]

        Omit <command> and <directory> to remove a hotkey.

        <command> may be "**sendkeys**" with <directory> an arbitrary string

        SHRHOTKEY list (show hot keys)

    Unnamed keys: A-Z, a-z, 0-9, <space>, non-alphanumeric characters

    Named keys (case-insensitive):

        F1      F8      Left    Prior   BS      Enter   KP4     KP+
        F2      F9      Right   Next    Back    Return  KP5     KP-
        F3      F10     Home    Insert  Scroll  KP0     KP6     KP*
        F4      F11     End     Delete  Pause   KP1     KP7     KP/
        F5      F12     PgUp    Ins     Esc     KP2     KP8     KP.
        F6      Up      PgDn    Del     Screen  KP3     KP9     NumLock
        F7      Down    Tab     Space

v:\> shrhotkey list

Key: CTRL-ALT-F4
Command: d:\uty\monitor0.exe
Directory: d:\uty

Key: F9
Command: d:\uty\toggletcc.exe d:\tcmd10\tcc.exe
Directory: v:\
</space></directory></command></directory></command></directory></command></key>
 
May 20, 2008
3,515
4
Elkridge, MD, USA
vefatica wrote:
| For a long time I have used a SHRALIAS.DLL which is loaded by
| PowerPro (via my logon script).
|
| Recently I wrote an INJECTDLL.EXE which will cause any process
| (except the kernel) to load a specified DLL. In the process of
| doing that, I discovered (or at least was told) that it's safe to
| CreateThread() in DllMain (since the thread's entry point won't be
| called until DLL initialization is finished).
|
| So, in principle, I could re-write SHRALIAS.DLL to work when loaded
| by any process. The ideal process would be Explorer since it's
| running at logon and stays running for the entire session. So a
| logon script could load all the shralias-protected lists and then
| inject SHRALIAS.DLL into Explorer.

I presume the SHRALIAS.DLL is equivalent to SHRALIAS.EXE (or may even
be part of it). I use your SHRALIAS.EXE version which on unloading
automatically saves the global tables in ASCII files. I load it
during login by a transient TCC session. Being able to load it
without the transient session, esp. if it could create global tables
shared by all users (because it is loaded before login?), would be of
interest.

|
| Would anyone be interested in this?
|
| At the moment there's no facility for unloading the DLL (and there
| might not be for a while.

Major issue!

| Also, my SHRALIAS.DLL contains a (global) hotkey server and I have
| an external SHRHOTKEY.EXE to interface with it (some details below).
| Is anyone interested in that?

How does this method of hotkey definition differ from hotkeys on
desktop icons? By not needing a desktop icon?
--
Steve
 
May 20, 2008
11,411
99
Syracuse, NY, USA
I presume the SHRALIAS.DLL is equivalent to SHRALIAS.EXE (or may even
be part of it). I use your SHRALIAS.EXE version which on unloading
automatically saves the global tables in ASCII files. I load it
during login by a transient TCC session. Being able to load it
without the transient session, esp. if it could create global tables
shared by all users (because it is loaded before login?), would be of
interest.

| At the moment there's no facility for unloading the DLL (and there
| might not be for a while.

Major issue!

| Also, my SHRALIAS.DLL contains a (global) hotkey server and I have
| an external SHRHOTKEY.EXE to interface with it (some details below).
| Is anyone interested in that?

How does this method of hotkey definition differ from hotkeys on
desktop icons? By not needing a desktop icon?
--
Steve

Without the hotkey business SHRALIAS.DLL is equivalent to SHRALIAS.EXE. The EXE is Rex's; it doesn't use my DLL.

I suppose I'd have to make a special, ASCII, one for you. :-)

The global lists which SHRALIAS protects are user-particular; they can't be shared by different users. And only a Windows service could provide that functionality anyway. Writing a SHRALIAS service would be a tad difficult. I'm not going to do it. I suspect most **wouldn't** want those lists shared among users.

SHRALIAS has always been 24/7 for me. While I have a PowerPro script to unload it, I have never done so in the 5-6 years PPro has been loading SHRALIAS.DLL. So the lack of that functionality means nothing to me.

If you've injected a DLL into another process, there's no easy way to get the process to unload it. But I could write a little external (none too soon) to communicate with SHRALIAS.DLL and tell it to stop(/start) acting like SHRALIAS.

As for hotkeys, I imagine not needing a shortcut is the fundamental difference. I suppose Explorer, like my SHRALIAS, ultimately uses RegisterHotKey(). Explorer probably scans the desktop shortcuts initially and then makes changes as the user changes desktop shortcuts. My SHRALIAS loads initial ones from a file and makes changes according to user input from SHRHOTKEY.EXE.

FWIW, the whole thing works. I modified the DLL just a little, stopped telling PowerPro to load it, and put a single line in my logon script:

Code:
d:\uty\injectdll.exe %@pid[explorer.exe] d:\tcmd10\shralias.dll

It worked the first time (I like it when that happens).
 

samintz

Scott Mintz
May 20, 2008
1,503
16
Solon, OH, USA
What's the advantage of this vs. a dedicated SHRALIAS.EXE process that
does the same thing? Personally, I would prefer the dedicated process so
that I can see it when I run ProcessExplorer. An injected DLL is
essentially hidden (and virus like).

-Scott

vefatica <> wrote on 08/06/2009 08:21:12 PM:


> For a long time I have used a SHRALIAS.DLL which is loaded by
> PowerPro (via my logon script).
>
> Recently I wrote an INJECTDLL.EXE which will cause any process
> (except the kernel) to load a specified DLL. In the process of
> doing that, I discovered (or at least was told) that it's safe to
> CreateThread() in DllMain (since the thread's entry point won't be
> called until DLL initialization is finished).
>
> So, in principle, I could re-write SHRALIAS.DLL to work when loaded
> by any process. The ideal process would be Explorer since it's
> running at logon and stays running for the entire session. So a
> logon script could load all the shralias-protected lists and then
> inject SHRALIAS.DLL into Explorer.
>
> Would anyone be interested in this?
>
> At the moment there's no facility for unloading the DLL (and there
> might not be for a while.
>
> Also, my SHRALIAS.DLL contains a (global) hotkey server and I have
> an external SHRHOTKEY.EXE to interface with it (some details below).
> Is anyone interested in that?
>
>
> Code:
> ---------
> v:\> shrhotkey /?
> Usage: SHRHOTKEY [[Alt-][Ctrl-][Shift-][Win-]]<key> [<command>
<directory>]

>
> Omit <command> and <directory> to remove a hotkey.
>
> <command> may be "**sendkeys**" with <directory> an arbitrary
string

>
> SHRHOTKEY list (show hot keys)
>
> Unnamed keys: A-Z, a-z, 0-9, <space>, non-alphanumeric characters
>
> Named keys (case-insensitive):
>
> F1 F8 Left Prior BS Enter KP4 KP+
> F2 F9 Right Next Back Return KP5 KP-
> F3 F10 Home Insert Scroll KP0 KP6 KP*
> F4 F11 End Delete Pause KP1 KP7 KP/
> F5 F12 PgUp Ins Esc KP2 KP8 KP.
> F6 Up PgDn Del Screen KP3 KP9 NumLock
> F7 Down Tab Space
>
> v:\> shrhotkey list
>
> Key: CTRL-ALT-F4
> Command: d:\uty\monitor0.exe
> Directory: d:\uty
>
> Key: F9
> Command: d:\uty\toggletcc.exe d:\tcmd10\tcc.exe
> Directory: v:\
> ---------
>
</space></directory></command></directory></command></directory></command></key>
 
May 20, 2008
11,411
99
Syracuse, NY, USA
On Fri, 07 Aug 2009 14:48:22 -0500, samintz <> wrote:

|What's the advantage of this vs. a dedicated SHRALIAS.EXE process that
|does the same thing? Personally, I would prefer the dedicated process so
|that I can see it when I run ProcessExplorer. An injected DLL is
|essentially hidden (and virus like).

I'm exactly the opposite. I don't like lots of processes running. Besides that
personal preference there's little practical difference.

With ProcessExplorer I can see that Explorer has handles to the likes of
"\BaseNamedObjects\SharememUAliasvefatica". With Depends.exe (or ListDlls.exe)
I can see that Explorer has loaded my DLL. It's only hidden in that it doesn't
appear as a process.
--
- Vince
 
Similar threads
Thread starter Title Forum Replies Date
Joe Caverly 64-bit Plugin development using PureBasic Plugins 15
R New Plugin Plugins 0
Alpengreis elevated plugin questions Plugins 3
fpefpe utf-8 support in sdk/plugin api Plugins 4
S How to? Can @DU function in 4Utils64 plugin somehow cater for dirs with spaces? Plugins 3
vefatica Plugin access to arrays? Plugins 4
vefatica How big is a plugin's parameter buffer? Plugins 5
C @knownpath plugin Plugins 0
Charles Dye Updated OSD plugin Plugins 0
Joe Caverly C# plugin framework for JPSoft's TCC Plugins 0
dcantor Help for newest version of TEXTUTILS plugin Plugins 10
dcantor UISTUFF plugin missing help topic Plugins 12
M How to? Use SafeChars plugin... Plugins 2
dcantor Error in SAFECHARS plugin v 1.9.0 Plugins 2
dcantor Request for documentation for ISO8601 plugin Plugins 4
vefatica Possible with a plugin? Plugins 6
dcantor Inconsistency between textutils plugin and wrap utility Plugins 2
M (Stupid?) Problem with 64-bit 4Utils plugin... Plugins 3
H Latest ISO8601 plugin? Plugins 1
Charles Dye New plugin: QKeys Plugins 34
S Plugin to quickly locate all files hard linked together Plugins 5
S Documentation Plugin everything.dll Plugins 5
newbie How to? Multi-plugin installation errors, Re: FedUtils8 Plugins 7
vefatica Plugin -> thread -> Command() -> Ctrl-C? Plugins 20
Charles Dye A weirdoid plugin question Plugins 6
M SafeChars plugin misbehaving... Plugins 3
M A weird error re a plugin... Plugins 0
vefatica Plugin dilemma Plugins 2
fpefpe Documentation Plugin API/SDK Plugins 3
C Looking for Vince's old 4UTILS plugin for TCMD v8 Plugins 1
S DESKTOP plugin - anyone ? Plugins 0
C How to? a plugin to sort Outlook Express "rules" Plugins 0
M ISO Plugin: Yes, it's wonderful, but it could be yet more wonderful... Plugins 7
M The ISO plugin is wonderful, but it lacks a little something... Plugins 22
Charles Dye Beta plugin: HidePasswords Plugins 3
M ISO8601 Plugin not "reporting" errors to TCC... Plugins 4
Frank 4console plugin Plugins 4
S WAD ISO8601 Plugin Plugins 15
Joe Caverly Plugin and 64-bit TCC Plugins 3
C Problem with FixNames plugin Plugins 9
dcantor Suggestion and request for DBF plugin Plugins 6
dcantor Suggestion for SafeChars plugin Plugins 7
M Charles, I just installed the "new" SafeChars plugin, ... Plugins 5
M A problem with the SafeChars Plugin... Plugins 30
S WHICHWIN (sysutils plugin) Plugins 13
M A (presumbly pretty simple) SafeChars plugin request... Plugins 2
M A "SafeChars" plugin request... Plugins 2
S ISO 8601 plugin enhancement Plugins 6
D UNKNOWN_CMD in Plugin Plugins 13
C Looking for isemailaddress[string] plugin Plugins 7

Similar threads