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 


Search Array of Byte vb.net

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
myown
How do I cheat?
Reputation: 0

Joined: 11 Mar 2014
Posts: 9

PostPosted: Tue May 06, 2014 2:55 pm    Post subject: Search Array of Byte vb.net Reply with quote

hello how can Search Array of Byte in vb.net
i can in autoit but i wan in vb.net can some one help m
in autoit i use

Code:

Func _MemoryScan($ah_Handle, $pattern, $after = False, $iv_addrStart = 0x00400000, $iv_addrEnd = 0X0FFFFFFF, $step = 51200)
   If Not IsArray($ah_Handle) Then
      SetError(1)
      Return -1
   EndIf
   $pattern = StringRegExpReplace($pattern, "[^0123456789ABCDEFabcdef.]", "")
   If StringLen($pattern) = 0 Then
      SetError(2)
      Return -2
   EndIf
   For $addr = $iv_addrStart To $iv_addrEnd Step $step - (StringLen($pattern) / 2)
      StringRegExp(_MemoryRead($addr, $ah_Handle, "byte[" & $step & "]"), $pattern, 1, 2)
      If Not @error Then
         If $after Then
            Return StringFormat("0x%.8X", $addr + ((@extended - 2) / 2))
         Else
            Return StringFormat("0x%.8X", $addr + ((@extended - StringLen($pattern) - 2) / 2))
         EndIf
      EndIf
   Next
   Return -3
EndFunc   ;==>_MemoryScan

Func _StringToArrayOfByte($String)
   Local $AoB = StringToBinary($String)
   Local $AntiHex = _StringBetween($AoB, "0x", "")
   Return $AntiHex[0]
EndFunc   ;==>_StringToArrayOfByte

Func _SEDEBUG()
   Local $tagLUIDANDATTRIB = "int64 Luid;dword Attributes"
   Local $count = 1
   Local $tagTOKENPRIVILEGES = "dword PrivilegeCount;byte LUIDandATTRIB[" & $count * 12 & "]"
   Local $call = DllCall("advapi32.dll", "int", "OpenProcessToken", "hwnd", _WinAPI_GetCurrentProcess(), "dword", 0x20, "int*", "")
   Local $hToken = $call[3]
   $call = DllCall("advapi32.dll", "int", "LookupPrivilegeValue", "str", "", "str", "SeDebugPrivilege", "int64*", "")
   Local $iLuid = $call[3]
   Local $TP = DllStructCreate($tagTOKENPRIVILEGES)
   Local $LUID = DllStructCreate($tagLUIDANDATTRIB, DllStructGetPtr($TP, "LUIDandATTRIB"))
   DllStructSetData($TP, "PrivilegeCount", $count)
   DllStructSetData($LUID, "Luid", $iLuid)
   DllStructSetData($LUID, "Attributes", $SE_PRIVILEGE_ENABLED)
   $call = DllCall("advapi32.dll", "int", "AdjustTokenPrivileges", "hwnd", $hToken, "int", 0, "ptr", DllStructGetPtr($TP), "dword", 0, "ptr", "", "ptr", "")
EndFunc   ;==>_SEDEBUG



Code:
      _GUICtrlEdit_SetText($Adress_Array, "")
         $String_Text = GUICtrlRead($Text_Input)
         $Adress_Start = GUICtrlRead($Start_Adress_Input)
         $Adress_End = GUICtrlRead($Stop_Adress_Input)
         Do
            $Result = _MemoryScan($Open, $String_Text, False, $Adress_Start, $Adress_End)
            If $Result = -3 Then
               ExitLoop
            Else
               _GUICtrlEdit_InsertText($Adress_Array, $Result & @CRLF, -1)
            EndIf
            $Adress_Start = $Result + 1
         Until $Result = -3
      EndIf
Back to top
View user's profile Send private message
atom0s
Moderator
Reputation: 205

Joined: 25 Jan 2006
Posts: 8587
Location: 127.0.0.1

PostPosted: Tue May 06, 2014 10:43 pm    Post subject: Reply with quote

This is how I do it in C#:
https://github.com/atom0s/Wardrobe/blob/master/Wardrobe/Classes/SigScan.cs

You can use an online converter to port it to Vb.NET and fix it up etc.

_________________
- Retired.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
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