Overflow_ Posted April 25, 2016 Share Posted April 25, 2016 I have it on gimmestring.au3 FileCopy (@ScriptDir & "\file.exe", @ScriptDir & "\newfile.exe") FileWrite(@ScriptDir & "\newfile.exe", @CRLF & "//first message//secound message//") FileClose(@ScriptDir & "\newfile.exe") and it on file.au3 $StrSplit = StringSplit(FileRead(@ScriptFullPath), "//", 1) MsgBox(0, $StrSplit[2], $StrSplit[3]) Why i got Error array variable has incorrect number of subscripts if [1] is MZ ? btw error in newfile.exe Link to comment Share on other sites More sharing options...
alien4u Posted April 25, 2016 Share Posted April 25, 2016 @ScriptFullPath Refer to the Full path of the running script, so this: $StrSplit = StringSplit(FileRead(@ScriptFullPath), "//", 1) Is searching on \file.exe and not in \newfile.exe Regards Alien. Overflow_ 1 Link to comment Share on other sites More sharing options...
alien4u Posted April 25, 2016 Share Posted April 25, 2016 Another thing: FileRead(@ScriptFullPath), "//", 1) FileRead() only accept 2 arguments from the Help File: FileRead ( "filehandle/filename" [, count] ) You are passing 3 arguments here. Regards Alien. Overflow_ 1 Link to comment Share on other sites More sharing options...
Overflow_ Posted April 25, 2016 Author Share Posted April 25, 2016 4 minutes ago, alien4u said: @ScriptFullPath Refer to the Full path of the running script, so this: $StrSplit = StringSplit(FileRead(@ScriptFullPath), "//", 1) Is searching on \file.exe and not in \newfile.exe Regards Alien. nope, its reading the newfile.exe the file was copied to newfile before read/write/close. but thanks Link to comment Share on other sites More sharing options...
AutoBert Posted April 25, 2016 Share Posted April 25, 2016 You can't append parameters by appending them to a EXEcutable file! Link to comment Share on other sites More sharing options...
Overflow_ Posted April 25, 2016 Author Share Posted April 25, 2016 Well, then youre telling to make a builder string is impossible to do ? Link to comment Share on other sites More sharing options...
Trong Posted April 25, 2016 Share Posted April 25, 2016 You are trying to run another program with the parametersand: //first message and //secound message? Or you're trying to run the script with the parametersand: //first message and //secound message? If you are running other programs you use: ShellExecute,ShellExecuteWait,Run,RunWait Run ( "program" [, "workingdir" [, show_flag [, opt_flag]]] ) RunWait ( "program" [, "workingdir" [, show_flag [, opt_flag]]] ) ShellExecute ( "filename" [, "parameters" [, "workingdir" [, "verb" [, showflag]]]] ) ShellExecuteWait ( "filename" [, "parameters" [, "workingdir" [, "verb" [, showflag]]]] ) If you're trying to create your scripts to run with these commands, Try this: If $CmdLine[0] > 0 Then If $CmdLine[1] = "Function1" Then Function1() If $CmdLine[1] = "Function2" Then Function2() EndIf ;~ If @Compiled Then ;~ ShellExecute(@AutoItExe, "Function1") ;~ ShellExecute(@AutoItExe, "Function2") ;~ Else ;~ ShellExecute(@ScriptName, "Function1") ;~ ShellExecute(@ScriptName, "Function2") ;~ EndIf Func Function1() MsgBox(0, "", "Function 1", 0) Exit EndFunc ;==>Function1 Func Function2() MsgBox(0, "", "Function 2", 0) Exit EndFunc ;==>Function2 Regards, Link to comment Share on other sites More sharing options...
alien4u Posted April 25, 2016 Share Posted April 25, 2016 Like I see it @Overflow_ just want to write something inside an exe file and then read that, in the end an exe file is just a file like any other file. But if he want to past a parameter to an exe(program) then he must fallow @VIP suggestion. Regards Alien. Overflow_ 1 Link to comment Share on other sites More sharing options...
Overflow_ Posted April 26, 2016 Author Share Posted April 26, 2016 nice tip but let me explain a little bit to you gys, i want to do one Builder and Stub I think this is the correct name Link to comment Share on other sites More sharing options...
Overflow_ Posted April 26, 2016 Author Share Posted April 26, 2016 (edited) Maybe now you can understand. This is my gen.exe look that.. creating exacly same file "Stb.exe" but with the new string. $StringMessage = InputBox('','', 'write ur message here') FileCopy(@ScriptDir&"\Stb.exe", @ScriptDir & "\test.exe") ;will copy and gen exactly new equal file FileWrite(@ScriptDir & "\test.exe", @CRLF & "|||" & $texte1 &"|||") ;write in new file my string($StringMessage) FileClose(@ScriptDir & "\test.exe") ;close. And this is my Stb.exe Local $dir = FileRead(@ScriptFullPath) ; fullpacth bcause I'm NEW file with new name, dir.. idk. $StrSplit = StringSplit($dir, "|||") ;split the string INSIDE |||$StringMessage||| PS: $StringMessage From that exe copied.. $NewStringCall = $StrSplit[2] ;we call secound value bcause 0 is bool, 1 is MZ of exe. _ShowMsg($NewStringCall) Func _ShowMsg($String) MsgBox(64, "Title", $String) EndFunc Edited April 26, 2016 by Overflow_ Link to comment Share on other sites More sharing options...
Overflow_ Posted April 26, 2016 Author Share Posted April 26, 2016 c'mon guys, bump Link to comment Share on other sites More sharing options...
BrewManNH Posted April 26, 2016 Share Posted April 26, 2016 You're trying to do a fileread on a binary file, the first NUL it hits in the file stops the file read, it's not going to work. Why are you trying to append text to the end of an executable? Can't you just add it to the resources the usual way? 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 GudeHow 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 More sharing options...
Moderators Melba23 Posted April 26, 2016 Moderators Share Posted April 26, 2016 Overflow_, Please do not bump your own threads within 24 hours. Remember this is not a 24/7 support forum - those who answer are only here because they like helping others and have some time to spare. You just have to wait until someone who knows something about your particular problem, and is willing to help, comes online. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Overflow_ Posted April 26, 2016 Author Share Posted April 26, 2016 1 hour ago, BrewManNH said: You're trying to do a fileread on a binary file, the first NUL it hits in the file stops the file read, it's not going to work. Why are you trying to append text to the end of an executable? Can't you just add it to the resources the usual way? Yeah, im trying to do looks like it https://www.youtube.com/ watch?v=cVQbZsNilDA Link to comment Share on other sites More sharing options...
BrewManNH Posted April 26, 2016 Share Posted April 26, 2016 Builder/Stub sets off alarm bells when dealing with malware, you need to give a better explanation of why you're trying to do this than you already have. 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 GudeHow 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 More sharing options...
Moderators Melba23 Posted April 26, 2016 Moderators Share Posted April 26, 2016 Overflow_, Quote you need to give a better explanation of why you're trying to do this than you already have I agree - and the explanation had best be a good one. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Overflow_ Posted April 26, 2016 Author Share Posted April 26, 2016 I'm trying to do it because i have Generator Launcher to samp game server with settings.ini where you edit with ip to server, port, name of server etc.. to v2 i want make without ini settings. this is official server list http://prntscr.com/ax5od4 i just making my launcher auto join has nothing with malware, just launcher to join in my server if you want know more about my project, is just commandline to join server Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 26, 2016 Moderators Share Posted April 26, 2016 Overflow_, So this is just a script to interact with your game server? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Overflow_ Posted April 26, 2016 Author Share Posted April 26, 2016 Just now, Melba23 said: Overflow_, So this is just a script to interact with your game server? M23 well, not only with my gm will be release source code free to all admins of samp server Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 26, 2016 Moderators Share Posted April 26, 2016 Overflow_, You appear not to have read the Forum rules since your arrival. Please do read them - particularly the bit about not discussing game or game server interaction - before you post again and then you will understand why you will get no further help and this thread will now be locked. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
Recommended Posts