Function at 0x40d859
Capabilities:
Connect network resource

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x2c
push ebx
mov ebx, eax
push esi
push edi
test ebx, ebx
je 0x40dac5
mov esi, ebx
call fcn.0040d0cf
cmp eax, 1
je 0x40dac5
push ebx
call fcn.0040d081
cmp eax, 1
jne 0x40d88c
add ebx, 4
mov ecx, ebx
call fcn.0040d249
test eax, eax
jne 0x40d8a7
call fcn.0040355c
call dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x40dafa
mov esi, 0x40a60c
push esi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
test eax, eax
je 0x40d8ca
push esi
push ebx
push 0x40a618
push 2
call fcn.0040c7dc
add esp, 0x10
jmp 0x40d8da
push ebx
push 0x40a5bc
push 1
call fcn.0040c7dc
add esp, 0xc
test eax, eax
jne 0x40d8fd
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x40d8f0
push 8
call dword [sym.imp.KERNEL32.dll_SetLastError]
call fcn.0040355c
push 8
pop eax
jmp 0x40dafa
call fcn.0040c7b5
mov dword [ebp - 4], eax
test eax, eax
jne 0x40d917
push 0x12
call fcn.0040c759
mov edx, eax
jmp 0x40d9e5
call fcn.004019b6
test eax, eax
jne 0x40d927
xor edx, edx
jmp 0x40d9e5
push 3
pop ecx
call fcn.00401426
mov esi, eax
cmp esi, 0x12
ja 0x40d95c
mov edx, dword [0x411014]
push 3
pop ecx
call fcn.00401b0a
mov ecx, eax
test ecx, ecx
je 0x40d920
push HeapSize
pop eax
sub eax, esi
push eax
mov eax, ecx
call fcn.004015d5
cmp eax, reloc.KERNEL32.dll_VerSetConditionMask
je 0x40d920
push 0x12
call fcn.0040185e
test eax, eax
je 0x40da33
push 0x12
call fcn.00401ace
mov edi, eax
test edi, edi
je 0x40d920
push 7
push 0x40100c
push edi
call dword [sym.imp.msvcrt.dll__memicmp]
add esp, 0xc
test eax, eax
jne 0x40d920
push dword [ebp - 4]
call fcn.00401843
mov ecx, dword [edi + 8]
lea esi, [eax + 1]
cmp esi, ecx
ja 0x40d9ae
cmp esi, 0x100
jbe 0x40d9cd
lea eax, [esi + esi]
cmp eax, ecx
jae 0x40d9cd
lea eax, [esi + esi]
push eax
test ecx, ecx
jne 0x40da7c
call fcn.0040155a
mov dword [edi + 0xc], eax
test eax, eax
je 0x40d920
mov dword [edi + 8], esi
cmp dword [edi + 0xc], 0
je 0x40d920
mov edx, dword [ebp - 4]
mov ecx, dword [edi + 0xc]
call fcn.00401d74
mov edx, dword [edi + 0xc]
test edx, edx
je 0x40d8de
push 8
xor eax, eax
pop ecx
push eax
push dword [ebp + 8]
lea edi, [ebp - 0x28]
push dword [ebp + 0xc]
rep stosd dword es:[edi], eax
and dword [ebp - 0x24], eax
and dword [ebp - 0xc], eax
and dword [ebp - 0x18], eax
lea eax, [ebp - 0x28]
push eax
mov dword [ebp - 0x14], edx
call dword [sym.imp.MPR.dll_WNetAddConnection2W]
mov esi, eax
test esi, esi
je 0x40da90
cmp esi, 0x4b8
je 0x40da89
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
call fcn.0040355c
jmp 0x40daf4
push 0x10
call fcn.0040155a
mov edi, eax
mov dword [ebp - 8], edi
test edi, edi
je 0x40d920
and dword [edi + 8], 0
and dword [edi + 0xc], 0
push 7
pop esi
mov edx, 0x40100c
mov ecx, edi
call fcn.004043a7
push 0x12
mov esi, edi
call fcn.00405c72
test eax, eax
jne 0x40d978
lea esi, [ebp - 8]
call fcn.004016c7
jmp 0x40d920
lea ecx, [edi + 0xc]
call fcn.00402781
jmp 0x40d9c2
call fcn.0040c871
jmp 0x40daf4
xor esi, esi
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, ebx
call fcn.0040d677
cmp eax, 0x1388
jae 0x40daf4
mov eax, ebx
call fcn.0040db06
push 0x1580
call fcn.00401b33
push eax
call fcn.00401467
mov esi, 0x4b8
jmp 0x40daf4
cmp dword [ebp + 8], 0
je 0x40daf8
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_lstrlenW]
test eax, eax
je 0x40daf8
push 0x157e
call fcn.00401b33
push eax
call fcn.00401467
mov esi, 0xa0010001
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, esi
jmp 0x40dafa
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret 8