It is currently Sun Dec 15, 2019 3:59 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 105 posts ]  Go to page 1, 2, 3, 4, 5 ... 7  Next
Author Message
 Post subject: Windows Services & Other Stuff
PostPosted: Sun Nov 02, 2014 6:21 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1597
-----------------------------------------------------------------------------------

Download Windows Services & Other Stuff from My PureBasic Stuff

-----------------------------------------------------------------------------------

Tricks 'n' Tips
PureBasic Interface to OpenCV
PureBasic Interface to WinDivert
PureBasic Interface to WinRAR
PureBasic Interface to 7-Zip
PureBasic Interface to ImDisk
Windows Services & Other Stuff
Invading Space Aliens
Death Star vs Asteroids
GIF Toolkit
LSB File Embedding
Spider Web Drawing
Deform Image: MLS
Video Snipping Tool
Stitch Images: SIFT
Image Waves: LUT
YouTube Player & Downloader
MP4 Player & Downloader
Barcode Generator
Embed JS into PureBasic
Geolocation: Google Maps
Book & Viewer & Magnify
Video for Windows: VfW
Alternate Console
Network Share Management

-----------------------------------------------------------------------------------

WINDOWS SERVICES
- includes\WindowsServices.pbi (ServiceStatusEnum, ServiceCreate, ServiceDelete, ServiceStatus, ServiceStartup, ServiceStart, ServiceStop)
- binaries\TestWindow_EXE.pb, TestWindow.exe: example program run as a service
- binaries\TestService_EXE.pb, TestService.exe: example service used to execute TestWindow.exe
- CreateService.pb: example to create a service
- StartStopService.pb: example to stop then start a service

-----------------------------------------------------------------------------------

OTHER STUFF
- AESEncryption: AES_CipherBuffer.pb, AES_EncoderDecoder.pb
- AlternateDataStream: ADS.pb
- AmazonWebServices: AWS.pb
- AnimatedGIF: MovableSpriteObject.pb, UseGIFImageDecoder.pb, WebGadgetGIF.pb
- BrowserCache: CacheChrome.pb, CacheExplorer.pb

- CopyShare
-- CopyData\Text_Receive.pb, Text_Send.pb
-- ShareMemory\Image\1. Send.pb, 2. Receive.pb
-- ShareMemory\Text\1. Send.pb, 2. Receive.pb

- CriticalFlag: CriticalFlag.pb
- DigitalClock: DigitalClock.pb
- FileDates: FileDates.pb
- GadgetBar: GadgetBar.pb

- GadgetStuff: Explorer_Thumbnail.pb, Reset_Window.pb, TreeGadget_Sync.pb
-- CanvasGadget\CanvasImageButton_1.pb, CanvasImageButton_2.pb
-- ListIconGadget\MoveMultiple.pb, MultiLineImage.pb
-- WebGadget\ImageSize.pb, NoScroll.pb, VideoInfo.pb

- GetUsage: GetUsage.pb

- HideVideo
-- AlternateDataStream\CreateADS.pb, ExtractADS.pb
-- DataSection\DataSection.pbi, PlayVideo.pb

- ImageWindow: ImageWindow.pb
- InflateDeflate: InflateDeflate.pb

- ISAPI: ISAPI_Test.pb
-- binaries\ ISAPI_Test_32.dll, ISAPI_Test_64.dll
-- includes\ ISAPI.pbi
-- references\ HttpExt.h

- ManifestResource: SetManifest.pb
- MemoryFolder: MemoryFolder.pb
- MonitorStuff: ChangeDisplayOrientation.pb, GetAutoRotationState.pb, GetMonitorInfo.pb, ScaleFactor.pb, SetDpiAwareness.pb, WindowsDpiStuff.pb
- MountImage: MountImage.pb
- Odometer: Odometer.pb

- OpenGLStuff
-- RotateDice\RotateDice.pb

