Function at 0x40c830
Capabilities:
Access peb ldr_data

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x511c58
mov eax, dword fs:[0]
push eax
sub esp, 0x3c
push ebx
push esi
push edi
mov eax, dword [0x55d3e4]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
push 8
mov dword [esi + 0x30], 0
mov dword [esi + 8], 0
mov dword [esi + 0x10], 0
mov dword [esi + 0x14], 0x201
mov dword [esi + 0x18], 6
mov dword [esi + 0x1c], 0
mov dword [esi + 0x20], 0
mov dword [esi + 0x24], 0
mov dword [esi + 0x28], 0
mov dword [esi + 0x2c], 0
mov dword [esi + 0xc], 0
call fcn.00475e4c
mov edi, eax
add esp, 4
test edi, edi
je 0x40c8cd
push 1
mov dword [ebp - 4], 0
call fcn.004581c3
add esp, 4
mov dword [edi + 4], eax
jmp 0x40c8cf
xor edi, edi
mov eax, dword [ebp + 8]
mov dword [esi + 0x30], edi
mov dword [esi + 0x38], eax
mov dword [esi + 0x3c], 0
mov edi, dword [edi + 4]
mov ecx, edi
mov dword [ebp - 4], 1
mov dword [ebp - 0x10], edi
mov dword [ebp - 0x24], edi
mov eax, dword [edi]
call dword [eax + 4]
push 0
lea ecx, [ebp - 0x20]
mov dword [ebp - 4], 2
call fcn.0045786a
mov eax, dword [0x587300]
mov ebx, dword [0x587d9c]
mov byte [ebp - 4], 3
mov dword [ebp - 0x18], eax
mov dword [ebp + 8], eax
test ebx, ebx
jne 0x40c94f
push ebx
lea ecx, [ebp - 0x14]
call fcn.0045786a
cmp dword [0x587d9c], ebx
jne 0x40c941
mov eax, dword [0x587d88]
inc eax
mov dword [0x587d88], eax
mov dword [0x587d9c], eax
lea ecx, [ebp - 0x14]
call fcn.004578d1
mov ebx, dword [0x587d9c]
cmp ebx, dword [edi + 0xc]
jae 0x40c960
mov eax, dword [edi + 8]
mov edi, dword [eax + ebx*4]
test edi, edi
jne 0x40c9bf
jmp 0x40c962
xor edi, edi
mov eax, dword [ebp - 0x10]
cmp byte [eax + 0x14], 0
je 0x40c97b
call fcn.004581bd
cmp ebx, dword [eax + 0xc]
jae 0x40c97f
mov eax, dword [eax + 8]
mov edi, dword [eax + ebx*4]
test edi, edi
jne 0x40c9bf
mov edi, dword [ebp - 0x18]
test edi, edi
jne 0x40c9bf
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp + 8]
push eax
call fcn.0040bb00
add esp, 8
cmp eax, 0xffffffff
je 0x40ca39
mov edi, dword [ebp + 8]
mov dword [ebp + 8], edi
push edi
mov byte [ebp - 4], 4
call fcn.00458191
mov eax, dword [edi]
add esp, 4
mov ecx, edi
call dword [eax + 4]
mov dword [0x587300], edi
lea ecx, [ebp - 0x20]
mov byte [ebp - 4], 2
call fcn.004578d1
mov eax, dword [edi]
mov ecx, edi
push 0x20
call dword [eax + 0x30]
movzx edi, ax
mov ecx, dword [ebp - 0x10]
mov dword [ebp - 4], 5
mov eax, dword [ecx]
call dword [eax + 8]
test eax, eax
je 0x40c9f2
mov edx, dword [eax]
mov ecx, eax
push 1
call dword [edx]
cmp dword [esi + 0x38], 0
mov dword [ebp - 4], 0xffffffff
mov word [esi + 0x40], di
jne 0x40ca16
mov eax, dword [esi + 0xc]
mov ecx, dword [esi + 0x10]
and eax, 0x13
or eax, 4
mov dword [esi + 0xc], eax
and ecx, eax
jne 0x40ca4f
cmp byte [ebp + 0xc], 0
je 0x40ca25
push esi
call fcn.0045933c
add esp, 4
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
lea ecx, [ebp - 0x34]
call fcn.0040a430
push 0x5489d4
lea eax, [ebp - 0x34]
push eax
call fcn.004bbff6
test cl, 4
je 0x40ca5b
mov esi, str.ios_base::badbit_set
jmp 0x40ca6b
test cl, 2
mov esi, str.ios_base::failbit_set
mov eax, str.ios_base::eofbit_set
cmove esi, eax
lea eax, [ebp - 0x1c]
push 1
push eax
call fcn.0040caa0
add esp, 8
lea ecx, [ebp - 0x48]
push eax
push esi
call fcn.0040a4d0
push 0x548958
lea eax, [ebp - 0x48]
push eax
call fcn.004bbff6
int3