[WCX] Wcx6432: 64-to-32 bit WCX plugin wrapper

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: Stefan2, white, sheep, Hacker

User avatar
MVV
Power Member
Power Member
Posts: 8239
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

[WCX] Wcx6432: 64-to-32 bit WCX plugin wrapper

Post by *MVV » 2016-06-14, 07:42 UTC

Wcx6432 allows using 32-bit WCX plugins in 64-bit TC.

Wcx6432 Beta 240


Installation:

1. Extract to any directory.
2. Put file Wcx6432.ini to TC directory and fix paths to wrapper files in it.
3. Copy Wcx6432.wcx64 to desired 32-bit WCX plugin folders and rename to match plugin file names (e.g. in case of MSI-Plus.wcx plugin loader should be renamed to MSI-Plus.wcx64).


How does it work:

TC loads small loader Wcx6432.wcx64 which reads Wcx6432.ini and loads Wcx6432 client (Wcx6432c.dll), then client starts Wcx6432 server (Wcx6432s.exe) and establishes connection with it. Server loads 32-bit plugin and calls its functions when TC calls these functions from wrapper. So only the small loader have to be copied to multiple places, the rest files are in the only location and may be easilly updated.

It is currently in beta state, not all functions are supported.
Most functions are supported. The only unsupported ones are memory-packing functions.
Perhaps some functions/callbacks may not work properly because I couldn't tested them with my test plugins.


Technical details regarding supported functions:

Loader exports all WCX interface functions and this causes a side effect: TC thinks that plugin supports everything. E.g. it calls only unicode and extended function versions (ReadHeaderExW instead of ReadHeaderEx or ReadHeader). Therefore such function calls are translated to calls of functions that plugin really supports, otherwise default value or errors returned.

Following functions are wrapped:
PackSetDefaultParams
PkSetCryptCallback
SetChangeVolProcW
SetChangeVolProc
SetProcessDataProcW
SetProcessDataProc
OpenArchiveW
OpenArchive
ReadHeaderExW
ReadHeaderEx
ReadHeader
ProcessFileW
ProcessFile
CloseArchive
PackFilesW
PackFiles
DeleteFilesW
DeleteFiles
GetPackerCaps
GetBackgroundFlags
ConfigurePacker
CanYouHandleThisFileW
CanYouHandleThisFile

Following functions are not wrapped yet:
StartMemPackW
StartMemPack
PackToMem
DoneMemPack

In order to test all functions I need test plugin set with plugins that export all functions. Currently I'm using:
1. MSI-Plus (non-unicode, exports ReadHeader, calls cbProcessDataProc every 1024 bytes).
2. Total7zip (unicode, exports ReadHeaderExW, unpacks in CloseArchive so calls cbProcessDataProc with negative values, supports background packing/unpacking, has options dialog).
N. I think DiskDirExtended should be added to the set (non-unicode, exports ReadHeaderEx).

I'm not aware of plugins that export PkSetCryptCallback function.
Also I'm not aware of plugins that really call SetChangeVolProc callback.
And I need a plugin example that uses memory packing.
Last edited by MVV on 2018-01-09, 07:11 UTC, edited 20 times in total.

User avatar
deus-ex
Power Member
Power Member
Posts: 739
Joined: 2003-02-10, 17:45 UTC

Post by *deus-ex » 2016-06-14, 08:46 UTC

Is there any reliable way to check whether a plugin supports the functions you mention? If so, I could assist checking available plugins for these and report any matches to support your research.
Best regards
deus-ex

User avatar
MVV
Power Member
Power Member
Posts: 8239
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2016-06-14, 08:52 UTC

I think that PkSetCryptCallback function should only be exported by plugins that really use it since this function is not required. So PE viewer should help here, also just searching for PkSetCryptCallback string may help.

Memory packing functions (StartMemPackW, StartMemPack, PackToMem, DoneMemPack) should also be only exported by plugins that really use it.

SetChangeVolProc function is required so most plugins only export it but ignore its calls. So we need some plugin that supports multi-volume packing... But I don't know how to check reliably that plugin really uses it. Perhaps we can just take some plugin sources and add support for this function for tests.

User avatar
deus-ex
Power Member
Power Member
Posts: 739
Joined: 2003-02-10, 17:45 UTC

Post by *deus-ex » 2016-06-14, 09:35 UTC

MVV wrote:I think that PkSetCryptCallback function should only be exported by plugins that really use it since this function is not required. So PE viewer should help here, also just searching for PkSetCryptCallback string may help.
Found a few candidates that possibly(*) support PkSetCryptCallback:
* = referring to the plugin feature description

· http://www.kryptel.com/articles/total_commander.php
· http://totalcmd.net/plugring/kryptel.html
· http://ghisler.fileburst.com/fsplugins/ado.zip
· http://totalcmd.net/plugring/ZPAQ.html
· http://totalcmd.net/plugring/totalsqx.html
· http://totalcmd.net/plugring/PUZZLE.html
· http://totalcmd.net/plugring/darkcrypttc.html
· http://totalcmd.net/plugring/wcx_aes.html
· http://totalcmd.net/plugring/7Zip.html
· http://totalcmd.net/plugring/7zip_plugin.html
· http://totalcmd.net/plugring/rarfh.html
· http://totalcmd.net/plugring/new_unalz_wcx.html
· http://totalcmd.net/plugring/unalz_wcx.html
· http://totalcmd.net/plugring/redjpeg.html
· http://totalcmd.net/plugring/stegotc.html
· http://totalcmd.net/plugring/stegotc2.html
SetChangeVolProc function is required so most plugins only export it but ignore its calls. So we need some plugin that supports multi-volume packing...
This plugin supports multi-volume archive creation (no encryption):

· http://totalcmd.net/plugring/zar.html
Best regards
deus-ex

TW
Senior Member
Senior Member
Posts: 337
Joined: 2005-01-19, 13:35 UTC

Post by *TW » 2016-06-14, 10:44 UTC

i'm definitely interested in this. :)

if only the download wouls work. not even in IE it does, sadly.

