Some Fixes

05/21/2018 13:10 DerMoench14#1
Some fixes for the last updates:

Code:
$lTemp = GetScannedAddress('ScanLoadFinished', -0x48)

_('ScanLoadFinished:')
AddPattern('90558BEC83EC1053578BD9')
Code:
$lTemp = GetScannedAddress('ScanStringFilter1', 0x1D)

_('ScanStringFilter1:')
AddPattern('5E8BE55DC204008B55088BCE52')
Code:
$lTemp = GetScannedAddress('ScanStringFilter2', 0x61)

_('ScanStringFilter2:')
AddPattern('D85DF85F5E5BDFE0F6C441')
Code:
SetValue('ClickToMoveFix', '0x' & Hex(GetScannedAddress("ScanClickToMoveFix", -0x1E), 8))

_('ScanClickToMoveFix:')
AddPattern('568BF1578B460883F80F')
Just wondering how long it will last this time :)
05/21/2018 16:48 tjubutsi#2
I've not had issues with any of these, maybe just the string stuff. What does the ClickToMoveFix even do? The ScanLoadFinished on the current version on github works fine btw, tried the one you posted but that broke.
05/21/2018 17:55 DerMoench14#3
When you inject GWA2/gwApi the very first time it's all good.
When you inject the API again it fails to read the Agent-Names.

Code:
Func Test()
	Local $lAgentName, $lAgentID, $lAgentArray = GetAgentPtrArray()
	For $i = 1 To $lAgentArray[0]
		$lAgentID = MemoryRead($lAgentArray[$i] + 44, 'long')
		$lAgentName = GetAgentName($lAgentArray[$i])
		out($lAgentName)
	Next
EndFunc
This Func should work ... didn't test it, tho :)

Quote:
Originally Posted by tjubutsi View Post
The ScanLoadFinished on the current version on github works fine btw, tried the one you posted but that broke.
Could be because you changed ASM-Code, too.
05/22/2018 00:44 goofyninja#4
Thanks - unlike headers which don't seem too bad to find again. Is there a process for finding these patterns?
05/22/2018 01:25 phat34#5
Can you post your ASM portion of gw2a DerMoench14 so that we can compare to make sure it matches ours.. and can you specify an example where TJ changing his asm would affect this pattern searching in codespace while gw.exe is executing?

Also I have two statements in my code for loadfinished.

Code:
SETVALUE("LoadFinishedStart", "0x" & HEX(GETSCANNEDADDRESS("ScanLoadFinished", 1), 8))
SETVALUE("LoadFinishedReturn", "0x" & HEX(GETSCANNEDADDRESS("ScanLoadFinished", 6), 8))
How would I set these two lines to work with the new pattern?
05/22/2018 04:46 savsuds#6
Thanks for this. That Move() crashing GW when using gwAPI was killing me trying to find a solution.
05/22/2018 11:15 DerMoench14#7
Uhm ... well there's no need to scan the same address twice.
So instead doing this:
Code:
SETVALUE("LoadFinishedStart", "0x" & HEX(GETSCANNEDADDRESS("ScanLoadFinished", -0x48), 8))
SETVALUE("LoadFinishedReturn", "0x" & HEX(GETSCANNEDADDRESS("ScanLoadFinished", -0x43), 8))
i do this:
Code:
$lTemp = GetScannedAddress('ScanLoadFinished', -0x48)
SetValue('LoadFinishedStart', '0x' & Hex($lTemp, 8))
SetValue('LoadFinishedReturn', '0x' & Hex($lTemp + 5, 8))
ASM-Part:
Code:
Func CreateLoadFinished()
	_('LoadFinishedProc:')
	_('pushad')

	_('mov eax,1')
	_('mov dword[MapIsLoaded],eax')

	_('xor ebx,ebx')
	_('mov eax,StringLogBase')
	_('LoadClearStringsLoop:')
	_('mov dword[eax],0')
	_('inc ebx')
	_('add eax,100')
	_('cmp ebx,StringLogSize')
	_('jnz LoadClearStringsLoop')

	_('xor ebx,ebx')
	_('mov eax,TargetLogBase')
	_('LoadClearTargetsLoop:')
	_('mov dword[eax],0')
	_('inc ebx')
	_('add eax,4')
	_('cmp ebx,TargetLogSize')
	_('jnz LoadClearTargetsLoop')

	_('push 5')
	_('push 0')
	_('push CallbackEvent')
	_('push dword[CallbackHandle]')
	_('call dword[PostMessage]')

	_('popad')
	_('mov edx,dword[esi+1C]')
	_('mov ecx,edi')
	_('ljmp LoadFinishedReturn')
EndFunc   ;==>CreateLoadFinished
Just to clearify: I didn't say tjubutsi's pattern does not work ... there are almost unlimited possibilities for correct patterns. My pattern is just different but neighter better nor bad.

Edit:
I see that tjubutsi hooks a different Func.
The "original" LoadFinished is @[Only registered and activated users can see links. Click Here To Register...]D61E6 ... he hooks @[Only registered and activated users can see links. Click Here To Register...]05B9E.

[Only registered and activated users can see links. Click Here To Register...]

That could explain the changes in ASM. Didn't dig deeper into it.
Maybe he could tell us how he found that Func.

