Jump to content
Sign in to follow this  
kiko298

Help with stringreplace

Recommended Posts

kiko298

I am writting a crypter decrypter but this crypt part isn t working fine.

It replace the string but after that it displays the unecripted string too.

What s the error?

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <String.au3>
#Region ### START Koda GUI section ### Form=
$Form3 = GUICreate("Test string", 405, 294, 202, 132)
$Button1 = GUICtrlCreateButton("Crypt", 168, 256, 75, 25)
$Edit1 = GUICtrlCreateEdit("", 104, 48, 185, 89)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###
While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$texto = GUICtrlRead( $Edit1 )
$4 = StringReplace( $texto, "a", "1H890", 1, 1 )
$5 = StringReplace( $texto, "b", "A9D8o", 1, 1 )
GUICtrlSetData( $Edit1, $5 & $4 )
EndSwitch
WEnd
Edited by kiko298

Share this post


Link to post
Share on other sites
water

You know that AutoIt comes with a Crypt UDF?


My UDFs and Tutorials:

Spoiler

UDFs:
Active Directory (NEW 2018-10-19 - Version 1.4.10.0) - Download - General Help & Support - Example Scripts - Wiki
OutlookEX (2018-10-31 - Version 1.3.4.1) - Download - General Help & Support - Example Scripts - Wiki
ExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example Scripts
PowerPoint (2017-06-06 - Version 0.0.5.0) - Download - General Help & Support
Excel - Example Scripts - Wiki
Word - Wiki
 
Tutorials:

ADO - Wiki

 

Share this post


Link to post
Share on other sites
PhoenixXL

kiko298,

you are even duplicating the DATA

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <String.au3>

$Form3 = GUICreate("Test string", 405, 294, 202, 132)
$Button1 = GUICtrlCreateButton("Crypt", 168, 256, 75, 25)
$Edit1 = GUICtrlCreateEdit("", 104, 48, 185, 89)
GUISetState(@SW_SHOW)

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
Case $GUI_EVENT_CLOSE
Exit
Case $Button1
$texto = GUICtrlRead($Edit1)
$4 = StringReplace($texto, "a", "1H890", 1, 1)
$5 = StringReplace($4, "b", "A9D8o", 1, 1)
GUICtrlSetData($Edit1, $5)
EndSwitch
WEnd

My code:

PredictText: Predict Text of an Edit Control Like Scite. Remote Gmail: Execute your Scripts through Gmail. StringRegExp:Share and learn RegExp.

Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). Database: An easier approach for _SQ_LITE beginners.

MathsEx: A UDF for Fractions and LCM, GCF/HCF. FloatingText: An UDF for make your text floating. Clipboard Extendor: A clipboard monitoring tool. 

Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead. RestrictEdit_SRE: Restrict text in an Edit Control through a Regular Expression.

Share this post


Link to post
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
Sign in to follow this  

×