Function at 0x403930
Capabilities:
Resolve function by parsing pe exports

Disassembly:
push ebp
mov ebp, esp
mov eax, dword [ebp + 0x20]
test eax, eax
je 0x403c5d
cmp byte [eax], 0x31
jne 0x403c5d
cmp dword [ebp + 0x24], 0x38
jne 0x403c5d
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
test edi, edi
je 0x403c51
mov ebx, dword [edi + 0x20]
mov dword [edi + 0x18], 0
test ebx, ebx
jne 0x40397c
mov dword [edi + 0x28], ebx
mov ebx, 0x406a30
mov dword [edi + 0x20], 0x406a30
cmp dword [edi + 0x24], 0
jne 0x403989
mov dword [edi + 0x24], 0x406a50
cmp dword [ebp + 0xc], 0xffffffff
mov ecx, 6
cmovne ecx, dword [ebp + 0xc]
mov dword [ebp + 0x20], ecx
mov ecx, dword [ebp + 0x14]
mov eax, ecx
cdq
not ecx
mov esi, eax
shr ecx, 0x1f
mov eax, dword [ebp + 0x18]
xor esi, edx
dec eax
mov dword [ebp + 0x14], ecx
sub esi, edx
cmp eax, 8
ja 0x403c51
cmp dword [ebp + 0x10], 8
jne 0x403c51
lea eax, [esi - 8]
cmp eax, 7
ja 0x403c51
cmp dword [ebp + 0x20], 9
ja 0x403c51
cmp dword [ebp + 0x1c], 4
ja 0x403c51
push 0x16c0
mov eax, 9
cmp esi, 8
push 1
push dword [edi + 0x28]
cmove esi, eax
mov dword [ebp + 0x24], esi
call ebx
mov ebx, eax
test ebx, ebx
je 0x403c45
mov ecx, dword [ebp + 0x24]
mov eax, dword [ebp + 0x14]
mov dword [edi + 0x1c], ebx
mov dword [ebx + 0x30], esi
mov esi, 1
shl esi, cl
mov ecx, dword [ebp + 0x18]
mov dword [ebx + 0x18], eax
add ecx, 7
mov dword [ebx + 0x50], ecx
lea eax, [esi - 1]
mov dword [ebx], edi
mov dword [ebx + 0x34], eax
mov eax, 1
shl eax, cl
add ecx, 2
mov dword [ebx + 0x4c], eax
dec eax
mov dword [ebx + 0x54], eax
mov eax, 0xaaaaaaab
mul ecx
push 2
shr edx, 1
mov dword [ebx + 0x1c], 0
mov dword [ebx + 0x2c], esi
mov dword [ebx + 0x58], edx
mov eax, dword [edi + 0x20]
push esi
push dword [edi + 0x28]
call eax
push 2
push dword [ebx + 0x2c]
mov dword [ebx + 0x38], eax
push dword [edi + 0x28]
mov eax, dword [edi + 0x20]
call eax
push 2
push dword [ebx + 0x4c]
mov dword [ebx + 0x40], eax
push dword [edi + 0x28]
mov eax, dword [edi + 0x20]
call eax
mov ecx, dword [ebp + 0x18]
mov dword [ebx + 0x44], eax
mov eax, 1
push 4
lea ecx, [ecx + 6]
shl eax, cl
push eax
mov dword [ebx + 0x169c], eax
push dword [edi + 0x28]
mov eax, dword [edi + 0x20]
call eax
cmp dword [ebx + 0x38], 0
mov edx, eax
mov esi, dword [ebx + 0x169c]
mov dword [ebx + 8], edx
lea ecx, [esi*4]
mov dword [ebx + 0xc], ecx
je 0x403c30
cmp dword [ebx + 0x40], 0
je 0x403c30
cmp dword [ebx + 0x44], 0
je 0x403c30
test edx, edx
je 0x403c30
mov eax, esi
mov byte [ebx + 0x24], 8
shr eax, 1
lea eax, [edx + eax*2]
mov dword [ebx + 0x16a4], eax
lea eax, [edx + esi*2]
add eax, esi
mov dword [ebx + 0x1698], eax
mov eax, dword [ebp + 0x20]
mov dword [ebx + 0x84], eax
mov eax, dword [ebp + 0x1c]
mov dword [ebx + 0x88], eax
mov esi, dword [edi + 0x1c]
test esi, esi
je 0x403c51
cmp dword [edi + 0x20], 0
je 0x403c51
cmp dword [edi + 0x24], 0
je 0x403c51
mov dword [edi + 0x14], 0
mov dword [edi + 8], 0
mov dword [edi + 0x18], 0
mov dword [edi + 0x2c], 2
mov ecx, dword [esi + 0x18]
mov eax, dword [esi + 8]
mov dword [esi + 0x14], 0
mov dword [esi + 0x10], eax
test ecx, ecx
jns 0x403b5f
neg ecx
mov dword [esi + 0x18], ecx
push 0
test ecx, ecx
mov edx, 0x2a
mov eax, 0x71
push 0
cmovne eax, edx
push 0
mov dword [esi + 4], eax
call fcn.004066c0
mov dword [edi + 0x30], eax
push esi
mov dword [esi + 0x28], 0
call fcn.00404b30
mov eax, dword [esi + 0x2c]
xor edx, edx
mov ecx, dword [esi + 0x4c]
add eax, eax
mov dword [esi + 0x3c], eax
mov eax, dword [esi + 0x44]
mov word [eax + ecx*2 - 2], dx
mov eax, dword [esi + 0x4c]
lea eax, [eax*2 - 2]
push eax
push edx
push dword [esi + 0x44]
call sub.msvcrt.dll_memset
mov eax, dword [esi + 0x84]
add esp, 0xc
lea ecx, [eax + eax*2]
movzx eax, word [ecx*4 + 0x407142]
mov dword [esi + 0x80], eax
movzx eax, word [ecx*4 + 0x407140]
mov dword [esi + 0x8c], eax
movzx eax, word [ecx*4 + 0x407144]
mov dword [esi + 0x90], eax
movzx eax, word [ecx*4 + 0x407146]
pop edi
mov dword [esi + 0x7c], eax
xor eax, eax
mov dword [esi + 0x6c], 0
mov dword [esi + 0x5c], 0
mov dword [esi + 0x74], 0
mov dword [esi + 0x78], 2
mov dword [esi + 0x60], 2
mov dword [esi + 0x68], 0
mov dword [esi + 0x48], 0
pop esi
pop ebx
pop ebp
ret 0x20
mov dword [ebx + 4], 0x29a
mov eax, dword [str.insufficient_memory]
push edi
mov dword [edi + 0x18], eax
call fcn.00403260
pop edi
pop esi
mov eax, 0xfffffffc
pop ebx
pop ebp
ret 0x20
pop edi
pop esi
mov eax, 0xfffffffe
pop ebx
pop ebp
ret 0x20
mov eax, 0xfffffffa
pop ebp
ret 0x20