Function at 0x401680
Capabilities:
Access peb ldr_data

Disassembly:
push 0xffffffffffffffff
push 0x43ce48
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0xc
mov eax, dword [0x444038]
push ebx
push ebp
xor ebp, ebp
push esi
mov dword [esp + 0xc], ebp
push edi
mov dword [esp + 0x10], eax
mov edx, dword [esp + 0x30]
mov dword [esp + 0x24], ebp
push edx
call fcn.00401480
mov ebx, dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
mov esi, eax
cmp esi, ebp
je 0x4017d8
lea ecx, [esp + 0x14]
call fcn.00402e80
push esi
lea ecx, [esp + 0x18]
mov byte [esp + 0x28], 1
call fcn.00402ec0
mov eax, dword [esp + 0x34]
lea ecx, [esp + 0x30]
push eax
push ecx
lea ecx, [esp + 0x1c]
call fcn.00402ed0
mov edi, eax
mov esi, dword [edi]
mov eax, dword [esp + 0x10]
cmp eax, esi
mov byte [esp + 0x24], 2
je 0x40179b
mov edx, dword [eax - 0xc]
lea ecx, [eax - 0xc]
cmp edx, ebp
mov edx, dword [0x44403c]
jge 0x401720
lea ebp, [eax - 0xc]
cmp ebp, edx
jne 0x401727
mov ebp, dword [esi - 0xc]
test ebp, ebp
jge 0x401763
mov ebp, dword [esi - 8]
lea ecx, [esp + 0x10]
push ebp
call fcn.00401a00
test eax, eax
je 0x40179b
mov edi, dword [esp + 0x10]
lea eax, [ebp + ebp]
mov ecx, eax
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x10]
mov dword [ecx - 8], ebp
mov edx, dword [esp + 0x10]
mov word [eax + edx], 0
jmp 0x40179b
add eax, 0xfffffff4
cmp eax, edx
je 0x40178f
push ecx
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
test eax, eax
jg 0x401785
mov eax, dword [esp + 0x10]
add eax, 0xfffffff4
push eax
call fcn.0043cb60
add esp, 4
mov ecx, dword [0x444038]
mov dword [esp + 0x10], ecx
mov eax, dword [edi]
mov dword [esp + 0x10], eax
add eax, 0xfffffff4
push eax
call ebx
mov eax, dword [esp + 0x30]
mov ecx, dword [0x44403c]
lea edx, [eax - 0xc]
cmp edx, ecx
je 0x4017ca
add eax, 0xfffffff4
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
test eax, eax
jg 0x4017ca
mov eax, dword [esp + 0x30]
add eax, 0xfffffff4
push eax
call fcn.0043cb60
add esp, 4
lea ecx, [esp + 0x14]
mov byte [esp + 0x24], 0
call fcn.00402eb0
mov eax, dword [esp + 0x10]
mov ebp, dword [esp + 0x2c]
mov edx, dword [eax - 0xc]
lea ecx, [eax - 0xc]
test edx, edx
jl 0x4017f2
push ecx
mov dword [ebp], eax
call ebx
jmp 0x401854
mov ecx, dword [0x444038]
mov esi, eax
test eax, eax
mov dword [ebp], ecx
jne 0x401805
xor ebx, ebx
jmp 0x40180e
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov ebx, eax
mov eax, dword [ebp]
cmp dword [eax - 0xc], 1
jg 0x40181c
cmp ebx, dword [eax - 4]
jle 0x40182f
mov ecx, ebp
call fcn.004019c0
push ebx
mov ecx, ebp
call fcn.00401960
test eax, eax
je 0x401854
mov edi, dword [ebp]
lea eax, [ebx + ebx]
mov ecx, eax
mov edx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [ebp]
mov dword [ecx - 8], ebx
mov edx, dword [ebp]
mov word [edx + eax], 0
mov eax, dword [esp + 0x10]
mov edx, dword [0x44403c]
lea ecx, [eax - 0xc]
cmp ecx, edx
je 0x401883
add eax, 0xfffffff4
push eax
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
test eax, eax
jg 0x401883
mov edx, dword [esp + 0x10]
add edx, 0xfffffff4
push edx
call fcn.0043cb60
add esp, 4
mov ecx, dword [esp + 0x1c]
pop edi
mov eax, ebp
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x18
ret 0xc