However ... if it works than everything is gucci :)
05/22/2018 11:27 tjubutsi#8
Quote:
Originally Posted by DerMoench14 View Post
Edit:
I see that tjubutsi hooks a different Func.
The "original" LoadFinished is @[Only registered and activated users can see links. Click Here To Register...]D61E6 ... he hooks @[Only registered and activated users can see links. Click Here To Register...]05B9E.

[Only registered and activated users can see links. Click Here To Register...]

That could explain the changes in ASM. Didn't dig deeper into it.
Maybe he could tell us how he found that Func.
I just found someone else that posted an alternative. It worked. So I kept it. So far I've not had issues. I think I also don't have LoadFinishedReturn at all.

Your assembly
Code:
	_('popad')
	_('mov edx,dword[esi+1C]')
	_('mov ecx,edi')
	_('ljmp LoadFinishedReturn')
My assembly
Code:
	_('popad')
	_('mov esp,ebp')
	_('pop ebp')
	_('retn 10')
05/23/2018 06:51 phat34#9
Some may be having conflicts with this pattern:

Code:
$lTemp = GetScannedAddress('ScanLoadFinished', -0x48)

_('ScanLoadFinished:')
AddPattern('90558BEC83EC1053578BD9')
if so try this one...

Code:
$lTemp = GetScannedAddress('ScanLoadFinished', -0x58)

_('ScanLoadFinished:')
AddPattern('8B53148B782C8D4D')
...if your not sure if its correct or not... you can check your code by adding third line below to your code...

Code:
    ; find these below
        $lTemp = GetScannedAddress('ScanLoadFinished', -0x58)
 	SetValue('LoadFinishedStart', '0x' & Hex($lTemp, 8))

    ; add this line
	MSGBOX(0, "LoadFinishedStart", "Address: " & Hex($lTemp, 8))
if successful a message box will pop up with the correct address of the load finished code which as DerMo14 stated is @[Only registered and activated users can see links. Click Here To Register...]D61E6.

...ALso my ScanTargetLog Pattern is invalid...

Can someone post a correct pattern for this:

Code:
$lTemp = GetScannedAddress('ScanTargetLog', 1)
SetValue('TargetLogStart', '0x' & Hex($lTemp, 8))
SetValue('TargetLogReturn', '0x' & Hex($lTemp + 5, 8))

_('ScanTargetLog:')
AddPattern('5356578BFA894DF4E8')
---EDIT--- well after successive starts and re-starts of the API, My Scan Target Log was showing invalid... So assuming I can re-create the issue and cause problems, I just went ahead and updated my pattern instead. If anyone else was having trouble with this function, here is the new data.

Code:
$lTemp = GetScannedAddress('ScanTargetLog', -0x1F) ; old offset  0x01
SetValue('TargetLogStart', '0x' & Hex($lTemp, 8))
SetValue('TargetLogReturn', '0x' & Hex($lTemp + 5, 8))

_('ScanTargetLog:')
;AddPattern('5356578BFA894DF4E8') ; old pattern
AddPattern('F1894DF0763A8B43')
05/24/2018 18:48 Stary Pen'#10
Guys, if I change these values will the rendering work?
05/25/2018 06:06 mityay12#11
Quote:
will the rendering work?
No
05/25/2018 10:26 DerMoench14#12
Quote:
Originally Posted by phat34 View Post
---EDIT--- well after successive starts and re-starts of the API, My Scan Target Log was showing invalid... So assuming I can re-create the issue and cause problems, I just went ahead and updated my pattern instead. If anyone else was having trouble with this function, here is the new data.
Code:
$lTemp = GetScannedAddress('ScanTargetLog', -0x1F) ; old offset  0x01
SetValue('TargetLogStart', '0x' & Hex($lTemp, 8))
SetValue('TargetLogReturn', '0x' & Hex($lTemp + 5, 8))

_('ScanTargetLog:')
;AddPattern('5356578BFA894DF4E8') ; old pattern
AddPattern('F1894DF0763A8B43')
You're right! I did a Typo when i scanned for the Pattern-Quality and didn't notice it.

THX!
05/29/2018 16:28 phat34#13
greets... just realized use heroskill was broken as well...? anyone have a working pattern combination for this one? If not, I may have time to locate it later...
05/29/2018 19:14 Surimata#14
I'm in trouble with gigi's vaettir bot. When leaving longeye, GW often crashes with a memory read error. "Memory at address 00000004 could not be read"
The first time i had gigi's version of gwa2 with updated headers by myself. Then i tried tjubutsi's version from GitHub. Same problem there. And for now i used the fix by DerMoench14.
With all three versions i have this crash on all accounts very often.

Could it be that there is still a mistake hidden somewhere?

I add this
Code:
MSGBOX(0, "LoadFinishedStart", "Address: " & Hex($lTemp, 8))
and it returns 007D61E6. For that point i should be ok?!
I don't understand this.

The funny thing is that it only occurs when leaving longeye and not at jaga or bjora.
05/29/2018 19:18 DerMoench14#15
Quote:
Originally Posted by phat34 View Post
greets... just realized use heroskill was broken as well...? anyone have a working pattern combination for this one? If not, I may have time to locate it later...
Code:
SetValue('UseHeroSkillFunction', '0x' & Hex(GetScannedAddress('ScanUseHeroSkillFunction', -0xA1), 8))
_('ScanUseHeroSkillFunction:')
AddPattern('8D0C765F5E8B')
Still workes for me.