Skip to content
This repository has been archived by the owner on Nov 14, 2023. It is now read-only.

access violation #18

Closed
gwmai opened this issue Aug 2, 2019 · 9 comments
Closed

access violation #18

gwmai opened this issue Aug 2, 2019 · 9 comments

Comments

@gwmai
Copy link

gwmai commented Aug 2, 2019

Hi,
I'm trying to include GWCA in my project as in the example and I've added the include libraries in my setup. The executable now builds fine however when I execute the first function GW::Initialize() I receive the following error
Exception thrown at 0x00806823 in App.exe: 0xC0000005: Access violation reading location 0x00401000.

System.AccessViolationException: 'Attempted to read or write protected memory. This is often an indication that other memory is corrupt.'

And it's happening here

image

So I'm pretty much stuck at the first step.

	if (GW::Initialize()) {
		this->initialized = true;
		this->button1->Text = "Stop";
	}

Any ideas why this might be happening? I'd be happy to provide additional info to troubleshoot it if I new what is needed :)

Any help is appreciated.

PS: I'm running as administrator and with a/v disabled completely.

@reduf
Copy link
Collaborator

reduf commented Aug 4, 2019

Did you called GW::Scanner::Initialize before calling GW::Initialize ?

It should be called from within GW::Initialize, but it's not right now, so that might be the reason.

@gwmai
Copy link
Author

gwmai commented Aug 4, 2019

@reduf I tried your suggestion but I still receive the same access violation. GW:Scanner:Initialize executes correctly and GW::Initialize throws the exception.

@reduf
Copy link
Collaborator

reduf commented Aug 5, 2019

When the access violation is thrown, can you check the value of g_base and g_size ?
Also, if you go up in the call stack, can you check on which pattern it happens ?

@gwmai
Copy link
Author

gwmai commented Aug 5, 2019

Sure,
right when the exception is thrown these are the values for pattern, g_base and g_size.

pattern | 0x003fafac "V‹ñ;ðr\x4" | const char *
g_base | 4198400 | unsigned int
g_size | 4825088 | unsigned int

@reduf
Copy link
Collaborator

reduf commented Aug 5, 2019

g_base and g_size are correct, but for the pattern can you post the code at the calling site. That is the FindPattern that cause that. You can easily access it through your call stack.

@gwmai
Copy link
Author

gwmai commented Aug 5, 2019

Sorry to touble you, I'm not really well versed in debugging with visual studio code so I might not be following you correctly.

In my call stack I see :

image

It seems the function executed before this exception is thrown is GW::MemoryMgr::Scan

In that one, it's this line that's throwing the error but there's no pattern variable here. It's a fixed string.

image

PS: I couldn't find any string in the code called FindPattern.

@reduf
Copy link
Collaborator

reduf commented Aug 5, 2019

I think that the problem is that GWCA only make sense if it's inside Gw.exe. Right now, it seems that you use it in an other process.

@gwmai
Copy link
Author

gwmai commented Aug 5, 2019

I was under the impression that I can build my application including GWCA as a library and the initialize function would let it hook itself to the gw.exe instance.

@reduf
Copy link
Collaborator

reduf commented Aug 5, 2019

You can build a dll including GWCA and load this dll into the game process.

@reduf reduf closed this as completed Aug 5, 2019
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants