Page 7 of 14

Re: Services, Stuff, and Shellhook

Posted: Fri May 05, 2017 3:49 am
by RichAlgeni
I will do so! Thanks for the heads up!!

Re: Services, Stuff, and Shellhook

Posted: Fri May 05, 2017 4:01 am
by RichAlgeni
Looks like the InflateDeflate link is going to your hide video source?

Re: Services, Stuff, and Shellhook

Posted: Fri May 05, 2017 4:22 am
by JHPJHP
Hi RichAlgeni,

Sorry about that, there were a few downloads with the links crossed. I have tested and confirmed that all the links now point to the correct package.

Thank you for letting me know.

Re: Services, Stuff, and Shellhook

Posted: Fri May 05, 2017 6:02 pm
by RichAlgeni
Thanks!

Re: Services, Stuff & Shellhook

Posted: Thu Nov 30, 2017 12:50 am
by JHPJHP
Updated:
- Stuff\ISAPI\...

TESTED:
- Windows 10
- PureBasic 5.61 (x86 / x64)

This example was added after reading this thread: http://www.purebasic.fr/english/viewtop ... 13&t=69661

The Include file was written from scratch, but the example was based on the following work by freak: http://www.purebasic.fr/english/viewtop ... 12&t=57127
freak wrote:1.Install IIS using Control Panel -> Programs and Features -> Turn Windows features on or off
2.Make sure at least the following components are selected:
◦Internet Information Services
◦Internet Information Services -> Web Management Tools -> IIS Management Console
◦Internet Information Services -> World Wide Web Services Application Development Features -> ISAPI Extensions

3.After the installation, type "localhost" in your browser. A page with the IIS logo should come up if IIS is installed
4.Compile the example to a dll and place it in "C:\inetpub\wwwroot\IsapiExample.dll".
◦Note that you probably cannot compile directly to the folder due to permissions, so compile somewhere else and then move the file there with explorer.
◦If your system is 64bit, you should compile the dll using PBx64. You can run 32bit ISAPI extensions, but it requires extra configuration and I did not actually try that.

5.Open "Internet Information Services (IIS) Manager" from the Startmenu
6.Select the root of the tree on the left and then open "Handler Mappings" in the main view
7.Select the entry named "isapi-dll", right-click and select "Edit..."
8.In the "Executable" field, enter "C:\inetpub\wwwroot\IsapiExample.dll"
9.Click "Request Restrictions" and on the "Access" tab make sure "Execute" is selected. Hit ok on the second dialog.
10.Hit ok on the first dialog. A requester is shown asking if you want to allow the extension. Click "Yes".
◦What this does is create an entry under "ISAPI and CGI restrictions" on the main page. You can also add an entry there manually or later allow/deny an extension there

11.In your browser, open "http://localhost/IsapiExample.dll". If all worked right, you should see the example page generated by the dll.

Re: Services, Stuff & Shellhook

Posted: Thu Nov 30, 2017 7:32 pm
by swhite
Hi

I am using a script map (*.dcpay) to load my dll. It does not matter what you use for a script map as long as it is unique. The URL can be anything you want as long as the action ends with the script map. So in my case I called the action dcpayment.dcpay. The important part is the .dcpay which is mapped to my dll in IIS.

In IIS I enabled the script map for the default site under Handler Mappings and I added a new script map and set the access to "execute". I also removed the restriction under mappings that ties the request to a physical file (i.e. dcpayment.dcpay does not need to exist for the request to run).

Perhaps this might be helpful to support multiple ISAPI extensions.

Simon

Re: Services, Stuff & Shellhook

Posted: Thu Nov 30, 2017 8:57 pm
by RichAlgeni
To handle multiple extensions, I created an 'isapi' directory, then sub-directories for each handler.

One more note, Windows 2012r2 is so much better at handling changes in IIS Manager. I had numerous issues when I changed handlers in Windows 2008. To the point where IIS would no longer recognize handler mappings, even after I uninstalled and reinstalled IIS.

Re: Windows Services & Other Stuff

Posted: Sat Dec 08, 2018 2:04 am
by JHPJHP
Updated:
- Other_Stuff\OtherStuff\SetWindowsHookEx\
-- binaries\SetWindowsHookEx_32.dll, SetWindowsHookEx_64.dll
-- SetWindowsHookEx.pb, SetWindowsHookEx_DLL.pb
- RegisterShellHookWindow.pb

SetWindowsHookEx.pb:
- if the window you want to effect was created from a 32 bit process, execute this file from PureBasic x86
- if the window you want to effect was created from a 64 bit process, execute this file from PureBasic x64

RegisterShellHookWindow.pb:
- not effected by the process the window was created in

While performing cursory tests in Windows 10, I observed the following while opening a variety of applications:
- File Explorer moved to the set position before the Window was visible
- UltraEdit moved to the set position after the Window was visible
- Calculator did not respond to the SetWindowPos Function

NB*: Replace "File Explorer" in the CallWndProc / WindowProc Procedure to suit your needs.

Re: Windows Services & Other Stuff

Posted: Mon Feb 04, 2019 8:40 pm
by JHPJHP
Updated:
- various examples and optimizations

Since my last post to this thread there have been numerous additions and improvements to existing examples.

Added Today:
- \Other_Stuff\MonitorStuff\
-- ScaleFactor.pb, SetDpiAwareness.pb, WindowsDpiStuff.pb

NB*: Most of the new additions and improvements can be found peppered throughout my other downloads.

Re: Windows Services & Other Stuff

Posted: Sun Mar 31, 2019 8:35 am
by oreopa
Thanx for all your stuff. I found #WM_COPYDATA example very helpful. Appreciate it.

Re: Windows Services & Other Stuff

Posted: Sun Mar 31, 2019 11:38 pm
by JHPJHP
Hi oreopa,

Thank you for posting. It is nice to hear the work I have done is appreciated.

NB*: Since my last post to this thread there have been numerous additions and improvements to existing examples.

Re: Windows Services & Other Stuff

Posted: Mon Apr 01, 2019 12:25 am
by RichAlgeni
Is that your real picture JHPJHP???

Re: Windows Services & Other Stuff

Posted: Mon Apr 01, 2019 3:48 pm
by JHPJHP
Hi RichAlgeni,

Are you referring to my avatar :?:

Image

NB*: Drag & Drop my avatar onto Google image search: https://www.google.com/imghp?hl=EN

Re: Windows Services & Other Stuff

Posted: Mon Apr 01, 2019 10:06 pm
by RichAlgeni
:lol:

Re: Windows Services & Other Stuff

Posted: Tue Nov 12, 2019 2:30 pm
by Wolf
Many thanks @JHPJHP for your great codes especially "CopyData" and "ShareMemory"
I tested "CopyData" with big unicode text and it worked great :wink: