Post by Sver on Sept 24, 2020 11:59:54 GMT -5
Copy text below in a .txt file, ; name ps1.txt
Add-Type -AssemblyName System.Device #Required to access System.Device.Location namespace
$GeoWatcher = New-Object System.Device.Location.GeoCoordinateWatcher #Create the required object
$GeoWatcher.Start() #Begin resolving current locaton
while (($GeoWatcher.Status -ne 'Ready') -and ($GeoWatcher.Permission -ne 'Denied')) {
Start-Sleep -Milliseconds 100 #Wait for discovery.
}
if ($GeoWatcher.Permission -eq 'Denied'){
Write-Error 'Access Denied for Location Information'
} else {
$GeoWatcher.Position.Location | Select Latitude,Longitude #Select the relevent results.
}
Run
' nomainwin
'window location on !!!!!
RUN "powershell" ,SHOWMINIMIZED
calldll #kernel32,"Sleep",1500 as ulong, r as void
open "ps1.txt" for input as #filein
filestring$ = input$(#filein, lof(#filein)) ' tot een aantal plaats nummer
close #filein
clip$=filestring$
r = ClipboardSetText(0, clip$)
calldll #kernel32,"Sleep",100 as ulong, r as void
gosub [crtlVenter]
calldll #kernel32,"Sleep",100 as ulong, r as void
clip$="Invoke-History | Set-Clipboard"+chr$(13)+"stop-process -Id $PID"
r = ClipboardSetText(0, clip$)
gosub [crtlVenter]
' clipboard to string
calldll #kernel32,"Sleep",1500 as ulong, r as void
calldll #user32, "OpenClipboard",h as long, result as long
calldll #user32, "GetClipboardData",_CF_TEXT as long,txt as long
CallDll #user32, "CloseClipboard", r as boolean
'-----
clip$=trim$(winstring(txt))
print clip$
end
'---------------------------------------------------------------------
[crtlVenter]
CallDLL #user32,"keybd_event",17 as long,0 as long,0 as long,r as void 'down ctrl
CallDLL #user32,"keybd_event",86 as long,0 as long,0 as long,r as void 'down v
CallDLL #user32,"keybd_event",17 as long,0 as long,2 as long,r as void 'up ctrl
CallDLL #user32,"keybd_event",86 as long,0 as long,2 as long,r as void 'up v
CallDLL #user32,"keybd_event",13 as long,0 as long,0 as long,r as void ' down enter
CallDLL #user32,"keybd_event",13 as long,0 as long,2 as long,r as void 'up
return
'---------------------
Function ClipboardSetText(hOwner, strText$)
strText$ = strText$ + chr$(0)
lngSize = Len(strText$)
hMemory = GlobalAlloc(_GMEM_MOVEABLE, lngSize)
lpMemory = GlobalLock(hMemory)
CallDll #kernel32,"RtlMoveMemory", lpMemory as ulong, strText$ as ptr, lngSize as long, ret as void
r = GlobalUnlock(hMemory)
CallDll #user32, "OpenClipboard", hOwner as long, r as boolean
CallDll #user32, "EmptyClipboard", r as boolean
CallDll #user32, "SetClipboardData", _CF_TEXT as long, hMemory as long, hSuccess as long
CallDll #user32, "CloseClipboard", r as boolean
If hSuccess = 0 Then
r = GlobalFree(hMemory)
End If
ClipboardSetText = hSuccess
End Function
'---
Function GlobalAlloc(type, dwBytes)
CallDll #kernel32, "GlobalAlloc", type as long, dwBytes as ulong, GlobalAlloc as long
End Function
Function GlobalLock(hMem)
CallDll #kernel32, "GlobalLock", hMem as long, GlobalLock as long
End Function
Function GlobalUnlock(hMem)
CallDll #kernel32, "GlobalUnlock", hMem as long, GlobalUnlock as long
End Function
Function GlobalFree(hMem)
CallDll #kernel32, "GlobalFree", hMem as ulong, GlobalFree as long
End Function