- OtherStuff
-- GetProgramData\GetProgramData.pb
-- SetWindowsHookEx\SetWindowsHookEx.pb, SetWindowsHookEx_DLL.pb
-- Base64ImagePB.pb, BringWindowToTop.pb, CompressUncompress.pb, ConnectUNC.pb, CryptQueryObject.pb, DisableClose.pb, EnumerateWindows.pb, FileSecurity.pb, FormatDevice.pb,
-- GetExternalIP.pb, GetFileVersion.pb, GetFolderSize.pb, GetProductKey.pb, GlobalKeyboardHook.pb, GlobalMouseHook.pb, Grayscale.pb, IsOS64Bit.pb, MapDrive.pb,
-- PlotCurve.pb, Power2Bitwise.pb, RecordMic.pb, RegisterShellHookWindow.pb, RunScriptCMD.pb, SetProgressState.pb, TimedMessageBox.pb

- PowerShell: SendHtmlEmail.pb
-- RestorePoints\RestorePoints.pbi, CreateShowDelete.pb

- PrinterStuff
-- PrinterStuff.pbi, AddMonitor.pb, DeleteMonitor.pb, AddPort.pb, DeletePort.pb, GetDriver.pb, AddDriver.pb, DeleteDriver.pb,
-- UploadDriverPackage.pb, InstallDriverPackage.pb, DeleteDriverPackage.pb, AddPrinter.pb, DeletePrinter.pb, SetSecurity.pb,
-- EnumerateMonitors.pb, EnumeratePorts.pb, EnumeratePrinters.pb, EnumerateDrivers.pb
-- MS_PS_CD_V3\... (required by AddDriver.pb)
-- MS_PS_CD_V4\... (required by UploadDriver.pb)

- ProcessStuff: GetProcessCL.pb, GetProcessList.pb, GetProcessPath.pb
-- CallingProcess\process.dll, process.exe, process_dll.pb, process_exe.pb
-- ParentProcess\ParentProcess.exe, GetParentProcess.exe, ParentProcess.pb, GetParentProcess.pb
-- RunProcess\Elevated.pb, RPAS.pb (Run Process As SYSTEM)
-- RunProcess\binaries\RPAU-EXE.pb (Run Process As User)

- ProtocolStuff: FTP.pb, HTTP.pb, Telnet.pb
- RotateImage: RotateImage.pb
- ScreenCapture: CaptureDesktopAll.pb, ScreenCapturePlus.pb
- SelectedItems: SelectedItems.pb
- SendToNotepad: SendToNotepad.pb
- SQLiteDatabase: ATTACH.pb, RTF2BLOB.pb, SELECT.pb, UPDATE.pb
- WebSnapshot: WebSnapshot.pb
- WolframAlpha: WolframAlpha_1.pb, WolframAlpha_2.pb
- XMLStuff: GetXMLNodes.pb

_________________

I will be unreachable from the forum for an indefinite period; downloads moved to My PureBasic Stuff.
_________________


Last edited by JHPJHP on Fri Oct 11, 2019 1:08 am, edited 319 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Services, Stuff, and Shellhook
PostPosted: Sun Nov 02, 2014 11:37 pm 
Offline
Enthusiast
Enthusiast

Joined: Mon Aug 19, 2013 3:28 pm
Posts: 256
Sweet, is there a way this can be used for example to check whether 2 same processes are open at once?


Top
 Profile  
Reply with quote  
 Post subject: Re: Services, Stuff, and Shellhook
PostPosted: Mon Nov 03, 2014 2:03 am 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1597
Hi Mythros,

Stuff Folder:
- GetProcessPath.pb can be used to check for a running PATH\executable
- ProcessList.pb can be used to check for a running executable

Shellhook Folder
- shellhook.pb includes the following FindWindow Procedure
Code:
Procedure FindWindow(WindowName.s)
  Protected hWnd

  hWnd = GetWindow_(GetDesktopWindow_(), #GW_CHILD)

  Repeat
    winCaption.s = Space(#MAX_PATH)
    GetWindowText_(hWnd, winCaption, #MAX_PATH)

    If Len(Trim(winCaption)) > 0
      If FindString(winCaption, WindowName) > 0 : Break : EndIf
    EndIf
    hWnd = GetWindow_(hWnd, #GW_HWNDNEXT)
  Until hWnd = 0
  ProcedureReturn hWnd
EndProcedure

hWnd = FindWindow("Window Watcher")

If hWnd
  MessageBox_(hWnd, "The application is already running.", "Window Watcher", #MB_ICONWARNING)
EndIf

Another option may be to use either the CreateMutex or FindWindow function.
- CreateMutex: http://msdn.microsoft.com/en-us/library/windows/desktop/ms682411(v=vs.85).aspx
-- test for: GetLastError = ERROR_ALREADY_EXISTS
- FindWindow: http://msdn.microsoft.com/en-us/library/windows/desktop/ms633499(v=vs.85).aspx
-- test for: return value NOT NULL

_________________

I will be unreachable from the forum for an indefinite period; downloads moved to My PureBasic Stuff.
_________________


Last edited by JHPJHP on Thu Nov 20, 2014 2:10 am, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Services, Stuff, and Shellhook
PostPosted: Tue Nov 18, 2014 7:49 am 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1597
Updated the Services scripts to be more intuitive and easier to use.

See the first post for a more in-depth description.

Cheers!

_________________

I will be unreachable from the forum for an indefinite period; downloads moved to My PureBasic Stuff.
_________________


Top
 Profile  
Reply with quote  
 Post subject: Re: Services, Stuff, and Shellhook
PostPosted: Tue Nov 18, 2014 9:10 am 
Offline
Moderator
Moderator
User avatar

Joined: Sat Apr 26, 2003 1:11 am
Posts: 1390
thx a lot

_________________
SPAMINATOR NR.1


Top
 Profile  
Reply with quote  
 Post subject: Re: Services, Stuff, and Shellhook
PostPosted: Sun Nov 23, 2014 5:52 am 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1597
Hi Rings,

You're welcome, and thank you for your many positive comments across my "Tricks 'n' Tips" posts.

--------------------------------------

The following are some simple examples that may help a beginner with learning PureBasic:
- updated the Stuff folder

Added 3 additional script files and 1 image file.
- GlobalKeyboardHook.pb: global keyboard hook capturing keystrokes
-- currently set to capture: A - Z, ESC to quit
- RotateImage.pb: 90, 180, 270, and flip
-- logo.jpg: image used by: RotateImage.pb
- TreeGadget_Sync.pb: 2 TreeGadget's synced

--------------------------------------

Here is another example added to the Stuff folder.
- ADS.pb: (Windows) Alternate Data Streams
-- http://www.bleepingcomputer.com/tutorials/windows-alternate-data-streams/

The example demonstrates one approach to hide / link an executable to a text file, but the process is not limited to text / executable files.
- read the documentation to better understand the application and dangers with using this method

_________________

I will be unreachable from the forum for an indefinite period; downloads moved to My PureBasic Stuff.
_________________


Last edited by JHPJHP on Mon Dec 29, 2014 6:46 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Services, Stuff, and Shellhook
PostPosted: Thu Dec 18, 2014 11:44 am 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1597
Added another three examples to the folder: Stuff
- CacheChrome.pb
- CacheExplorer.pb
- AlwaysOnTop.pb

Both cache examples list browser cache with the option to delete.
- unlike other browsers Google Chrome uses SQLite to store cache

AlwaysOnTop.pb: Tries to set the window using the current thread as the active window.

----------------------------------------------------

Updated all the examples to work with Windows 8.
- an additional update was made to the service example
-- #SC_MANAGER_ALL_ACCESS was changed to #SC_MANAGER_ENUMERATE_SERVICE

_________________

I will be unreachable from the forum for an indefinite period; downloads moved to My PureBasic Stuff.
_________________


Top
 Profile  
Reply with quote  
 Post subject: Re: Services, Stuff, and Shellhook
PostPosted: Sat Dec 20, 2014 9:26 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1597
Added another three examples to the folder: Stuff
- RunElevated.pb: run an executable in an elevated process using the Function: ShellExecuteEx
- SetManifest.pb: set a manifest file to an executable
- IsOS64Bit.pb: returns true if the OS is 64 bit otherwise false

I used the RunElevated & SetManifest scripts in the latest update to PureBasic Interface to WinDivert.

Information:
- http://mfctips.com/2013/01/04/createprocess-fails-to-launch-exe-with-elevated-manifest/
- http://msdn.microsoft.com/en-us/library/aa374191%28v=vs.85%29.aspx
-- tool to view manifest in binary: http://www.angusj.com/resourcehacker/

Running the example: SetManifest.pb on the current folder will set: rpau.manifest to the executable: rpau.exe.

I used the IsOS64Bit script in updating the example: GetProcessCL.pb.
- http://stackoverflow.com/questions/15811006/checking-processor-is-32-bit-or-64-bit

NB*: Numerous other improvements have been made to various examples.

_________________

I will be unreachable from the forum for an indefinite period; downloads moved to My PureBasic Stuff.
_________________


Top
 Profile  
Reply with quote  
 Post subject: Re: Services, Stuff, and Shellhook
PostPosted: Tue Dec 23, 2014 11:41 am 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1597
Added another example to the Stuff folder:
- ListIconGadget_Move.pb: allows the moving of multiple selected items [ CTRL / SHIFT ]

NB*: Update also includes numerous improvements and bug fixes to various examples.

_________________

I will be unreachable from the forum for an indefinite period; downloads moved to My PureBasic Stuff.
_________________


Last edited by JHPJHP on Wed Feb 18, 2015 5:45 am, edited 3 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Services, Stuff, and Shellhook
PostPosted: Mon Dec 29, 2014 6:49 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1597
Updated:
- GetExternalIP.pb: get the external IP Address using DNS
- WebGadget_NoScroll.pb: remove scrolling / scrollbars from the webgadget

_________________

I will be unreachable from the forum for an indefinite period; downloads moved to My PureBasic Stuff.
_________________


Last edited by JHPJHP on Wed Feb 18, 2015 6:02 am, edited 2 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Services, Stuff, and Shellhook
PostPosted: Thu Jan 08, 2015 1:15 am 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1597
Added another couple examples to the Stuff folder:
- MovieData
-- Alternate Data Stream (folder: ADS)
--- folder: videos
---- walking.avi
--- MovieData.pb
---- MovieData.exe
--- ADS.pb
-- DataSection (folder: DS)
--- MovieData.pb
---- MovieData.exe
--- DataSection.pbi

The example: MovieData.pb was from a question asked here: http://www.purebasic.fr/english/viewtopic.php?f=13&t=61382&p=459078#p459078

The ADS folder example uses an Alternate Data Stream to conceal the video file.
- the current executable: MovieData.exe will not work because zip files do not include ADS
-- if I chose to compress using WinRAR the option to include ADS is available
- recompile the file: MovieData.pb (MovieData.exe) then add the ADS by running the file: ADS.pb

The DS folder example uses a DataSection to conceal the video file.
- the example highlights PureDataConverter by ts-soft

NB*: In both examples the temp file is created in the current directory, but this should be changed for better concealment.
- Function: GetTemporaryDirectory

_________________

I will be unreachable from the forum for an indefinite period; downloads moved to My PureBasic Stuff.
_________________


Top
 Profile  
Reply with quote  
 Post subject: Re: Services, Stuff, and Shellhook
PostPosted: Thu Jan 15, 2015 1:09 am 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1597
Added another three examples to the Stuff folder.
- folder: MoreStuff
-- AWS.pb: (Amazon Web Services) used to retrieve a variety of information
--- utilizes the script (HMAC_SHA1 Procedure) by hss: http://www.purebasic.fr/english/viewtopic.php?f=12&t=46460
-- CreateMountableImage.pb: creates a mountable image file from a folder location
--- bingo did it first: http://www.purebasic.fr/english/viewtopic.php?t=29757
-- Power2Bitwise.pb: extracted from: PureBasic Interface to ImDisk

AWS.pb
- the following information will need to be filled in for the example to work
Code:
SecretAccessKey.s = ""
AWSAccessKeyId.s = ""
AssociateTag.s = ""

CreateMountableImage.pb
- a mountable image file cannot be created from a drive-root, or a circular reference

Power2Bitwise.pb

I asked myself this question: If given a number that is the total sum of a group of numbers, how can I extract the individual numbers?

General information:
- counting by powers of two: 1, 2, 4, 8, 16, 32, 64, 128, 256, ...
-- every leading number is greater (by 1) then the sum of all the previous numbers combined

Power of Two / Bitwise:
- Value = Pow(2, nCount) (starting from 0)
-- nCount: the position in the series you want returned: Pow(2, 6) = 64
- (Value & Sum) = Value (Bitwise comparison)
-- Value: the number you want to test is included in the Sum
-- Sum: the sum of various numbers from the series

NB*: I've use the "Power of Two / Bitwise" technique in conjunction with a database to control access privileges, track various auditing information, etc.

_________________

I will be unreachable from the forum for an indefinite period; downloads moved to My PureBasic Stuff.
_________________


Last edited by JHPJHP on Thu Nov 30, 2017 5:35 pm, edited 2 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Services, Stuff, and Shellhook
PostPosted: Fri Feb 13, 2015 2:29 am 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1597
Added another two examples to the Stuff folder:
- WindowStuff/TimerStuff
-- messagebox.pb
-- splash.pb
--- processing.gif

splash.pb: from a question asked here: http://www.purebasic.fr/english/viewtopic.php?f=7&t=61565
- a timed splash window created in a separate thread

messagebox.pb: something I was going to use in: PureBasic Interface to UnRAR (WinRAR)
- a timed message box created in a separate thread

_________________

I will be unreachable from the forum for an indefinite period; downloads moved to My PureBasic Stuff.
_________________


Last edited by JHPJHP on Wed Feb 18, 2015 5:43 am, edited 2 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Services, Stuff, and Shellhook
PostPosted: Sun Feb 15, 2015 8:13 pm 
Offline
Addict
Addict
User avatar

Joined: Sat Oct 09, 2010 3:47 am
Posts: 1597
Added another four examples to the Stuff folder:
- SendToNotepad
-- SendToNotepad.pb
--- gpl.txt (test file)
- WindowStuff/CopyData
-- Text_Send.pb, Text_Receive.pb
- WindowStuff/ShareMemory
-- Image_Send.pb, Image_Receive.pb, baboon.jpg
-- Text_Send.pb, Text_Receive.pb

SendToNotepad
- Open / change the Title of Notepad / Work with an opened instance of Notepad
-- RunNotepad: two optional parameters (Title.s, nDelay)
- Append (newline)
-- WriteToNotepad: nStart < 0 (default) / nLength < 0 (default)
- Prepend (newline)
-- WriteToNotepad: nStart = 0 / nLength < 0 (default)
- Replace
-- WriteToNotepad: nStart >= 0 / nLength > 0
- ReplaceAll
-- WriteToNotepad: nStart = 0 / nLength = 0
- Insert
-- WriteToNotepad: nStart > 0 / nLength <= 0 (default)

ShareMemory
- CopyData examples pass text from one PureBasic window to another.
- ShareMemory examples pass text / images from one PureBasic window to another

--------------------------------------------------------------------

Updated the Share Memory examples.
- Image_Send.pb: includes the option to change images
- Image_Receive.pb: includes a separate thread to monitor changes

_________________

I will be unreachable from the forum for an indefinite period; downloads moved to My PureBasic Stuff.
_________________


Last edited by JHPJHP on Wed Feb 18, 2015 1:29 am, edited 4 times in total.

Top
 Profile  
Reply with quote  
 Post subject: Re: Services, Stuff, and Shellhook
PostPosted: Sun Feb 15, 2015 8:41 pm 
Offline
User
User

Joined: Wed Aug 06, 2008 8:21 am
Posts: 72
Thx for update and share :mrgreen:

_________________
PureBASIC v5.41 LTS , Windows v8.1 x64
Forget UNICODE - Keep it BASIC !


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 105 posts ]  Go to page 1, 2, 3, 4, 5 ... 7  Next

All times are UTC + 1 hour


Who is online

Users browsing this forum: robertfern and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye