I am looking at the following disassembly for a Win32 executable in IDA pro and get the snwprintf
part but I don't understand the purpose of the mov ecx, [eax+4]
instruction here (are they discarding part of the string here?).
loc_4018E7:
mov eax, 0DEEDh
push eax
push offset asc_402270 ; "%X"
push 4 ; size_t no. chars
lea ecx, [ebp+var_inpPassStr]
push ecx ; wchar_t * opBuffer
call ds:_snwprintf ; convert number to HEX string
add esp, 10h
xor edx, edx
mov [ebp+var_8], dx
mov eax, [ebp+arg_inpPass]
mov ecx, [eax+4]
mov [ebp+var_14], ecx
lea edx, [ebp+var_inpPassStr]
push edx ; wchar_t *
call ds:wcslen
add esp, 4
mov esi, eax
mov eax, [ebp+var_14]
push eax ; wchar_t *
call ds:wcslen
add esp, 4
cmp esi, eax
jnz short loc_401984; this prints "invalid pass"
Any insight on this would be great.