Function at 0x4016d7
Capabilities:
Access peb ldr_data

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffc4
mov eax, 0x41d194
call fcn.0040fa34
mov edx, dword [ebp + 8]
add edx, 0x2c
push edx
mov ecx, dword [ebp + 8]
push dword [ecx + 0x30]
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x30]
mov ecx, dword [edx]
call dword [ecx + 4]
mov eax, dword [ebp + 8]
cmp dword [eax + 0x18], 0
jne 0x4017fe
mov edx, dword [ebp + 8]
movsx ecx, word [edx + 8]
push ecx
call fcn.004021c2
pop ecx
push eax
mov eax, dword [ebp + 8]
push dword [eax + 0x20]
mov edx, dword [ebp + 8]
mov ecx, dword [edx + 0x20]
mov eax, dword [ecx]
call dword [eax]
push eax
push 0xc
call fcn.004021ba
add esp, 8
mov dword [ebp - 4], eax
test eax, eax
je 0x40175a
mov word [ebp - 0x1c], 0x14
push dword [ebp - 4]
call fcn.004021d0
pop ecx
inc dword [ebp - 0x10]
mov word [ebp - 0x1c], 8
mov edx, dword [ebp - 4]
jmp 0x40175d
mov edx, dword [ebp - 4]
mov eax, dword [ebp + 8]
mov dword [eax + 0x18], edx
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + 0x18]
mov edx, dword [ebp + 8]
mov ecx, dword [edx + 0x20]
mov dword [eax], ecx
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x18]
mov ecx, dword [ebp + 8]
mov ax, word [ecx + 8]
mov word [edx + 6], ax
mov edx, dword [ebp + 8]
movsx ecx, word [edx + 8]
push ecx
call fcn.00402212
pop ecx
push eax
mov eax, dword [ebp + 8]
push dword [eax + 0x20]
mov edx, dword [ebp + 8]
mov ecx, dword [edx + 0x20]
mov eax, dword [ecx]
call dword [eax]
push eax
push 0xc
call fcn.0040220a
add esp, 8
mov dword [ebp - 8], eax
test eax, eax
je 0x4017d0
mov word [ebp - 0x1c], 0x2c
push dword [ebp - 8]
call fcn.00402220
pop ecx
inc dword [ebp - 0x10]
mov word [ebp - 0x1c], 0x20
mov edx, dword [ebp - 8]
jmp 0x4017d3
mov edx, dword [ebp - 8]
mov eax, dword [ebp + 8]
mov dword [eax + 0x1c], edx
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + 0x1c]
mov edx, dword [ebp + 8]
mov ecx, dword [edx + 0x20]
mov dword [eax], ecx
mov eax, dword [ebp + 8]
mov edx, dword [eax + 0x1c]
mov ecx, dword [ebp + 8]
mov ax, word [ecx + 8]
mov word [edx + 6], ax
mov word [ebp - 0x1c], 0
xor edx, edx
mov dword [ebp - 0x30], edx
mov ecx, dword [ebp + 8]
mov eax, dword [ecx + 0x18]
movsx edx, word [eax + 4]
dec edx
mov dword [ebp - 0x34], edx
mov ecx, dword [ebp - 0x30]
cmp ecx, dword [ebp - 0x34]
jg 0x401894
mov eax, dword [ebp - 0x30]
add eax, dword [ebp - 0x34]
sar eax, 1
jns 0x401826
adc eax, 0
mov dword [ebp - 0x38], eax
mov edx, dword [ebp + 8]
mov ecx, dword [edx + 0x18]
mov eax, dword [ebp - 0x38]
mov edx, dword [ecx + eax*4 + 0xc]
mov dword [ebp - 0x3c], edx
mov ecx, dword [ebp + 0xc]
cmp ecx, dword [ebp - 0x3c]
jae 0x40184a
mov eax, dword [ebp - 0x38]
dec eax
mov dword [ebp - 0x34], eax
jmp 0x40188c
mov edx, dword [ebp + 0xc]
cmp edx, dword [ebp - 0x3c]
jne 0x401885
mov ecx, dword [ebp + 8]
add ecx, 0x2c
push ecx
mov eax, dword [ebp + 8]
push dword [eax + 0x30]
mov edx, dword [ebp + 8]
mov ecx, dword [edx + 0x30]
mov eax, dword [ecx]
call dword [eax + 8]
mov eax, dword [ebp - 0x38]
shl eax, 2
mov edx, dword [ebp + 8]
add eax, dword [edx + 0x1c]
add eax, 0xc
mov ecx, dword [ebp - 0x2c]
mov dword fs:[0], ecx
jmp 0x4018b8
mov eax, dword [ebp - 0x38]
inc eax
mov dword [ebp - 0x30], eax
mov edx, dword [ebp - 0x30]
cmp edx, dword [ebp - 0x34]
jle 0x401819
mov ecx, dword [ebp + 8]
add ecx, 0x2c
push ecx
mov eax, dword [ebp + 8]
push dword [eax + 0x30]
mov edx, dword [ebp + 8]
mov ecx, dword [edx + 0x30]
mov eax, dword [ecx]
call dword [eax + 8]
xor eax, eax
mov edx, dword [ebp - 0x2c]
mov dword fs:[0], edx
mov esp, ebp
pop ebp
ret 8