I've code that should parse String format to int but it changes f.e. 0 to 658688 and I don't know what to do with it. Is the lodsd command correct here?
toparse DB 128 dup(?)
mov toparse, "0"
atoi proc uses esi edx inputBuff:DWORD
mov esi, inputBuff
xor edx, edx
.Repeat
lodsd
.Break .if !eax
imul edx, edx, 10
sub eax, "0"
add edx, eax
.Until 0
mov EAX, EDX
ret
atoi endp
it returns 658688
You need to either
invokethe atoi proc with the ascii's memory offset orpushthe offset beforecalling atoi. Right nowesiwill just contain the random values that are already ininputbuff.I have revised the proc so that it will process full strings successfully.