Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Injecting DLL before login crashes the client upon login on Win7 #178

Open
GoogleCodeExporter opened this issue Dec 13, 2015 · 16 comments
Open

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
client = Client.GetClients()[0];
            client.Dll.InitializePipe();

            HookProxy proxy = new HookProxy(client);
            proxy.ReceivedPlayerSpeechOutgoingPacket +=
Proxy_ReceivedPlayerSpeechOutgoingPacket;
            proxy.ReceivedTextMessageIncomingPacket +=
Proxy_ReceivedTextMessageIncomingPacket;

What is the expected output? What do you see instead?
Exception in Tibia.exe

What version of the product are you using? On what operating system?

TibiaApi 2.8
Windows 7 x64 (Visual Stuido, project is making in x86)
Please provide any additional information below.
I can login on player and i get TextMessage packets, but when i try to
relog TIbia.exe is crashing.

Original issue reported on code.google.com by [email protected] on 18 Nov 2009 at 10:39

@GoogleCodeExporter
Copy link
Author

Ok, my friend tested this on system x86 and it is working. :/ So only x64 
system has
that kind of error. Wtf ;/ 

I hope you will fix it soon ^^

Original comment by [email protected] on 18 Nov 2009 at 2:35

@GoogleCodeExporter
Copy link
Author

I was testing more and i found real problem. It is Window 7 x86 and x64, no 
matter.
:/ On my Laptop (Windows 7 x86) and my PC (Windows 7 x64) is same problem, 
Tibia crash.

Original comment by [email protected] on 18 Nov 2009 at 8:11

@GoogleCodeExporter
Copy link
Author

Does the error persist if you compile both dlls for x64?

Original comment by [email protected] on 18 Nov 2009 at 10:10

@GoogleCodeExporter
Copy link
Author

The Tibia client is a 32-bit program so both DLLs needs to be compiled as x86 
for
them to work properly. I have Windows 7 x86 and the client crashes if I 
initialize
the pipe before I login and I try to login or I'm already logged in and I try to
relog (Ctrl+G). Here's my error.txt:

+---------------------------------------------------------------
Debug Assertion 8.53 NWin32Exception.cpp 50
Wed Nov 18 20:45:30 2009
Graphic Engine: DirectX9 (2)
Operating System: Windows 7 Ultimate Edition 32 Bit in USA
Processor: AMD Sempron 3100+
Video Card: ATI Radeon 9600 SERI
Last Packet Types: 161 160 180 210 141 130 120 120 120 120
Last Packet: 010 070 207 118 001 050 000 000 100 070 125 193 125 007 103 000
Player Position: [32070,32193,7]
Player Name: Bingalingam (Calmera)
Player Action: 055 052 046 053 052 046 050 050 048 046 052 049 058 055 049 055 
049
Player.cpp 361: exception occurred, reason:
Player.cpp 465: exception occurred, reason:
Control.cpp 1719: exception occurred (MessageType: 75 MaW: 20B3FE8 MoW: 0), 
reason:
Control.cpp 1684: exception occurred (Type = 75), reason:
Network.cpp 905: exception occurred, reason:
Network.cpp 756: exception occurred (PlayerSocketPointerStatus = 1), reason:
NWin32Exception.cpp 50: win32 exception occurred, reason:
access violation (read attempt at 00000000)
----------------------------------------------------------------

bimhernas, if you would be so kind as to paste your error.txt we would really
appreciate it. You can block out the player name/world, we don't need that ;). 
To
access your error.txt file, click Start, in the 'Search programs and files' 
field
type %appdata% and press enter, in the window that appears scroll down to and 
open
the Tibia folder, you'll see the file there. Make sure you don't restart Tibia 
after
it crashes because the error.txt file we be deleted.

Original comment by [email protected] on 19 Nov 2009 at 1:51

@GoogleCodeExporter
Copy link
Author

My error is such as you:

+---------------------------------------------------------------
Debug Assertion 8.53 NWin32Exception.cpp 50
Fri Nov 20 23:48:12 2009
Graphic Engine: OpenGL (1)
Operating System: Windows XP Professional in POL
Processor: Intel Core 2 DUO E8400
Video Card: NVIDIA GeForce 9800 GT
Last Packet Types: 131 133 109 140 140 109 131 133 109 170
Last Packet: 133 080 126 044 124 007 081 126 043 124 007 010 131 081 126 043
Player Position: [32333,31782,7]
Player Name: Linandil (Antica)
Player Action: 055 055 046 050 051 055 046 050 051 057 046 053 049 058 055 049 
055 049
Player.cpp 361: exception occurred, reason:
Player.cpp 465: exception occurred, reason:
Control.cpp 1719: exception occurred (MessageType: 75 MaW: 2CAEEA0 MoW: 0), 
reason:
Control.cpp 1684: exception occurred (Type = 75), reason:
Network.cpp 905: exception occurred, reason:
Network.cpp 756: exception occurred (PlayerSocketPointerStatus = 1), reason:
NWin32Exception.cpp 50: win32 exception occurred, reason:
access violation (read attempt at 00000000)
----------------------------------------------------------------
And i have the same problem like you. When i am loggeded in and initialize 
pipe, all
is ok till i try to relog. I can get packets etc. But login on any character 
means
crash. :|

Original comment by [email protected] on 20 Nov 2009 at 10:50

@GoogleCodeExporter
Copy link
Author

The problem is with the pipe. If you comment out the WriteFileEx() line in both 
the
Recv and Send functions this problem does not occur.

Original comment by [email protected] on 1 Mar 2010 at 6:28

@GoogleCodeExporter
Copy link
Author

Right, but then the PacketHook is useless :P.

It is also worth saying that this is a Win 7 (and Vista?) only problem.

Original comment by ian320 on 1 Mar 2010 at 5:47

  • Changed state: Accepted

@GoogleCodeExporter
Copy link
Author

Original comment by ian320 on 1 Mar 2010 at 5:48

  • Changed title: Injecting DLL before login crashes the client upon login on Win7

@GoogleCodeExporter
Copy link
Author

Yes, but atleast we know the problem is within the pipe. And from recent trials 
I've been able to further 
pinpoint it to the BeginRead function in Pipe.cs, more so the pipe.read(..) 
line. And it seems to be win7 
only, Vista doesn't seem to be affected.

Original comment by [email protected] on 1 Mar 2010 at 9:30

@GoogleCodeExporter
Copy link
Author

I tried to run program in compatibility mode, but problem is still alive :) 

Original comment by [email protected] on 1 Mar 2010 at 9:33

@GoogleCodeExporter
Copy link
Author

Issue 203 has been merged into this issue.

Original comment by ian320 on 21 Apr 2010 at 10:24

@GoogleCodeExporter
Copy link
Author

Anyone knows somethin' about how is it with this issue? Last comment Apr 21 
2010, so its a while ago. I still have this problem, I've got many Windows 7 
users and I can't forget about them. If it can be fixed, can anyone comment 
here?

Original comment by [email protected] on 30 Dec 2010 at 9:03

@GoogleCodeExporter
Copy link
Author

I gived up :/ I couldn't find where is problem with this. 

Original comment by [email protected] on 30 Dec 2010 at 9:07

@GoogleCodeExporter
Copy link
Author

This is a known bug, possibly a windows bug. Note that the managed dll in the 
forked project does not have this issue, although it is a bit more limited (no 
context menus, for instance).

Original comment by ian320 on 6 Jan 2011 at 6:22

@GoogleCodeExporter
Copy link
Author

[deleted comment]

@GoogleCodeExporter
Copy link
Author

Creating a new thread and using WriteFileEx from such thread seems to fix this 
kind of crash.

For more info see 
http://code.google.com/p/tibiaapi/source/browse/branches/tibiaapi-current/trunk/
tibiaapi/InjectedDLL/Core.cpp

Original comment by [email protected] on 13 Nov 2012 at 1:11

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant