Solved AutoIt to c++

Hexui Undetected CSGO Cheats Sinkicheat PUBG Cheat

wibo99

Newbie
Full Member
May 10, 2015
9
228
0
posting because my brain is going to explode xD
dunno how the findpattern is working


C++:
; findpattern stuff 

Func findpattern($ah_handle, $pattern, $after = False, $iv_addrstart = 4194304, $iv_addrend = 16777215, $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  [USER=46504]error[/USER] 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
C++:
Func getascontext()

	$baseaddr = _getmodulebasebyname(ProcessExists("test.exe"), "")

	If NOT IsArray($baseaddr) OR $baseaddr[1] == 0 Then
		MsgBox(16, "Error", "Gw2.exe not found")
		Exit
	EndIf

	$modaddr = Number($baseaddr[1])
	$modsize = $modaddr + Number($baseaddr[2])

	$paddress = findpattern($hprocess, "8D4DD4518BC88B10FF5234", False, $modaddr, $modsize) ; ?

	If $paddress <= 0 Then Return -1
	Return _memoryread(getcalladdress(Number($paddress) - 5) + 1, $hprocess, "dword")

EndFunc
C++:
Func getviewdiststate()

	Local $ptemp
	Local $ret[2]

	$ptemp = findpattern($hprocess, "7412D905") ; ??

	If $ptemp > 0 Then
		$ret[0] = Int($ptemp) + 22
		$ret[0] = _memoryread($ret[0], $hprocess, "dword") - 4
		If _memoryread($ret[0], $hprocess, "float") == 10000 Then
			$ret[1] = True
		Else
			$ret[1] = False
		EndIf
		Return $ret
	EndIf
	Return -1

EndFunc
 

Liduen

Hacker
Dank Tier VIP
May 19, 2013
702
8,478
33
posting because my brain is going to explode xD
dunno how the findpattern is working


C++:
; findpattern stuff 

Func findpattern($ah_handle, $pattern, $after = False, $iv_addrstart = 4194304, $iv_addrend = 16777215, $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  [USER=46504]error[/USER] 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
C++:
Func getascontext()

	$baseaddr = _getmodulebasebyname(ProcessExists("test.exe"), "")

	If NOT IsArray($baseaddr) OR $baseaddr[1] == 0 Then
		MsgBox(16, "Error", "Gw2.exe not found")
		Exit
	EndIf

	$modaddr = Number($baseaddr[1])
	$modsize = $modaddr + Number($baseaddr[2])

	$paddress = findpattern($hprocess, "8D4DD4518BC88B10FF5234", False, $modaddr, $modsize) ; ?

	If $paddress <= 0 Then Return -1
	Return _memoryread(getcalladdress(Number($paddress) - 5) + 1, $hprocess, "dword")

EndFunc
C++:
Func getviewdiststate()

	Local $ptemp
	Local $ret[2]

	$ptemp = findpattern($hprocess, "7412D905") ; ??

	If $ptemp > 0 Then
		$ret[0] = Int($ptemp) + 22
		$ret[0] = _memoryread($ret[0], $hprocess, "dword") - 4
		If _memoryread($ret[0], $hprocess, "float") == 10000 Then
			$ret[1] = True
		Else
			$ret[1] = False
		EndIf
		Return $ret
	EndIf
	Return -1

EndFunc
So what do you want us to do?
Whatever it is this might help you out.
 
Last edited:
Attention! Before you post:

Read the How to Ask Questions Guide
99% of questions are answered in the Beginner's Guide, do it before asking a question.

No Hack Requests. Post in the correct section.  Search the forum first. Read the rules.

How to make a good post:

  • Fill out the form correctly
  • Tell us the game name & coding language
  • Post everything we need to know to help you
  • Ask specific questions, be descriptive
  • Post errors, line numbers & screenshots
  • Post code snippets using code tags
  • If it's a large project, zip it up and attach it

If you do not comply, your post may be deleted.  We want to help, please make a good post and we will do our best to help you.

Community Mods