thanks a lot... once more.
licenced and happy TC user since 1994 (#11xx)

User avatar
deus-ex
Power Member
Power Member
Posts: 739
Joined: 2003-02-10, 17:45 UTC

Post by *deus-ex » 2016-06-14, 11:05 UTC

Try this alternate download host for Wcx6432_100.cab: http://ge.tt/6S5BTQb2
Best regards
deus-ex

TW
Senior Member
Senior Member
Posts: 337
Joined: 2005-01-19, 13:35 UTC

Post by *TW » 2016-06-14, 11:09 UTC

ah, that works better, thanks. never had problems at yadi.sk before.

here's another mirror: http://vicebuilds6.bplaced.net/Wcx6432_100.cab

now let's do some tests.
licenced and happy TC user since 1994 (#11xx)

User avatar
deus-ex
Power Member
Power Member
Posts: 739
Joined: 2003-02-10, 17:45 UTC

Re: [WCX] Wcx6432: 64-to-32 bit WCX plugin wrapper

Post by *deus-ex » 2016-06-14, 11:17 UTC

MVV wrote:Wcx6432 allows using 32-bit WCX plugins in 64-bit TC.

Wcx6432 Beta 100
Hi MVV,

you are wrapping 32-bit plugins to 64-bit, so I'd rather expect the order of the figures the other way arround. For example something like Wcx32to64host, I think this explains the purpose of your plugin more clearly.

I tested your wrapper and observed the following. Currently the wrapper seems only to be able to support one plugin at run time. For example, I have copied & setup the wrapper for MSI-Plus.wcx and CHMDir.wcx. When entering into an MSI-file, I cannot enter into an CHM-file during the same TC session. I have to restart TC to be able to enter into an CHM-file, and then I cannot enter into an MSI-file anymore until I restart TC.

Also I setup the wrapper for GAUP_Pro.wcx. The wrapper does not seem to be working with this plugin. For example trying to enter into a DOOM WAD-file does not do anything.


Slightly improved installation procedure:

1. Extract Wcx6432 Beta 100 to any directory (e.g. %commander_path%\wcx\wcx6432\)
2. Copy wcx6432.ini into TC's main folder and adjust the paths accordingly.

wcx6432.ini

Code: Select all

[Wcx6432]
Client=%COMMANDER_PATH%\wcx\wcx6432\wcx6432c.dll
Server=%COMMANDER_PATH%\wcx\wcx6432\wcx6432s.exe
3. Copy wcx6432.wcx64 into the desired 32-bit WCX plugin folder.
4. Rename the copied wcx6432.wcx64 to match the filename of the 32-bit plugin.

    For example for MSI-Plus.wcx: rename wcx6432.wcx64 to msi-plus.wcx64.


[EDIT:] Added first test review, added suggestion for improved installation procedure, fixed grammar
Last edited by deus-ex on 2016-06-14, 16:00 UTC, edited 5 times in total.
Best regards
deus-ex

User avatar
MVV
Power Member
Power Member
Posts: 8239
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Re: [WCX] Wcx6432: 64-to-32 bit WCX plugin wrapper

Post by *MVV » 2016-06-14, 12:17 UTC

I've just realized that shared client DLL may not work now (because initializer will be executed only once), so you may need to use separate copies of Wcx6432c.dll together with separate Wcx6432.wcx64.ini files near each loader to make it working... until I fix it or get rid of loader. :(
deus-ex wrote:you are wrapping 32-bit plugins to 64-bit, so I'd rather expect the order of the figures the other way arround. For example something like Wcx32to64host, I think this explains the purpose of your plugin more clearly.
Actually 6432 is because of the Windows thing: Wow6432Node is for 32-bit soft under 64-bit system. :D

And thank you for list of plugins, I'll try them.

User avatar
deus-ex
Power Member
Power Member
Posts: 739
Joined: 2003-02-10, 17:45 UTC

Post by *deus-ex » 2016-06-14, 12:24 UTC

Hi MVV,

I was just editing my previous post when you added a reply. Please check my previous post for added information.
Best regards
deus-ex

User avatar
MVV
Power Member
Power Member
Posts: 8239
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2016-06-14, 12:28 UTC

I've just answered your question regarding multiple instances... and added extra installation step to first post (hidden feature may help here).
Unfortunately I will need to merge Wcx6432.wcx64 with Wcx6432c.dll.
Last edited by MVV on 2016-06-14, 12:31 UTC, edited 1 time in total.

User avatar
deus-ex
Power Member
Power Member
Posts: 739
Joined: 2003-02-10, 17:45 UTC

Post by *deus-ex » 2016-06-14, 12:31 UTC

Yes, I just saw you did the same, i.e. you edited your post while I posted an reply.

Is the installation step no. 2 still required, after you updated the installation process (red text)?
Best regards
deus-ex

User avatar
MVV
Power Member
Power Member
Posts: 8239
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV » 2016-06-14, 12:36 UTC

You will still need an INI for the client module so it is required (otherwise you will need to create separate INI files for every client module too).

User avatar
deus-ex
Power Member
Power Member
Posts: 739
Joined: 2003-02-10, 17:45 UTC

Post by *deus-ex » 2016-06-14, 12:46 UTC

Ok, understood. If you find the time, can you please check why the GAUP plugin does not work with your wrapper? It does work with the wrapper decTC32HostSetup by Dec.
Best regards
deus-ex

TW
Senior Member
Senior Member
Posts: 337
Joined: 2005-01-19, 13:35 UTC

Post by *TW » 2016-06-14, 14:36 UTC

it seems i'm too stupid to get it running for more than 1 plugin. :?
as soon as i use one, the next one doesn't work.

what i did:

- copy Wcx6432.ini to TC main dir, edited paths to:

[Wcx6432]
Client=%COMMANDER_PATH%\PLUGINS\WCX\Wcx6432\Wcx6432c.dll
Server=%COMMANDER_PATH%\PLUGINS\WCX\Wcx6432\Wcx6432s.exe
- copy the other files to the plugin dir, it looks like this:
msi-plus.wcx64.ini
Wcx6432c.dll
msi-plus.wcx64
msi-plus.wcx
the msi-plus.wcx64.ini contains:
[Wcx6432]
Client=%COMMANDER_PATH%\PLUGINS\WCX\msi\Wcx6432c.dll
Server=%COMMANDER_PATH%\PLUGINS\WCX\Wcx6432\Wcx6432s.exe
what's wrong with my ini files?
licenced and happy TC user since 1994 (#11xx)

Post Reply