Function at 0x40f470
Capabilities:
Enumerate pe sections

Disassembly:
push esi
push edi
mov edi, dword [esp + 0xc]
mov esi, dword [edi + 0x20]
mov cl, byte [esi + 5]
or byte [esi + 4], 4
mov eax, dword [esi + 0xc]
mov dword [edi + 0x20], eax
cmp cl, 0xb
jne 0x40f4c5
push esi
push edi
call fcn.0040eab0
add esp, 8
test eax, eax
jle 0x40f49d
and byte [esi + 4], 0xfb
mov eax, dword [esi + 0x1c]
test eax, eax
je 0x40f4b7
lea eax, [eax + eax*2]
lea ecx, [eax*8 + 0x38]
mov eax, dword [esi + 0x18]
pop edi
pop esi
lea eax, [ecx + eax*8]
ret
mov eax, dword [esi + 0x18]
mov ecx, 0x20
pop edi
pop esi
lea eax, [ecx + eax*8]
ret
push ebx
cmp cl, 8
jne 0x40f58a
mov eax, dword [esi + 8]
test byte [eax + 4], 3
je 0x40f4e2
push eax
push edi
call fcn.0040de40
add esp, 8
cmp byte [esi + 6], 0
jne 0x40f532
mov eax, dword [esi + 0x10]
test byte [eax - 0x3c], 3
je 0x40f4fe
add eax, 0xffffffc0
push eax
push edi
call fcn.0040de40
add esp, 8
mov cl, byte [esi + 7]
xor ebx, ebx
test cl, cl
je 0x40f56b
lea edx, [esi + 0x14]
nop word [eax + eax]
mov eax, dword [edx]
test byte [eax + 4], 3
je 0x40f522
push eax
push edi
call fcn.0040de40
add esp, 8
mov cl, byte [esi + 7]
inc ebx
movzx eax, cl
add edx, 4
cmp ebx, eax
jb 0x40f510
jmp 0x40f56b
mov cl, byte [esi + 7]
xor ebx, ebx
test cl, cl
je 0x40f56b
lea edx, [esi + 0x18]
nop
mov eax, dword [edx + 4]
add eax, 4
cmp eax, 0xfffffff6
jbe 0x40f55d
mov eax, dword [edx]
test byte [eax + 4], 3
je 0x40f55d
push eax
push edi
call fcn.0040de40
add esp, 8
mov cl, byte [esi + 7]
inc ebx
movzx eax, cl
add edx, 8
cmp ebx, eax
jb 0x40f540
cmp byte [esi + 6], 0
movzx eax, cl
jne 0x40f57f
pop ebx
pop edi
lea eax, [eax*4 + 0x14]
pop esi
ret
pop ebx
pop edi
lea eax, [eax*8 + 0x18]
pop esi
ret
cmp cl, 7
jne 0x40f5ed
mov eax, dword [esi + 0x28]
and byte [eax + 4], 0xfc
mov edx, dword [esi + 0x18]
neg edx
jns 0x40f5bb
shl edx, 2
mov eax, dword [esi + 0x10]
mov eax, dword [edx + eax]
test byte [eax + 4], 3
je 0x40f5b6
push eax
push edi
call fcn.0040de40
add esp, 8
add edx, 4
js 0x40f5a0
movzx eax, word [esi + 0x26]
test ax, ax
je 0x40f5e6
mov ecx, eax
mov eax, dword [edi + 0x2f0]
mov eax, dword [eax + ecx*4]
mov cl, byte [eax + 4]
test cl, 3
je 0x40f5e6
and cl, 0xfc
mov byte [eax + 4], cl
mov ecx, dword [edi + 0x20]
mov dword [eax + 0xc], ecx
mov dword [edi + 0x20], eax
mov eax, dword [esi + 0x20]
pop ebx
pop edi
pop esi
ret
cmp cl, 6
jne 0x40f690
mov eax, dword [edi + 0x24]
mov dword [esi + 0xc], eax
mov dword [edi + 0x24], esi
and byte [esi + 4], 0xfb
mov edx, dword [esi + 0x1c]
mov ebx, dword [esi + 0x14]
add edx, 8
cmp edx, ebx
jae 0x40f634
mov eax, dword [edx + 4]
add eax, 4
cmp eax, 0xfffffff6
jbe 0x40f62d
mov eax, dword [edx]
test byte [eax + 4], 3
je 0x40f62d
push eax
push edi
call fcn.0040de40
add esp, 8
add edx, 8
cmp edx, ebx
jb 0x40f610
cmp byte [edi + 0x11], 2
jne 0x40f65e
mov ecx, dword [esi + 0x2c]
mov eax, dword [esi + 0x1c]
lea eax, [eax + ecx*8]
cmp edx, eax
jae 0x40f65e
nop word [eax + eax]
mov dword [edx + 4], 0xffffffff
add edx, 8
cmp edx, eax
jb 0x40f650
mov eax, dword [esi + 0x24]
test byte [eax + 4], 3
je 0x40f671
push eax
push edi
call fcn.0040de40
add esp, 8
push esi
push edi
call fcn.0040e820
push eax
push esi
call fcn.004064c0
mov eax, dword [esi + 0x2c]
add esp, 0x10
pop ebx
pop edi
lea eax, [eax*8 + 0x30]
pop esi
ret
push esi
push edi
call fcn.0040ecc0
mov ecx, dword [esi + 8]
add esp, 8
movzx eax, word [esi + 6]
sub ecx, dword [esi + 0x14]
pop ebx
lea eax, [eax + eax*2]
lea eax, [eax + ecx*2]
add eax, 0x14
add eax, dword [esi + 0x18]
pop edi
shl eax, 2
pop esi
ret