Function at 0x59eb04
Capabilities:
Access peb ldr_data

Disassembly:
push ebp
mov ebp, esp
push 0
push 0
push 0
push 0
push 0
push 0
push 0
push ebx
push esi
push edi
mov esi, ecx
mov ebx, edx
mov dword [ebp - 4], eax
xor eax, eax
push ebp
push 0x59efbd
push dword fs:[eax]
mov dword fs:[eax], esp
cmp byte [ebp + 8], 0
jne 0x59eb43
mov eax, dword [ebp - 4]
test byte [eax + 0x3c1], 1
je 0x59ee12
mov byte [ebp - 5], 0
test bl, bl
je 0x59eb59
mov dl, 1
mov eax, dword [ebp - 4]
call fcn.005afe80
test al, al
jne 0x59eb5d
xor eax, eax
jmp 0x59eb5f
mov al, 1
mov ebx, eax
mov byte [ebp - 6], 0
mov eax, dword [ebp - 4]
call fcn.0059a09c
xor eax, eax
push ebp
push 0x59ee0b
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x2f4]
mov edx, dword [eax]
call dword [edx + 0x38]
mov ecx, eax
mov eax, esi
cdq
xor eax, edx
sub eax, edx
cmp ecx, eax
setle al
or al, byte [ebp + 0xc]
je 0x59ebca
test esi, esi
jle 0x59ebb4
mov eax, dword [ebp - 4]
call fcn.0059e334
mov eax, dword [eax + 0x30]
cmp byte [eax + 0xa1], 0
je 0x59ebca
test esi, esi
jge 0x59ebca
mov eax, dword [ebp - 4]
call fcn.0059e334
mov eax, dword [eax + 0x30]
cmp byte [eax + 0xa0], 0
xor eax, eax
push ebp
push 0x59edcb
push dword fs:[eax]
mov dword fs:[eax], esp
test esi, esi
je 0x59eda7
mov eax, dword [ebp - 4]
test byte [eax + 0x3c1], 0x10
je 0x59ed19
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x2f4]
cmp byte [eax + 0x15], 0
je 0x59ed19
test bl, bl
je 0x59ed11
mov eax, dword [ebp - 4]
cmp byte [eax + 0x3cd], 0
jne 0x59ec9b
lea edx, [ebp - 0x10]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x2dc]
call fcn.004e97a8
mov edx, dword [ebp - 0x10]
mov eax, dword [ebp - 4]
add eax, 0x3d4
call fcn.00404b1c
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x2dc]
call fcn.004e964c
mov edx, dword [ebp - 4]
mov byte [edx + 0x4f6], al
mov eax, dword [ebp - 4]
cmp byte [eax + 0x44e], 0
je 0x59ec7b
mov eax, dword [ebp - 4]
mov dl, byte [eax + 0x4f6]
xor dl, 1
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x2dc]
mov ecx, dword [eax]
call dword [ecx + 0xc]
jmp 0x59ec8b
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x2dc]
mov dl, 1
mov ecx, dword [eax]
call dword [ecx + 0xc]
mov eax, dword [ebp - 4]
mov byte [eax + 0x3cd], 1
mov byte [ebp - 5], 1
jmp 0x59ed19
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x2dc]
mov dword [ebp - 0xc], eax
lea edx, [ebp - 0x14]
mov eax, dword [ebp - 0xc]
call fcn.004e97a8
mov edx, dword [ebp - 0x14]
mov eax, dword [ebp - 4]
mov ecx, dword [eax + 0x3d4]
mov eax, dword [ebp - 0xc]
call fcn.004e9810
mov ecx, eax
mov eax, esi
cdq
xor eax, edx
sub eax, edx
push eax
mov eax, esi
pop edx
mov edi, edx
cdq
idiv edi
neg eax
cmp ecx, eax
setne byte [ebp - 5]
cmp byte [ebp - 5], 0
jne 0x59ed19
mov eax, dword [ebp - 4]
cmp byte [eax + 0x44e], 0
je 0x59ed05
mov eax, dword [ebp - 4]
mov dl, byte [eax + 0x4f6]
mov eax, dword [ebp - 0xc]
mov ecx, dword [eax]
call dword [ecx + 0xc]
jmp 0x59ed19
xor edx, edx
mov eax, dword [ebp - 0xc]
mov ecx, dword [eax]
call dword [ecx + 0xc]
jmp 0x59ed19
mov eax, dword [ebp - 4]
call fcn.0059eaa8
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x2f4]
call fcn.004beee4
push eax
mov eax, esi
cdq
xor eax, edx
sub eax, edx
push eax
mov eax, esi
pop edx
mov ecx, edx
cdq
idiv ecx
mov edx, eax
pop eax
call fcn.004c4348
test eax, eax
jne 0x59ed53
call fcn.00404594
call fcn.00404594
jmp 0x59efa2
cmp byte [ebp - 5], 0
je 0x59ed91
mov eax, dword [ebp - 4]
cmp byte [eax + 0x44e], 0
je 0x59ed81
mov eax, dword [ebp - 4]
mov dl, byte [eax + 0x4f6]
xor dl, 1
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x2dc]
mov ecx, dword [eax]
call dword [ecx + 0xc]
jmp 0x59ed91
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x2dc]
mov dl, 1
mov ecx, dword [eax]
call dword [ecx + 0xc]
cmp byte [ebp + 0xc], 0
jne 0x59ed9f
test esi, esi
jle 0x59ed9e
dec esi
jmp 0x59ed9f
inc esi
test esi, esi
jne 0x59ebe0
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x59edd2
cmp byte [ebp - 6], 0
je 0x59edca
mov eax, dword [ebp - 4]
call fcn.0059e334
mov eax, dword [eax + 0x30]
call fcn.004c3744
ret
test bl, bl
je 0x59ee24
mov dl, 2
mov eax, dword [ebp - 4]
call fcn.005afe80
test al, al
jne 0x59ee28
xor eax, eax
jmp 0x59ee2a
mov al, 1
mov ebx, eax
test bl, bl
jne 0x59ee4a
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x2f4]
call fcn.004beee4
mov edx, esi
call fcn.004c4348
jmp 0x59ef8b
mov eax, dword [ebp - 4]
call fcn.0059a09c
xor edx, edx
push ebp
push 0x59ef84
push dword fs:[edx]
mov dword fs:[edx], esp
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x3d0]
cmp byte [eax + 0x10], 2
je 0x59eebd
mov eax, dword [eax + 0xc]
call fcn.005b2210
push 1
lea edx, [ebp - 0x18]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x2f4]
mov eax, dword [eax + 4]
mov eax, dword [eax + 0x30]
mov ecx, dword [eax]
call dword [ecx + 0x11c]
mov eax, dword [ebp - 0x18]
push eax
mov eax, dword [ebp - 4]
call fcn.005af680
mov edx, eax
mov eax, dword [ebp - 4]
call fcn.0059a034
mov edx, eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x3d0]
mov eax, dword [eax + 0xc]
pop ecx
call fcn.005b274c
cmp byte [ebp + 0xc], 0
je 0x59eef0
dec esi
jne 0x59eedb
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x2f4]
call fcn.004beee4
call fcn.004c42ac
jmp 0x59ef05
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x2f4]
call fcn.004beee4
call fcn.004c41d4
jmp 0x59ef05
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x2f4]
call fcn.004beee4
mov edx, esi
call fcn.004c4348
push 1
lea edx, [ebp - 0x1c]
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x2f4]
mov eax, dword [eax + 4]
mov eax, dword [eax + 0x30]
mov ecx, dword [eax]
call dword [ecx + 0x11c]
mov eax, dword [ebp - 0x1c]
push eax
mov eax, dword [ebp - 4]
call fcn.005af680
mov edx, eax
mov eax, dword [ebp - 4]
call fcn.0059a034
mov edx, eax
mov eax, dword [ebp - 4]
mov eax, dword [eax + 0x3d0]
mov eax, dword [eax + 0xc]
pop ecx
call fcn.005b274c
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x59ef8b
mov eax, dword [ebp - 4]
call fcn.0059e324
mov eax, dword [ebp - 4]
cmp byte [eax + 0x408], 0
jne 0x59ef83
mov eax, dword [ebp - 4]
cmp byte [eax + 0x43d], 0
je 0x59ef83
mov eax, dword [ebp - 4]
mov edx, dword [eax]
call dword [edx + 0x158]
ret
mov eax, dword [ebp - 4]
cmp byte [eax + 0x408], 0
jne 0x59efa2
mov eax, dword [ebp - 4]
mov edx, dword [eax]
call dword [edx + 0x88]
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x59efc4
lea eax, [ebp - 0x1c]
mov edx, 4
call fcn.00404aec
ret