Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[TOOL] AoB Pattern Generator (coded in VBS, OpenSource)
Goto page Previous  1, 2
 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine
View previous topic :: View next topic  
Author Message
Attack
Cheater
Reputation: 0

Joined: 21 Mar 2011
Posts: 46
Location: Canada

PostPosted: Thu Feb 05, 2015 9:34 pm    Post subject: Reply with quote

Could you update the script so it doesn't do half bytes as they aren't supported by aobscan? I don't know vb at all.
Back to top
View user's profile Send private message
aikoncwd
Grandmaster Cheater
Reputation: 23

Joined: 21 Dec 2012
Posts: 591
Location: Spain (Barcelona)

PostPosted: Sat Feb 07, 2015 7:12 am    Post subject: Reply with quote

Attack wrote:
Could you update the script so it doesn't do half bytes as they aren't supported by aobscan? I don't know vb at all.


I can update the script, but this:

Code:
AA BB CC D? EE


Give the same result as

Quote:
AA BB CC ?? EE


right? So I think it's pointless to update the script.

_________________
Hey Hitler
Test here your skill with CheatEngine, I coded a challenge for you. Try to beat it!
HERE
Back to top
View user's profile Send private message
Attack
Cheater
Reputation: 0

Joined: 21 Mar 2011
Posts: 46
Location: Canada

PostPosted: Sat Feb 07, 2015 1:30 pm    Post subject: Reply with quote

I thought AOBScan doesn't work if you do half byte?
Back to top
View user's profile Send private message
Dark Byte
Site Admin
Reputation: 475

Joined: 09 May 2003
Posts: 25974
Location: The netherlands

PostPosted: Sat Feb 07, 2015 2:57 pm    Post subject: Reply with quote

aobscan handles any unsupported input as a wildcard. d? would therefore be handled as *
_________________
Tools give you results. Knowledge gives you control.

Like my help? Join me on Patreon so i can keep helping
Back to top
View user's profile Send private message MSN Messenger
Creepz
Newbie cheater
Reputation: 0

Joined: 24 Apr 2015
Posts: 18

PostPosted: Fri Apr 24, 2015 7:32 pm    Post subject: Nice Reply with quote

This comes in handy especially for the new people at CE like me.
Thanks!

How would I change the script to ask on the 4th time instead on the 3rd.
Back to top
View user's profile Send private message
Zanzer
I post too much
Reputation: 126

Joined: 09 Jun 2013
Posts: 3278

PostPosted: Fri Apr 24, 2015 8:13 pm    Post subject: Reply with quote

In case you wanted to build a form using VBS:

Code:
Dim ie
Set ie = CreateObject("InternetExplorer.Application")

Sub OpenSite()
   ie.Navigate "about:blank"
   ie.Document.Title = "My Application"
   ie.ToolBar = False
   ie.Resizable = False
   ie.StatusBar = False
   ie.Width = 800
   ie.Height = 600
   ie.Left = (ie.document.parentwindow.screen.availwidth - ie.Width) / 2
   ie.Top = (ie.document.parentwindow.screen.availheight - ie.Height) / 2

   Do While ie.Busy
      WScript.Sleep 200
   Loop

   ie.Document.Body.InnerHTML = "<h1>My Form</h1>" _
      & "<input type=""hidden"" id=""OK"" value=""0""/>" _
      & "<textarea id=""TextArea"" cols=""60"" rows=""5""></textarea><br/><br/>" _
      & "<button id=""SubmitButton"">Submit</button> &nbsp; " _
      & "<button id=""CloseButton"" onclick=""VBScript:OK.Value=1"">Close</button>"
   ie.Document.Body.Style.Overflow = "auto"
   ie.Visible = True
   ie.Document.All.SubmitButton.OnClick = GetRef("SubmitButton_OnClick")

   On Error Resume Next
   Do While ie.Document.All.OK.Value = 0
      WScript.Sleep 200
      If Err Then
         ie.Quit
         Set ie = Nothing
         Exit Sub
      End If
   Loop
   On Error Goto 0

   ie.Quit
   Set ie = Nothing
End Sub

Sub SubmitButton_OnClick
   MsgBox "Value Received:" & vbNewline _
      & ie.Document.All.TextArea.Value
End Sub

OpenSite
Back to top
View user's profile Send private message
aikoncwd
Grandmaster Cheater
Reputation: 23

Joined: 21 Dec 2012
Posts: 591
Location: Spain (Barcelona)

PostPosted: Fri Apr 24, 2015 8:15 pm    Post subject: Re: Nice Reply with quote

Creepz739 wrote:
This comes in handy especially for the new people at CE like me.
Thanks!

How would I change the script to ask on the 4th time instead on the 3rd.


Why you wanna change that? Some times you only have 2 patterns to compare... if you force users to get 3 patterns is a bad idea. Anyhow, edit lines 7 and 9 from the script addín this:

6) T = InputBox("Enter array of bytes nº 1:")
7) T = T & vbcrlf & InputBox("Enter array of bytes nº 2:")
Cool T = T & vbcrlf & InputBox("Enter array of bytes nº 3:")
9)
10) X = 4

_________________
Hey Hitler
Test here your skill with CheatEngine, I coded a challenge for you. Try to beat it!
HERE
Back to top
View user's profile Send private message
Creepz
Newbie cheater
Reputation: 0

Joined: 24 Apr 2015
Posts: 18

PostPosted: Fri Apr 24, 2015 8:22 pm    Post subject: Re: Nice Reply with quote

AikonCWD wrote:
Creepz739 wrote:
This comes in handy especially for the new people at CE like me.
Thanks!

How would I change the script to ask on the 4th time instead on the 3rd.


Why you wanna change that? Some times you only have 2 patterns to compare... if you force users to get 3 patterns is a bad idea. Anyhow, edit lines 7 and 9 from the script addín this:

6) T = InputBox("Enter array of bytes nº 1:")
7) T = T & vbcrlf & InputBox("Enter array of bytes nº 2:")
Cool T = T & vbcrlf & InputBox("Enter array of bytes nº 3:")
9)
10) X = 4


Why would it be a bad idea(Just wondering cause I want to learn)?Everytime I get an aob it's similar but always different so that's why I wanted to make it 3 not 2.
Back to top
View user's profile Send private message
Rissorr
Master Cheater
Reputation: 3

Joined: 17 Sep 2013
Posts: 273
Location: Israel!

PostPosted: Sun Apr 26, 2015 6:31 am    Post subject: Reply with quote

Your tool is really awesome! and works really great!

But i've got this bug:

Code:

Original array of bytes:

00 00 58 43 D8 00 00 00 00 00 00 00 D8 98 7D 72 C0 A4 32 02 00 00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 60 93 9F 69 00 00 00 00 00 00 00 00 00 00 00 00 68 8F 9F 69 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 90 8E 9F 69 00 00 00 00 00
?? ?? ?? ?? 0? 00 00 00 00 00 00 00 D8 98 ?? 7? ?? ?? ?? 02 00 00 00 00 01 00 00 00 01 00 00 00 00 00 00 00 60 93 ?? 6? 00 00 00 00 00 00 00 00 00 00 00 00 68 8F ?? 6? 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 90 8E ?? 6? 00 00 00 00 00


Total array of bytes: 3
Total wildcards used: 254

Your AoB Pattern:

??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????


Edit:
Looks like when i was clicking Yes in "do you want to introduce another aob", and then clicking cancel
The script was still adding to X (total array of bytes)

So i edited the script and added some code:

Code:

'Created by AikonCWD

Set oWSH = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")

T = InputBox("Enter array of bytes nº 1:")
T = T & vbcrlf & InputBox("Enter array of bytes nº 2:")

X = 3
While MsgBox("Do you want to introduce another array of bytes?", vbYesNo, "AoB Pattern Generator") = vbYes
        'T = T & vbcrlf & InputBox("Enter array of bytes nº " & X &":")
        'X = X + 1
      
      dim INPUT
      INPUT = InputBox("Enter array of bytes nº " & X &":")
      if INPUT = vbCancel then
         
      else
         T = T & INPUT
         X = X + 1
      end if   
Wend


AoB = Split(T, vbcrlf)

F = ""
W = 0
X = 0
For i = 1 To Len(AoB(0))
        For u = 1 To UBound(AoB)
                If Mid(AoB(u), i, 1) <> Mid(AoB(0), i, 1) Then
                        F = F & "?"
                        W = W + 1
                        X = 1
                        Exit For
                End If
        Next
        If X <> 1 Then F = F & Mid(AoB(0), i, 1)
        X = 0
Next

Set File = oFSO.CreateTextFile("aob.txt")
        File.Write "Original array of bytes:" & vbcrlf & vbcrlf
        File.Write Replace(T, vbcrlf & vbcrlf, vbcrlf) & vbcrlf & vbcrlf
        File.Write "Total array of bytes: " & UBound(AoB) + 1 & vbcrlf
        File.Write "Total wildcards used: " & W & vbcrlf & vbcrlf
        File.Write "Your AoB Pattern:" & vbcrlf & vbcrlf & F
File.Close

'MsgBox F

If MsgBox("AoB Pattern Generator finished" & vbcrlf & vbcrlf & "Do you want to open aob.txt file?", vbYesNo, "AoB Pattern Generator") = vbYes Then
        oWSH.Run "notepad.exe aob.txt"
End If


You can see there the variable INPUT that i added and used it to properly handle the 'Cancel' action
Back to top
View user's profile Send private message
Drivium
Expert Cheater
Reputation: 0

