[Help] strlen.asm error

11/01/2012 11:19 ernilos#1
Hi guys! I have a error in .asm files(I use VC++), Error apear when Mysql do 3 or 4 query...
Normally crash on it:
Code:
std::string chr1 = "SELECT CharID0 FROM cuenta WHERE User='" + User + "';";
	mysql_real_query(nosdb,chr1.c_str(), chr1.length());
	mres = mysql_use_result(nosdb);
	mrow = mysql_fetch_row(mres);
	mysql_free_result(mres);
	std::cout << mrow[0] << std::endl;
And debugger show me that block of asm:
Code:
str_misaligned:
        ; simple byte loop until string is aligned
        mov     al,byte ptr [ecx]
        add     ecx,1
        test    al,al
        je      short byte_3
        test    ecx,3
        jne     short str_misaligned

        add     eax,dword ptr 0         ; 5 byte nop to align label below

        align   16                      ; should be redundant
line give error is:
Code:
        mov     al,byte ptr [ecx]
Why? ><
11/01/2012 14:01 SmackJew#2
Check if ecx contains a valid address at
Code:
 mov     al,byte ptr [ecx]
11/01/2012 14:59 ernilos#3
Quote:
Originally Posted by SmackJew View Post
Check if ecx contains a valid address at
Code:
 mov     al,byte ptr [ecx]
I hate ASM, How i can do? ><
11/01/2012 18:26 SmackJew#4
Quote:
Originally Posted by ernilos View Post
I hate ASM, How i can do? ><
Has nothing to do with ASM, your debugger should tell you, VC++ should tell you when you hover your mouse over ecx.
11/01/2012 20:09 ernilos#5
Quote:
Originally Posted by SmackJew View Post
Has nothing to do with ASM, your debugger should tell you, VC++ should tell you when you hover your mouse over ecx.
I think you say that:
Code:
Excepción no controlada en 0x5e18d51c (msvcr100d.dll) en GameServer.exe: 0xC0000005: Infracción de acceso al leer la ubicación 0xfeeefeee.
>.<Ç(IS vc++ ES) :/
11/02/2012 17:37 SmackJew#6
I don't speak Mongolian.