AZJIO Posted February 4, 2020 Share Posted February 4, 2020 (edited) IniWrite uses CreatePreferences. This is wrong, as CreatePreferences creates an empty file and will destroy all preferences, leaving only one. MsgBox - you are using WinAPI, but you can use the original MessageRequester() function, then you get cross-platform code. StringIsDigit uses PCRE for you, but I gave you a function without using PCRE. Using PCRE adds 150 KB to the size of the executable. In this case, your file size will be almost the same as that of AutoIt3. FindPartialWindow() - why are you creating the t$=Space(999) variable inside the loop. This can be done 1 time outside the loop. Run() expandcollapse popupEnableExplicit Structure ComLine key.s exec.s EndStructure ; modified function by reference to extract parameters and executable ; https://www.cyberforum.ru/pure-basic/thread3028721.html#post16492165 Procedure.s SplitComLine(*s.ComLine) Protected pos, Char.s pos = FindString(*s\exec, Chr(34), 1) If pos = 1 ; if you find a quote in the first character, then Char=quote, it means the path with spaces Char = Chr(34) Else Char = " " EndIf pos = FindString(*s\exec, Char, 2) ; looking for separator Char from the second character If pos > 0 pos + 1 If Mid(*s\exec, pos, 1) = " " pos + 1 EndIf ; found "pos" - the real position of the beginning of the com line *s\key = Right(*s\exec, Len(*s\exec) - pos + 1) ; options *s\exec = Left(*s\exec, pos - 1) ; executable EndIf EndProcedure Procedure Run(program.s, workdir.s = "", show_flag = 0, opt_flag = 0) Protected s.ComLine s\exec = program s\key = "" SplitComLine(@s) show_flag & opt_flag ; I didn't check the flags RunProgram(s\exec, s\key, workdir, show_flag) EndProcedure ; Run(~"Explorer.exe /Select,\"C:\\Windows\\INF\"") Run("notepad.exe C:\Windows\system.ini") ; Run("cmd.exe /c (@Echo off & @Echo. & Color 1e & chkdsk.exe Z: /F /X& set /p Ok=^>^>)") ; Run("cmd.exe /c (@Echo off & @Echo. & Color 1e & fsutil fsinfo ntfsinfo C: & set /p Ok=^>^>)") ; admin required Edited February 10, 2023 by AZJIO My other projects or all Link to comment Share on other sites More sharing options...
ghost911 Posted February 10, 2020 Author Share Posted February 10, 2020 Hello thank you for the function I am still working on the project Link to comment Share on other sites More sharing options...
AZJIO Posted February 23, 2020 Share Posted February 23, 2020 EnableExplicit Procedure.s TrimRight(*a, n) Protected *p.string = @*a *p\s = Left(*p\s, Len(*p\s) - n) EndProcedure Define x.s = "Hello" TrimRight(@x, 2) Debug x analogue of ByRef. "String" structure created in header files My other projects or all Link to comment Share on other sites More sharing options...
ghost911 Posted February 23, 2020 Author Share Posted February 23, 2020 (edited) thank you next code update i will integrate this I program a new function and I optimize the code to save space having a small executable and fast Edited February 23, 2020 by ghost911 Link to comment Share on other sites More sharing options...
ghost911 Posted April 5, 2020 Author Share Posted April 5, 2020 (edited) Hello for people who understand c ++, there is auto source code to help understand the code https://github.com/ellysh/au3src Edited April 5, 2020 by ghost911 Link to comment Share on other sites More sharing options...
ghost911 Posted April 9, 2020 Author Share Posted April 9, 2020 new hot update 👊 Link to comment Share on other sites More sharing options...
AZJIO Posted August 19, 2020 Share Posted August 19, 2020 use this for registry functions. I used this in the program My other projects or all Link to comment Share on other sites More sharing options...
ghost911 Posted September 25, 2020 Author Share Posted September 25, 2020 @AZJIO Good idea thank you Link to comment Share on other sites More sharing options...
AZJIO Posted November 15, 2021 Share Posted November 15, 2021 (edited) BigNum.au3 = bigint.pbi FileRecycle -> on WinAPI FileGetShortcut -> similar _ProcessGetPath -> ProcessNameFromHwnd Edited November 15, 2021 by AZJIO Trong 1 My other projects or all Link to comment Share on other sites More sharing options...
Trong Posted November 15, 2021 Share Posted November 15, 2021 great, i like PureBasic too Regards, Link to comment Share on other sites More sharing options...
yuser Posted December 18, 2021 Share Posted December 18, 2021 On 3/6/2019 at 9:33 PM, ghost911 said: ( Your source code is secure ) My idea of a source being "secure" isn't just plain asm compiled. I fail to comprehend both the security merits, and the purpose of this. If your autoit code is going to be converted to another language, wouldn't it be easier to learn that language instead? Then you can VMP easily, end of story. Unless your only intent is to prevent kids who only know how to drag drop to get your 1337 source, this will not provide you the slightest help. ghost911 1 Link to comment Share on other sites More sharing options...
AZJIO Posted April 19, 2022 Share Posted April 19, 2022 StringIsDigit, StringIsFloat, StringIsXDigit (link) the behavior of the StringIsFloat function is slightly different expandcollapse popupEnableExplicit Procedure StringIsDigit(*text) Protected flag = #True, *c.Character = *text If *c = 0 Or *c\c = 0 ProcedureReturn 0 EndIf Repeat If *c\c < '0' Or *c\c > '9' flag = #False Break EndIf *c + SizeOf(Character) Until Not *c\c ProcedureReturn flag EndProcedure Debug StringIsDigit(@"123") Debug StringIsDigit(@"12 3") Debug StringIsDigit(@"") Debug "===" Procedure StringIsFloat(*text) Protected flag = #True, *c.Character = *text, sep = 0, increment = 1 If *c = 0 Or *c\c = 0 ProcedureReturn 0 EndIf Repeat If *c\c >= '0' And *c\c <= '9' ; Debug "-> 0-9" sep = increment ElseIf sep And *c\c = '.' ; Debug "-> ." If sep <= 0 ; Debug "-> Out2" flag = #False Break EndIf sep = 0 increment = -1 Else ; Debug "-> Out" flag = #False Break EndIf *c + SizeOf(Character) Until Not *c\c If sep <> -1 ; Debug "-> Out3" flag = #False EndIf ProcedureReturn flag EndProcedure Debug StringIsFloat(@"1.2") Debug StringIsFloat(@"1..2") Debug StringIsFloat(@"1.2.3") Debug StringIsFloat(@"1") Debug StringIsFloat(@"1.") Debug StringIsFloat(@".1") Debug StringIsFloat(@"qwerty") Debug StringIsFloat(@".") Debug StringIsFloat(@"") Debug "===" Procedure StringIsXDigit(*text) Protected flag = #True, *c.Character = *text If *c = 0 Or *c\c = 0 ProcedureReturn 0 EndIf Repeat If Not ((*c\c >= '0' And *c\c <= '9') Or (*c\c >= 'a' And *c\c <= 'f') Or (*c\c >= 'A' And *c\c <= 'F')) flag = #False Break EndIf *c + SizeOf(Character) Until Not *c\c ProcedureReturn flag EndProcedure Debug StringIsXDigit(@"123") Debug StringIsXDigit(@"FF34FF") Debug StringIsXDigit(@"") Debug StringIsXDigit(@" ") ghost911 and Trong 1 1 My other projects or all Link to comment Share on other sites More sharing options...
ghost911 Posted August 24, 2022 Author Share Posted August 24, 2022 thank you for your help I will resume the project when I have time I found a solution for the windows and the buttons I had some setbacks Link to comment Share on other sites More sharing options...
ghost911 Posted August 24, 2022 Author Share Posted August 24, 2022 Hello, to secure a source code until proven otherwise, only compilation works quite well, even if it is not perfect, the goal is simple Bring together the strength of the two languages i propose a solution Link to comment Share on other sites More sharing options...
AZJIO Posted August 25, 2022 Share Posted August 25, 2022 StringStripWS https://www.purebasic.fr/english/viewtopic.php?t=79183 ghost911 and Trong 1 1 My other projects or all Link to comment Share on other sites More sharing options...
ghost911 Posted August 30, 2022 Author Share Posted August 30, 2022 (edited) thank you for your help I will see that I will include it in the project if you want to add functions you can send me the source code I will look at it Edited August 30, 2022 by ghost911 Link to comment Share on other sites More sharing options...
AZJIO Posted September 27, 2022 Share Posted September 27, 2022 ghost911 look at the file (AU3toPB) more detailed argumentum and ghost911 1 1 My other projects or all Link to comment Share on other sites More sharing options...
ghost911 Posted November 30, 2022 Author Share Posted November 30, 2022 (edited) @AZJIO thank you for your support to the project i will update the code help is not refused hahaha ! 😄 @Belini I will add your research in the source code thank you to you I have not forgotten I take any improvement proposes unity is strength if you can give me some ready to use code with the same logic it helps to speed up the project @Belini I have the impression that your code is not complete see picture Edited November 30, 2022 by ghost911 Link to comment Share on other sites More sharing options...
ghost911 Posted December 1, 2022 Author Share Posted December 1, 2022 (edited) Other big update is coming I'm still testing the code I hope that my work will make your life easier and save you time and that you will gain security and development time Update 01/12/2022 to adapt to the new version of purebasic with function additions 😇 Edited December 1, 2022 by ghost911 Trong 1 Link to comment Share on other sites More sharing options...
AZJIO Posted February 9, 2023 Share Posted February 9, 2023 (edited) IniWrite uses CreatePreferences. This is wrong, as CreatePreferences creates an empty file and will destroy all preferences, leaving only one. MsgBox - you are using WinAPI, but you can use the original MessageRequester() function, then you get cross-platform code. StringIsDigit uses PCRE for you, but I gave you a function without using PCRE. Using PCRE adds 150 KB to the size of the executable. In this case, your file size will be almost the same as that of AutoIt3. FindPartialWindow() - why are you creating the t$=Space(999) variable inside the loop. This can be done 1 time outside the loop. Run() expandcollapse popupEnableExplicit Structure String2 key.s exec.s EndStructure ; modified function by reference to extract parameters and executable ; https://www.cyberforum.ru/pure-basic/thread3028721.html#post16492165 Procedure.s CmdLineRaw(*res.String2) Protected pos, Char.s pos = FindString(*res\exec, Chr(34), 1) If pos = 1 ; if you find a quote in the first character, then Char=quote, it means the path with spaces Char = Chr(34) Else Char = " " EndIf pos = FindString(*res\exec, Char, 2) ; looking for separator Char from the second character If pos > 0 pos + 1 If Mid(*res\exec, pos, 1) = " " pos + 1 EndIf ; found "pos" - the real position of the beginning of the com line *res\key = Right(*res\exec, Len(*res\exec) - pos + 1) ; options *res\exec = Left(*res\exec, pos - 1) ; executable EndIf EndProcedure Procedure Run(program.s, workdir.s = "", show_flag = 0, opt_flag = 0) Protected res.String2 res\exec = program res\key = "" CmdLineRaw(@res) show_flag & opt_flag ; I didn't check the flags ProcedureReturn RunProgram(res\exec, res\key, workdir, show_flag) EndProcedure ; Run(~"Explorer.exe /Select,\"C:\\Windows\\INF\"") Run("notepad.exe C:\Windows\system.ini") ; Run("cmd.exe /c (@Echo off & @Echo. & Color 1e & chkdsk.exe Z: /F /X& set /p Ok=^>^>)") Edited February 9, 2023 by AZJIO JiBe and ghost911 1 1 My other projects or all 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