Danyfirex Posted November 9, 2014 Share Posted November 9, 2014 brother If you want the callback code let me know it. Saludos Starstar 1 Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
Starstar Posted November 9, 2014 Author Share Posted November 9, 2014 brother If you want the callback code let me know it. Saludos Yes bro i need it......... Life is like a coin. You can spend it Anyway as you wish and for your kind information. "you can spend it only once." Link to comment Share on other sites More sharing options...
Danyfirex Posted November 9, 2014 Share Posted November 9, 2014 I'll Update this message when I'll be at work where I have my USB with the code. Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
Starstar Posted November 9, 2014 Author Share Posted November 9, 2014 I'll Update this message when I'll be at work where I have my USB with the code. Saludos ok bro no problem..and thanks in advance. Life is like a coin. You can spend it Anyway as you wish and for your kind information. "you can spend it only once." Link to comment Share on other sites More sharing options...
Danyfirex Posted November 9, 2014 Share Posted November 9, 2014 The callback: expandcollapse popupGlobal Enum $RASCS_OpenPort = 0, $RASCS_PortOpened, $RASCS_ConnectDevice, $RASCS_DeviceConnected, $RASCS_AllDevicesConnected, _ $RASCS_Authenticate, $RASCS_AuthNotify, $RASCS_AuthRetry, $RASCS_AuthCallback, $RASCS_AuthChangePassword, $RASCS_AuthProject, _ $RASCS_AuthLinkSpeed, $RASCS_AuthAck, $RASCS_ReAuthenticate, $RASCS_Authenticated, $RASCS_PrepareForCallback, _ $RASCS_WaitForModemReset, $RASCS_WaitForCallback, $RASCS_Projected, _ $RASCS_StartAuthentication, _ $RASCS_CallbackComplete, _ $RASCS_LogonNetwork, _ $RASCS_SubEntryConnected, _ $RASCS_SubEntryDisconnected, _ $RASCS_ApplySettings, _ $RASCS_Interactive = 0x1000, _ $RASCS_RetryAuthentication, _ $RASCS_CallbackSetByCaller, _ $RASCS_PasswordExpired, _ $RASCS_InvokeEapUI, _ $RASCS_Connected = 0x2000, _ $RASCS_Disconnected Local $hHandle = DllCallbackRegister("RasDialFunc", "none", "UINT;lparam;wparam") Func RasDialFunc($iMsg, $rasconnstate, $dwError) If $dwError Then Local $aRet = DllCall("Rasapi32.dll", "dword", "RasGetErrorStringW", "uint", $dwError, "wstr", "", "dword", 256) ConsoleWrite("!" & $aRet[2] & @CRLF) Return EndIf Switch $rasconnstate Case $RASCS_OpenPort ConsoleWrite("Opening port..." & @CRLF) Case $RASCS_PortOpened ConsoleWrite("Port Opened..." & @CRLF) Case $RASCS_ConnectDevice ConsoleWrite("Connecting device..." & @CRLF) Case $RASCS_DeviceConnected ConsoleWrite("Device connected..." & @CRLF) Case $RASCS_AllDevicesConnected ConsoleWrite("All devices connected..." & @CRLF) Case $RASCS_Authenticate ConsoleWrite("Authenticating..." & @CRLF) Case $RASCS_AuthNotify ConsoleWrite("Authentication notify..." & @CRLF) Case $RASCS_AuthRetry ConsoleWrite("Retrying authentication..." & @CRLF) Case $RASCS_AuthCallback ConsoleWrite("Authentication callback..." & @CRLF) Case $RASCS_AuthChangePassword ConsoleWrite("Change password..." & @CRLF) Case $RASCS_AuthProject ConsoleWrite("Projection phase started..." & @CRLF) Case $RASCS_AuthLinkSpeed ConsoleWrite("Negotiating speed..." & @CRLF) Case $RASCS_AuthAck ConsoleWrite("Authentication acknowledge..." & @CRLF) Case $RASCS_ReAuthenticate ConsoleWrite("Retrying Authentication..." & @CRLF) Case $RASCS_Authenticated ConsoleWrite("Authentication complete..." & @CRLF) Case $RASCS_PrepareForCallback ConsoleWrite("Preparing for callback..." & @CRLF) Case $RASCS_WaitForModemReset ConsoleWrite("Waiting for modem reset..." & @CRLF) Case $RASCS_WaitForCallback ConsoleWrite("Waiting for callback..." & @CRLF) Case $RASCS_Projected ConsoleWrite("Projection completed..." & @CRLF) Case $RASCS_StartAuthentication ConsoleWrite("Starting authentication..." & @CRLF) Case $RASCS_CallbackComplete ConsoleWrite("Callback complete..." & @CRLF) Case $RASCS_LogonNetwork ConsoleWrite("Logon to the network..." & @CRLF) Case $RASCS_SubEntryConnected ConsoleWrite("Subentry connected..." & @CRLF) Case $RASCS_SubEntryDisconnected ConsoleWrite("Subentry disconnected..." & @CRLF) Case $RASCS_Connected ConsoleWrite("Connection completed." & @CRLF) Case $RASCS_Disconnected ConsoleWrite("Disconnecting..." & @CRLF) Case Else ConsoleWrite("Unknown Status = " & $rasconnstate & @CRLF) EndSwitch EndFunc ;==>RasDialFunc Saludos Starstar 1 Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
Starstar Posted November 9, 2014 Author Share Posted November 9, 2014 The callback: expandcollapse popupGlobal Enum $RASCS_OpenPort = 0, $RASCS_PortOpened, $RASCS_ConnectDevice, $RASCS_DeviceConnected, $RASCS_AllDevicesConnected, _ $RASCS_Authenticate, $RASCS_AuthNotify, $RASCS_AuthRetry, $RASCS_AuthCallback, $RASCS_AuthChangePassword, $RASCS_AuthProject, _ $RASCS_AuthLinkSpeed, $RASCS_AuthAck, $RASCS_ReAuthenticate, $RASCS_Authenticated, $RASCS_PrepareForCallback, _ $RASCS_WaitForModemReset, $RASCS_WaitForCallback, $RASCS_Projected, _ $RASCS_StartAuthentication, _ $RASCS_CallbackComplete, _ $RASCS_LogonNetwork, _ $RASCS_SubEntryConnected, _ $RASCS_SubEntryDisconnected, _ $RASCS_ApplySettings, _ $RASCS_Interactive = 0x1000, _ $RASCS_RetryAuthentication, _ $RASCS_CallbackSetByCaller, _ $RASCS_PasswordExpired, _ $RASCS_InvokeEapUI, _ $RASCS_Connected = 0x2000, _ $RASCS_Disconnected Local $hHandle = DllCallbackRegister("RasDialFunc", "none", "UINT;lparam;wparam") Func RasDialFunc($iMsg, $rasconnstate, $dwError) If $dwError Then Local $aRet = DllCall("Rasapi32.dll", "dword", "RasGetErrorStringW", "uint", $dwError, "wstr", "", "dword", 256) ConsoleWrite("!" & $aRet[2] & @CRLF) Return EndIf Switch $rasconnstate Case $RASCS_OpenPort ConsoleWrite("Opening port..." & @CRLF) Case $RASCS_PortOpened ConsoleWrite("Port Opened..." & @CRLF) Case $RASCS_ConnectDevice ConsoleWrite("Connecting device..." & @CRLF) Case $RASCS_DeviceConnected ConsoleWrite("Device connected..." & @CRLF) Case $RASCS_AllDevicesConnected ConsoleWrite("All devices connected..." & @CRLF) Case $RASCS_Authenticate ConsoleWrite("Authenticating..." & @CRLF) Case $RASCS_AuthNotify ConsoleWrite("Authentication notify..." & @CRLF) Case $RASCS_AuthRetry ConsoleWrite("Retrying authentication..." & @CRLF) Case $RASCS_AuthCallback ConsoleWrite("Authentication callback..." & @CRLF) Case $RASCS_AuthChangePassword ConsoleWrite("Change password..." & @CRLF) Case $RASCS_AuthProject ConsoleWrite("Projection phase started..." & @CRLF) Case $RASCS_AuthLinkSpeed ConsoleWrite("Negotiating speed..." & @CRLF) Case $RASCS_AuthAck ConsoleWrite("Authentication acknowledge..." & @CRLF) Case $RASCS_ReAuthenticate ConsoleWrite("Retrying Authentication..." & @CRLF) Case $RASCS_Authenticated ConsoleWrite("Authentication complete..." & @CRLF) Case $RASCS_PrepareForCallback ConsoleWrite("Preparing for callback..." & @CRLF) Case $RASCS_WaitForModemReset ConsoleWrite("Waiting for modem reset..." & @CRLF) Case $RASCS_WaitForCallback ConsoleWrite("Waiting for callback..." & @CRLF) Case $RASCS_Projected ConsoleWrite("Projection completed..." & @CRLF) Case $RASCS_StartAuthentication ConsoleWrite("Starting authentication..." & @CRLF) Case $RASCS_CallbackComplete ConsoleWrite("Callback complete..." & @CRLF) Case $RASCS_LogonNetwork ConsoleWrite("Logon to the network..." & @CRLF) Case $RASCS_SubEntryConnected ConsoleWrite("Subentry connected..." & @CRLF) Case $RASCS_SubEntryDisconnected ConsoleWrite("Subentry disconnected..." & @CRLF) Case $RASCS_Connected ConsoleWrite("Connection completed." & @CRLF) Case $RASCS_Disconnected ConsoleWrite("Disconnecting..." & @CRLF) Case Else ConsoleWrite("Unknown Status = " & $rasconnstate & @CRLF) EndSwitch EndFunc ;==>RasDialFunc Saludos Thanks a lot of you bro........... Life is like a coin. You can spend it Anyway as you wish and for your kind information. "you can spend it only once." Link to comment Share on other sites More sharing options...
Danyfirex Posted November 9, 2014 Share Posted November 9, 2014 If you have any problems implementing it let me know. Saludos Danysys.com AutoIt... UDFs: VirusTotal API 2.0 UDF - libZPlay UDF - Apps: Guitar Tab Tester - VirusTotal Hash Checker Examples: Text-to-Speech ISpVoice Interface - Get installed applications - Enable/Disable Network connection PrintHookProc - WINTRUST - Mute Microphone Level - Get Connected NetWorks - Create NetWork Connection ShortCut Link to comment Share on other sites More sharing options...
Starstar Posted November 9, 2014 Author Share Posted November 9, 2014 If you have any problems implementing it let me know. Saludos You are Great Bro..........Thank You very much bro............ Danyfirex 1 Life is like a coin. You can spend it Anyway as you wish and for your kind information. "you can spend it only once." Link to comment Share on other sites More sharing options...
shai Posted February 12, 2018 Share Posted February 12, 2018 sorry about the bump old topic. but i have Q that connected to this topic. how can use RasHangUp function to disconnect the connection? Link to comment Share on other sites More sharing options...
Earthshine Posted February 12, 2018 Share Posted February 12, 2018 Why not create new thread and link old thread to it? My resources are limited. You must ask the right questions Link to comment Share on other sites More sharing options...
Parsix Posted April 15, 2022 Share Posted April 15, 2022 (edited) On 11/9/2014 at 7:32 PM, Danyfirex said: The callback: expandcollapse popupGlobal Enum $RASCS_OpenPort = 0, $RASCS_PortOpened, $RASCS_ConnectDevice, $RASCS_DeviceConnected, $RASCS_AllDevicesConnected, _ $RASCS_Authenticate, $RASCS_AuthNotify, $RASCS_AuthRetry, $RASCS_AuthCallback, $RASCS_AuthChangePassword, $RASCS_AuthProject, _ $RASCS_AuthLinkSpeed, $RASCS_AuthAck, $RASCS_ReAuthenticate, $RASCS_Authenticated, $RASCS_PrepareForCallback, _ $RASCS_WaitForModemReset, $RASCS_WaitForCallback, $RASCS_Projected, _ $RASCS_StartAuthentication, _ $RASCS_CallbackComplete, _ $RASCS_LogonNetwork, _ $RASCS_SubEntryConnected, _ $RASCS_SubEntryDisconnected, _ $RASCS_ApplySettings, _ $RASCS_Interactive = 0x1000, _ $RASCS_RetryAuthentication, _ $RASCS_CallbackSetByCaller, _ $RASCS_PasswordExpired, _ $RASCS_InvokeEapUI, _ $RASCS_Connected = 0x2000, _ $RASCS_Disconnected Local $hHandle = DllCallbackRegister("RasDialFunc", "none", "UINT;lparam;wparam") Func RasDialFunc($iMsg, $rasconnstate, $dwError) If $dwError Then Local $aRet = DllCall("Rasapi32.dll", "dword", "RasGetErrorStringW", "uint", $dwError, "wstr", "", "dword", 256) ConsoleWrite("!" & $aRet[2] & @CRLF) Return EndIf Switch $rasconnstate Case $RASCS_OpenPort ConsoleWrite("Opening port..." & @CRLF) Case $RASCS_PortOpened ConsoleWrite("Port Opened..." & @CRLF) Case $RASCS_ConnectDevice ConsoleWrite("Connecting device..." & @CRLF) Case $RASCS_DeviceConnected ConsoleWrite("Device connected..." & @CRLF) Case $RASCS_AllDevicesConnected ConsoleWrite("All devices connected..." & @CRLF) Case $RASCS_Authenticate ConsoleWrite("Authenticating..." & @CRLF) Case $RASCS_AuthNotify ConsoleWrite("Authentication notify..." & @CRLF) Case $RASCS_AuthRetry ConsoleWrite("Retrying authentication..." & @CRLF) Case $RASCS_AuthCallback ConsoleWrite("Authentication callback..." & @CRLF) Case $RASCS_AuthChangePassword ConsoleWrite("Change password..." & @CRLF) Case $RASCS_AuthProject ConsoleWrite("Projection phase started..." & @CRLF) Case $RASCS_AuthLinkSpeed ConsoleWrite("Negotiating speed..." & @CRLF) Case $RASCS_AuthAck ConsoleWrite("Authentication acknowledge..." & @CRLF) Case $RASCS_ReAuthenticate ConsoleWrite("Retrying Authentication..." & @CRLF) Case $RASCS_Authenticated ConsoleWrite("Authentication complete..." & @CRLF) Case $RASCS_PrepareForCallback ConsoleWrite("Preparing for callback..." & @CRLF) Case $RASCS_WaitForModemReset ConsoleWrite("Waiting for modem reset..." & @CRLF) Case $RASCS_WaitForCallback ConsoleWrite("Waiting for callback..." & @CRLF) Case $RASCS_Projected ConsoleWrite("Projection completed..." & @CRLF) Case $RASCS_StartAuthentication ConsoleWrite("Starting authentication..." & @CRLF) Case $RASCS_CallbackComplete ConsoleWrite("Callback complete..." & @CRLF) Case $RASCS_LogonNetwork ConsoleWrite("Logon to the network..." & @CRLF) Case $RASCS_SubEntryConnected ConsoleWrite("Subentry connected..." & @CRLF) Case $RASCS_SubEntryDisconnected ConsoleWrite("Subentry disconnected..." & @CRLF) Case $RASCS_Connected ConsoleWrite("Connection completed." & @CRLF) Case $RASCS_Disconnected ConsoleWrite("Disconnecting..." & @CRLF) Case Else ConsoleWrite("Unknown Status = " & $rasconnstate & @CRLF) EndSwitch EndFunc ;==>RasDialFunc Saludos hi, how to use ? Edited April 15, 2022 by Parsix Link to comment Share on other sites More sharing options...
Nine Posted April 15, 2022 Share Posted April 15, 2022 1 hour ago, Parsix said: how to use Look at page #1 where dany discussed how to declare the callback and star shows where to insert its ptr in the dllcall Danyfirex and Parsix 2 “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Parsix Posted April 29, 2022 Share Posted April 29, 2022 (edited) expandcollapse popupFunc _Create_RASPARAMS_STRUCT_A($sEntryName, $sUserName, $sPassword) #Region ;Options Local Const $RAS_MaxAreaCode = 10 Local Const $RAS_MaxPhoneNumber = 128 Local Const $RAS_MaxDeviceType = 16 Local Const $RAS_MaxDeviceName = 128 Local Const $RAS_MaxPadType = 32 Local Const $RAS_MaxX25Address = 200 Local Const $RAS_MaxCallbackNumber = 128 ;$RAS_MaxPhoneNumber Local Const $RAS_MaxFacilities = $RAS_MaxX25Address Local Const $RAS_MaxUserData = $RAS_MaxFacilities Local Const $RAS_MaxDnsSuffix = 256 Local Const $RAS_MaxEntryName = 256 Local Const $WM_RASDIALEVENT = 0xCCCD Local Const $RASCS_DONE = 0x2000 Local Const $WAIT_OBJECT_0 = 0 Local $hConection = 0 Local Const $DNLEN =15 #cs typedef struct _RASDIALPARAMS { DWORD dwSize; TCHAR szEntryName[RAS_MaxEntryName + 1]; TCHAR szPhoneNumber[RAS_MaxPhoneNumber + 1]; TCHAR szCallbackNumber[RAS_MaxCallbackNumber + 1]; TCHAR szUserName[UNLEN + 1]; TCHAR szPassword[PWLEN + 1]; TCHAR szDomain[DNLEN + 1]; DWORD dwSubEntry; ULONG_PTR dwCallbackId; DWORD dwIfIndex; } RASDIALPARAMS, *PRASDIALPARAMS; #ce Local Const $tagRASDIALPARAMS = "dword dwSize;" & _ "wchar szEntryName["& $RAS_MaxEntryName +1 &"];" & _ "wchar szPhoneNumber["& $RAS_MaxPhoneNumber +1 &"];" & _ "wchar szCallbackNumber["& $RAS_MaxCallbackNumber +1 & "];" & _ "wchar szUserName[" & $RAS_MaxDnsSuffix +1 & "];" & _ "wchar szPassword["& $RAS_MaxDnsSuffix + 1 & "];" & _ "wchar szDomain["&$DNLEN +1 &"];" & _ "dword dwSubEntry;" & _ "ULONG_PTR dwCallbackId;" & _ "dword dwIfIndex" #EndRegion ;Options Local $tRASDIALPARAMS = DllStructCreate($tagRASDIALPARAMS) $tRASDIALPARAMS.dwSize = DllStructGetSize($tRASDIALPARAMS) DllStructSetData($tRASDIALPARAMS, "szEntryName", $sEntryName) DllStructSetData($tRASDIALPARAMS, "szPhoneNumber", "") DllStructSetData($tRASDIALPARAMS, "szUserName", $sUserName) DllStructSetData($tRASDIALPARAMS, "szPassword", $sPassword) DllStructSetData($tRASDIALPARAMS, "szDomain", "") Return $tRASDIALPARAMS EndFunc Func _RAS_DialA($sConnectionName, $sUSR, $sPSW, $sPhoneBook) Local $ERROR = 0 If Not FileExists($sPhoneBook) Then Return $ERROR Local $tRASDIAL_PARAMS = _Create_RASPARAMS_STRUCT_A($sConnectionName, $sUSR, $sPSW) Local $iRet = DllCall("Rasapi32.dll", "dword", "RasDialA", "ptr", 0,"wstr",$sPhoneBook, "ptr",DllStructGetPtr($tRASDIAL_PARAMS), "dword", 0, "ptr", Null, "handle*", NULL) $tRASDIAL_PARAMS = 0 If Not $iRet[0] Then Return 1 ;convert 0 to 1 when dial is ok Else ;Local $Ret = DllCall("Rasapi32.dll", "dword", "RasGetErrorStringW", "uint", $iRet[0], "wstr", NULL, "dword", 256) ;$Ret[2] Return $iRet[0] EndIf EndFunc Local $FilePath="C:\VPN-Conn.pbk" ConsoleWrite (@CRLF & " --> "& _RAS_DialA("VPN1", "USR1", "PSW1", $FilePath) & @CRLF) got Error 632 Edit: Fixed by replace wchar with char in param and "wstr" with "str" in dllcall Local $iRet = DllCall("Rasapi32.dll", "dword", "RasDialA", "ptr", 0,"str",$sPhoneBook, "ptr",DllStructGetPtr($tRASDIAL_PARAMS), "dword", 0, "ptr", Null, "handle*", NULL) RasDialW and RasDialA causes execution of other script code (GDI+ animated loading screens) Edited April 29, 2022 by Parsix Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now