Is there a way for an application on a 64-bit version of Windows to execute code under both the 64-bit and 32-bit emulation levels?

I am wondering if I can write an application that can call some code without an emulation layer and some code inside a 32-bit emulation level.

The main reason is that I will need to use the SetWindowHook API, and I want to set the binding for both 64-bit and 32-bit applications.

Of course, I can create 2 applications (one for 32 bits and another for 64 bits) and run them simultaneously. However, I will need more code to control them (start, stop, update, etc.).

So, I look, is it even possible to have one application.

The only idea I have is to have one application and 2 COM-DLLs (32 bits and 64 bits) and use a surrogate process to run 32 bit code. However, this will require additional COM wrappers, etc.

+3
source share
4 answers

, 64- . , , , 0x12345678aa000000. 32- , 32- . , 32 . , 0x00000000aa000000 32- . , , , , .

, . , , x86 x64, 32- , , 64- 64- , , , 32- , 32- .

, 32- , UBER UGLY.

+1

, , , , ​​ . , :

http://www.pretentiousname.com/NoBarTab/NoBarTab_poc3.zip

( URL- , , , , .)

VS2010 ++, IDE. ( VS2010 , .)

, , , . (- "NoBarTab" .)

FWIW, , , . . , Windows 7. ( , VMware, .) , ...

32/64- . , , , , , , .

( , , Win7, Windows. , . , , "".)

, , 64- exe. 32- EXE 32- DLL-, 32- 64- DLL- 64- exe- . , , , , , , .

, !

+5

SetWinEventHook - API- , 32-/64- . , , , . @atzz .

, SetWinEventHook, SetWindowsHookEx , . ( , , NoBarTab , API. .)

+3

I think your only hope is to do this through something like COM outside the process, because each process should be all 32 bits or all 64 bits.

0
source

Source: https://habr.com/ru/post/1777102/


All Articles