Jump to content

GUICtrlSetOnEvent Conflicts with RegWrite


Recommended Posts

#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Change2CUI=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <MsgBoxConstants.au3>
#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>
#Include <process.au3>
opt("GUIOnEventMode",1)
GUICreate("CorePack Bypass",266,91)
GUICtrlCreateLabel ( "000000...", 20, 10, 220, 20)
GUICtrlCreateButton( "Bypass", 20, 50, 100)
GUICtrlSetOnEvent(-1,"genPassword")
$bu = GUICtrlCreateButton( "Restore - Default", 146, 50, 100)
GUICtrlSetOnEvent($bu,"Oops")
GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")
GUISetState(@SW_SHOW)
Global $length, $length1, $length2, $length3, $length4
    DirCreate("c:\reg\")
while 1  
sleep(1000)
Wend

Func CLOSEClicked()
    Exit
EndFunc

func Oops()
        if fileexists("C:\reg\backup.reg") then
    RunWait('Regedit /s "C:\reg\backup.reg"')
    msgbox(0,"Done","Information from 'C:\Reg\Backup.reg' has been added to the registry.")
    else
    msgbox(0,"ERROR","Failed to Restore.")
    EndIf
EndFunc
sleep(1000)
MsgBox (0, "CorePack Bypass" ,"Done", genPassword(8,4,4,4,10))

Func genPassword($length,$length1,$length2,$length3,$length4)
    $array = StringSplit("abcdefghijklmnopqrstuvwxyZ0123456789","")

    $newPassword = ""
    $newPassword1 = ""
    $newPassword2 = ""
    $newPassword3 = ""
    $newPassword4 = ""
  For $X = 1 to $length
        $newPassword &= $array[Random (1, $array[0], 1)]
    Next
  For $X = 1 to $length1
        $newPassword1 &= $array[Random (1, $array[0], 1)]
    Next
  For $X = 1 to $length2
        $newPassword2 &= $array[Random (1, $array[0], 1)]
    Next
  For $X = 1 to $length3
        $newPassword3 &= $array[Random (1, $array[0], 1)]
    Next
  For $X = 1 to $length4
        $newPassword4 &= $array[Random (1, $array[0], 1)]
    Next
        if fileexists("C:\reg\backup.reg") then
        else
    _RunDos(@ComSpec & ' /c REG EXPORT "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography" "' & 'C:\reg\backup.reg"')
    sleep(3000)
    if then
    RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography", "MachineGuid", "REG_SZ", $newPassword & "-" & $newPassword1 & "-" & $newPassword2 & "-" & $newPassword3 & "-" & $newPassword4)
EndIf
    Return "Done"
    EndIf
EndFunc

without GUICtrlSetOnEvent the function works fine . but with GUICtrl regwrite won't work it replace the machineguid code with (----)

and yeah please i want too to export the only machineguid code not the whole Cryptography

Link to comment
Share on other sites

1 hour ago, CorePack said:
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Change2CUI=y
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#include <MsgBoxConstants.au3>
#include <GUIConstants.au3>
#include <GUIConstantsEx.au3>
#Include <process.au3>
opt("GUIOnEventMode",1)
DIM $length, $length1, $length2, $length3, $length4, $newPassword, $newPassword1, $newPassword2, $newPassword3, $newPassword4 ,$array ,$X
GUICreate("CorePack Bypass",266,91)
GUICtrlCreateLabel ( "This tool used to bypass LIMIT...", 20, 10, 220, 20)
GUICtrlCreateButton( "Bypass", 20, 50, 100)
GUICtrlSetTip(-1, "this will fully spoof your pc with random informations and also will backup ur settings")
GUICtrlSetOnEvent(-1,"genPassword")
$bu = GUICtrlCreateButton( "Restore - Default", 146, 50, 100)
GUICtrlSetTip(-1, "this will restore you pc to default informations")
GUICtrlSetOnEvent($bu,"Oops")
GUISetOnEvent($GUI_EVENT_CLOSE, "CLOSEClicked")
GUISetState(@SW_SHOW)
    DirCreate("c:\reg\")
while 1  
sleep(1000)
Wend

Func CLOSEClicked()
    Exit
EndFunc

func Oops()
        if fileexists("C:\reg\backup.reg") then
    RunWait('Regedit /s "C:\reg\backup.reg"')
    msgbox(0,"Done","Information from 'C:\Reg\Backup.reg' has been added to the registry.")
    else
    msgbox(0,"ERROR","Failed to Restore.")
    EndIf
EndFunc
sleep(1000)
MsgBox (0, "CorePack Bypass" ,"Done", genPassword(8,4,4,4,10))
Func genPassword($length,$length1,$length2,$length3,$length4)

    $array = StringSplit("abcdefghijklmnopqrstuvwxyz0123456789","")

    $newPassword = ""
    $newPassword1 = ""
    $newPassword2 = ""
    $newPassword3 = ""
    $newPassword4 = ""
  For $X = 1 to $length
        $newPassword &= $array[Random (1, $array[0], 1)]
    Next
  For $X = 1 to $length1
        $newPassword1 &= $array[Random (1, $array[0], 1)]
    Next
  For $X = 1 to $length2
        $newPassword2 &= $array[Random (1, $array[0], 1)]
    Next
  For $X = 1 to $length3
        $newPassword3 &= $array[Random (1, $array[0], 1)]
    Next
  For $X = 1 to $length4
        $newPassword4 &= $array[Random (1, $array[0], 1)]
    Next
        if fileexists("C:\reg\backup.reg") then
        RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography", "MachineGuid", "REG_SZ", $newPassword & "-" & $newPassword1 & "-" & $newPassword2 & "-" & $newPassword3 & "-" & $newPassword4)
        sleep(1000)
        else
    _RunDos(@ComSpec & ' /c REG EXPORT "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography" "' & 'C:\reg\backup.reg"')
    sleep(3000)
    RegWrite("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography", "MachineGuid", "REG_SZ", $newPassword & "-" & $newPassword1 & "-" & $newPassword2 & "-" & $newPassword3 & "-" & $newPassword4)
    EndIf
EndFunc

edit : it seems i can't read   $newPassword etc arrays with GUICtrlSetOnEvent

and yeah please i want too to export the only machineguid code not the whole Cryptography

 

Link to comment
Share on other sites

1 hour ago, CorePack said:

without GUICtrlSetOnEvent the function works fine

What function? 

BTW, this bit of code will never be ran.

sleep(1000)
MsgBox (0, "CorePack Bypass" ,"Done", genPassword(8,4,4,4,10))

It's after the While loop, and outside of all the functions. Also, you're sleeps are excessive.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

1 minute ago, BrewManNH said:

What function? 

BTW, this bit of code will never be ran.

sleep(1000)
MsgBox (0, "CorePack Bypass" ,"Done", genPassword(8,4,4,4,10))

It's after the While loop, and outside of all the functions. Also, you're sleeps are excessive.

Func genPassword($length,$length1,$length2,$length3,$length4)

this func works fine but he can't read the $newPassword arrays

im newbie as hell .. how i can define the 8.4.4.4.10 as length of string within the function

 

 

 

Link to comment
Share on other sites

OnEvent functions can not have parameters, so none of your $length# parameters can be used in the function.

Also, you have declared the $length# variables in the global scope but you reused the same names in the parameters for the genpassword function. So, because the parameter variables are ignored, the global variables are being used instead, and they don't contain any values. 

You can call the function without using OnEvent with values in the parameters, and those will be used, but you don't do that.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

1 minute ago, BrewManNH said:

OnEvent functions can not have parameters, so none of your $length# parameters can be used in the function.

Also, you have declared the $length# variables in the global scope but you reused the same names in the parameters for the genpassword function. So, because the parameter variables are ignored, the global variables are being used instead, and they don't contain any values. 

You can call the function without using OnEvent with values in the parameters, and those will be used, but you don't do that.

Func genPassword($length=(8),$length1=(4),$length2=(4),$length3=(4),$length4=(10))

GLOBAL $length=(8), $length1=(4), $length2=(4), $length3=(4), $length4=(10)
Func genPassword()

Thanks Mate

it FINALLY WORKS by that way

did you know how can i export the value of MachineGuid instead of the whole folder ?

_RunDos(@ComSpec & ' /c REG EXPORT "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography" "' & 'C:\reg\backup.reg"')

 

Link to comment
Share on other sites

First, you shouldn't use @ComSpec in your RunDos function, _RunDOS is just a wrapper for the @ComSpec macro already, second it can probably be done like this:

_RunDos(@ComSpec & ' /c REG EXPORT "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\MachineGUID" "' & 'C:\reg\backup.reg"')

Untested...

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

16 minutes ago, BrewManNH said:

First, you shouldn't use @ComSpec in your RunDos function, _RunDOS is just a wrapper for the @ComSpec macro already, second it can probably be done like this:

_RunDos(@ComSpec & ' /c REG EXPORT "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Cryptography\MachineGUID" "' & 'C:\reg\backup.reg"')

Untested...

not work tested it before .. btw thanks for you help

Link to comment
Share on other sites

You can always use RegRead and RegWrite instead of exporting to a reg file.

If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...