Joined: 16 Apr 2013
Posts: 100

PostPosted: Thu May 04, 2017 3:47 pm    Post subject: Reply with quote

For those that are obsessive about little details (like myself), I modded the script to replace each non matching byte with "??" and coded some error (null data/cancel) checking for the input boxes. Smile

Code:
'Created by AikonCWD

 Set oWSH = CreateObject("WScript.Shell")
 Set oFSO = CreateObject("Scripting.FileSystemObject")

'=================================================================================
'Cancel/Null Data check

 T = InputBox("Enter array of bytes nº 1:")

 if len(T)<2 THEN
 wscript.echo "Script Aborted"
 wscript.quit
 else

 T = T & vbcrlf & InputBox("Enter array of bytes nº 2:")

 end if

i = split(T,vbcrlf)
cCount = 0
for intCount = 0 to ubound(i)
cCount = cCount + 1
If cCount = 2  and len(i(intCount))<2 then
'wscript.echo "cCount: " & cCount & " " & "len(i(intCount)): " & len(i(intCount))
wscript.echo "Script Aborted"
wscript.quit
end if
next
'=================================================================================

 X = 3
 While MsgBox("Do you want to introduce another array of bytes?", vbYesNo, "AoB Pattern Generator") = vbYes
         'T = T & vbcrlf & InputBox("Enter array of bytes nº " & X &":")
         'X = X + 1
       
       dim INPUT
       INPUT = InputBox("Enter array of bytes nº " & X &":")
       if INPUT = vbCancel or len(INPUT)<2 then
       wscript.echo "Script Aborted"
       wscript.quit
       else
          T = T & INPUT
          X = X + 1
       end if   
 Wend


 AoB = Split(T, vbcrlf)

 F = ""
 W = 0
 X = 0
 For i = 1 To Len(AoB(0))
         For u = 1 To UBound(AoB)
                 If Mid(AoB(u), i, 1) <> Mid(AoB(0), i, 1) Then
                         F = F & "?"
                         W = W + 1
                         X = 1
                         Exit For
                 End If
         Next
         If X <> 1 Then F = F & Mid(AoB(0), i, 1)
         X = 0
 Next

'=================================================================================
'Modded to replace complete byte with "??" and modified wildcard count -Drivium
Set re = new regexp
oldF= F
re.Pattern = "([\?]\w)|(\w[\?])"
re.Global = True
newF = re.Replace(oldF, "??")
newW = len(newF) - len(replace(newF, "?", ""))
'=================================================================================

 Set File = oFSO.CreateTextFile("aob.txt")
         File.Write "Original array of bytes:" & vbcrlf & vbcrlf
         File.Write Replace(T, vbcrlf & vbcrlf, vbcrlf) & vbcrlf & vbcrlf
         File.Write "Total array of bytes: " & UBound(AoB) + 1 & vbcrlf
         File.Write "Total wildcards used: " & newW & vbcrlf & vbcrlf
         File.Write "Your AoB Pattern:" & vbcrlf & vbcrlf & newF
 File.Close

 'MsgBox F

 If MsgBox("AoB Pattern Generator finished" & vbcrlf & vbcrlf & "Do you want to open aob.txt file?", vbYesNo, "AoB Pattern Generator") = vbYes Then
         oWSH.Run "notepad.exe aob.txt"
 End If
Back to top
View user's profile Send private message
Drivium
Expert Cheater
Reputation: 0

Joined: 16 Apr 2013
Posts: 100

PostPosted: Mon May 08, 2017 9:34 am    Post subject: Reply with quote

Looks like using text boxes in this way limits the size of the string you can enter. I tried to enter a string that was pretty large and it cut off much of it. I'll try to work out an alternate solution.
Back to top
View user's profile Send private message
Drivium
Expert Cheater
Reputation: 0

Joined: 16 Apr 2013
Posts: 100

PostPosted: Fri Jun 09, 2017 12:38 pm    Post subject: Reply with quote

Rydian wrote:
Could a mode or alternate one be developed where the entry form is bigger and takes multi-line input and then just explodes the samples by linebreaks? When I'm working on data samples I tend to have them copied into the same text file, each sample on it's own line.

It'd save copy-pasting line by line and hitting the enter key twice between each copy-paste for when there's more than just 3-4 samples.


If you can give me an example of what you're describing, I can program it into a tool I recently released:

http://forum.cheatengine.org/viewtopic.php?t=604665

The tool DOES accept multi line entry, but may not behave the way you need, currently. Would you need the tool to turn your multiline entry into a single line (removing breaks)? So, AoB 1 would have multiple lines and AoB 2 would have multiple lines - the tool could remove breaks in each AoB and THEN compare as if each AoB is a single line. Do I have that right?

**EDIT: Yea, my tool does not currently handle multi-line entry well. I can fix it, just need an example of the use case.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Cheat Engine All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites