Jump to content

Login Crashes


Larva

Recommended Posts

Well as many already know theres a bug in the login and some days is very annoying it crashes, the debug dosen't help mush

but since we dont know what is the cause of this nor how to fix it im just making plublic what the debug has tell us.

just avoid to make post with non sense, any irrelevant post is going to be delete.

well first we have the common message from windows.

First-chance exception at 0x0044cee2 in login_server.exe: 0xC0000005: Access violation writing location 0x04e04000.
Unhandled exception at 0x0044cee2 in login_server.exe: 0xC0000005: Access violation writing location 0x04e04000.
First-chance exception at 0x0044cee2 in login_server.exe: 0xC0000005: Access violation writing location 0x04e04000.
Unhandled exception at 0x0044cee2 in login_server.exe: 0xC0000005: Access violation writing location 0x04e04000..

and doesn't tell us mush.

the next is what visual has tell running the login in debug.

-------------------------------------------------
CAll Stack
>	login_server.exe!RleDecode(unsigned char * src=0x04be27c4, unsigned char * dest=0x04e04000, unsigned int src_size=10692)  Line 6952 + 0x6 bytes	C
	login_server.exe!decompressShipPacket(st_orange * ship=0x04be0040, unsigned char * dest=0x04befa6c, unsigned char * src=0x04be0068)  Line 7081 + 0x17 bytes	C
	login_server.exe!main(int argc=1, char * * argv=0x00393710)  Line 6308 + 0x22 bytes	C
	login_server.exe!__tmainCRTStartup()  Line 266 + 0x19 bytes	C
	login_server.exe!mainCRTStartup()  Line 182	C
	kernel32.dll!77e6f23b() 	
	[Frames below may be incorrect and/or missing, no symbols loaded for kernel32.dll]	

---------------------------------------------------------
LOCAL

-		src	0x04be27c4 "W¼ÞìöBÊd8~ÿÿœ%¾"	unsigned char *
		87 'W'	unsigned char
-		dest	0x04e04000 <Bad Ptr>	unsigned char *
		CXX0030: Error: expression cannot be evaluated	
	src_size	10692	unsigned int
	src_end	79571504	unsigned int
	prevChar	107 'k'	unsigned char
	currChar	107 'k'	unsigned char
	count	40219	unsigned short
---------------------------------------------
AUTO

	count	40219	unsigned short
	currChar	107 'k'	unsigned char
-		dest	0x04e04000 <Bad Ptr>	unsigned char *
		CXX0030: Error: expression cannot be evaluated	

and the part of the code.

*(dest++) = currChar; <--------THIS IS THE LINE DEBUG IS SHOWING

void RleDecode(unsigned char *src, unsigned char *dest, unsigned src_size)
{
   unsigned char currChar, prevChar;             /* current and previous characters */
   unsigned short count;                /* number of characters in a run */
unsigned src_end;

src_end = (unsigned) src + src_size;

   /* decode */

   prevChar = 0xFF - *src;     /* force next char to be different */

   /* read input until there's nothing left */

   while ((unsigned) src < src_end)
   {
	currChar = *(src++);

	*(dest++) = currChar;  <--------THIS IS THE LINE DEBUG IS SHOWING

       /* check for run */
       if (currChar == prevChar)
       {
           /* we have a run.  write it out. */
		count = *(unsigned short*) src;
		src += 2;
           while (count > 0)
           {
			*(dest++) = currChar;
               count--;
           }

           prevChar = 0xFF - *src;     /* force next char to be different */
       }
       else
       {
           /* no run */
           prevChar = currChar;
       }
   }
}


/* expand a key (makes a rc4_key) */

if any one has a good idea please say so , at the moment no know has a clue on how to fix this.

thanks.

and the login code is clean with out modifications so don't start blaming any custom modification.

Link to comment
Share on other sites

I am by NO means an expert on C++, so please disregard this if it sounds like a stupid idea:

change:

*(dest++) = currChar;

to this:

*(dest)++ = currChar;

I am not 100% sure what this code does, so I hope this at least sparks an idea.

Also, I do not see where "dest" is ever defined, it could be in another section of the code, but maybe that is the problem.(I looked again, I found it)

Last, check to see if "dest" is pointing to actual data, not an undeclared variable.

Edit: One final thought, can you post any section of code where you call the "RleDecode" function? Because, maybe the parameter is the wrong data type or the parameter was not defined.

Edited by VonPawn
Link to comment
Share on other sites

This is the first line of the call stack:

login_server.exe!RleDecode(unsigned char * src=0x04be27c4, unsigned char * dest=0x04e04000, unsigned int src_size=10692)  Line 6952 + 0x6 bytes C

What data is at the following reference?

0x04e04000

unsigned char * dest=0x04e04000

Edit: After doing more research, I have another idea as to what the problem is. Is it possible that this "dest" pointer is pointing to another pointer? because that can cause some access violations if setup incorrectly.

Hey Larva, the more information you provide, the more ideas I can give. Thanks.

(I won't be back for 3 days so you will probably already fix it by the time I'm back. Please post the solution if you find out)

Edited by VonPawn
Link to comment
Share on other sites

Isn't there a tool that shows you the value of each variable, after every command?

I know there is such a feature in eclipse wich is very useful when I write some Java.

That way, you can exactly see where your program goes wrong.

For example :

prevChar = 0xFF - *src;     /* force next char to be different */

If *src = 0 it would change nothing.

If you don't have such tool, you can write a line under each command to 'System.out.print(the value)'

I don't know alot of C++ as we've only seen Java at school, but maybe this gives you some ideas to build on...

Link to comment
Share on other sites

Ran into this while back.

http://www.pioneer2.net/src/login_server.c

has all the code there for loggin server

just though this may help or mabe give idea or mabe help for comparison. I dont know.. =P

Edit: After posting this i relized this is sodaboys code wich is already in use. Lol and I know Larva uses this..

So delete this post if you want.

Edited by Green
  • Like 4
Link to comment
Share on other sites

Ran into this while back.

http://www.pioneer2.net/src/login_server.c

has all the code there for loggin server

just though this may help or mabe give idea or mabe help for comparison. I dont know.. =P

Edit: After posting this i relized this is sodaboys code wich is already in use. Lol and I know Larva uses this..

So delete this post if you want.

Actually, this helps me because it is an extension of the code that Larva posted, which is exactly what I was asking for. :)

Link to comment
Share on other sites

  • 2 weeks later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...