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

Disassembly:
mov edx, dword [esp + 4]
sub esp, 0xc0
test edx, edx
push ebx
push ebp
push esi
push edi
jne 0x405d5f
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xc0
ret
mov esi, dword [esp + 0xd8]
lea edi, [esp + 0x54]
push 0
push 0x21
mov eax, dword [esi + 0xc]
mov ecx, dword [esi + 0x18]
mov dword [esp + 0x18], eax
mov ebx, dword [esi + 0x10]
mov ebp, dword [esi + 8]
mov dword [esp + 0x40], ecx
mov ecx, 0x1f
xor eax, eax
rep stosd dword es:[edi], eax
mov eax, dword [edx]
lea ecx, [esp + 0x5c]
push ecx
push 0
push edx
mov dword [esp + 0x34], ebx
mov dword [esp + 0x60], ebp
mov dword [esp + 0x68], 0x7c
mov dword [esp + 0x6c], 0x80e
call dword [eax + 0x64]
test eax, eax
jge 0x405dc1
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0xc0
ret
cmp ebp, 2
je 0x406395
cmp ebp, 3
je 0x406395
mov eax, dword [esp + 0x38]
mov edi, dword [sym.imp.KERNEL32.dll_GlobalAlloc_1]
and eax, 0x40000
mov dword [esp + 0x50], eax
jne 0x405dfd
mov esi, dword [esp + 0x78]
mov ebx, dword [esp + 0x64]
mov dword [esp + 0x48], esi
mov dword [esp + 0x14], ebx
jmp 0x405e93
mov eax, dword [esi + 4]
test eax, eax
je 0x405e12
push eax
call dword [sym.imp.KERNEL32.dll_GlobalFree_1]
mov dword [esi + 4], 0
cmp ebp, 0x10000000
jg 0x405e52
je 0x405e2c
test ebp, ebp
je 0x405e2c
cmp ebp, 0x8000000
jne 0x406282
mov edx, dword [esi + 0xc]
imul edx, dword [esi + 0x10]
shl edx, 1
push edx
push 0
call edi
test eax, eax
mov dword [esi + 4], eax
je 0x406282
mov ebx, dword [esi + 0xc]
mov esi, eax
shl ebx, 1
mov dword [esp + 0x14], ebx
jmp 0x405e8f
cmp ebp, 0x28000000
je 0x405e66
cmp ebp, 0x30000000
jne 0x406282
mov eax, dword [esi + 0xc]
imul eax, dword [esi + 0x10]
add eax, 0x200
push eax
push 0
call edi
test eax, eax
mov dword [esi + 4], eax
je 0x406282
mov ebx, dword [esi + 0xc]
lea esi, [eax + 0x200]
mov dword [esp + 0x14], ebx
mov dword [esp + 0x48], esi
mov ecx, dword [esp + 0x38]
test cl, 4
je 0x4061a1
mov eax, ecx
and eax, 8
mov dword [esp + 0x44], eax
je 0x405f80
mov eax, dword [esp + 0x10]
mov edx, dword [esp + 0x20]
mov edi, eax
mov ebp, edx
shr edi, 1
shr ebp, 1
test ecx, 0x100000
mov dword [esp + 0x2c], 1
mov dword [esp + 0x24], edi
mov dword [esp + 0x28], ebp
je 0x405f1a
cmp eax, 8
jne 0x405ee7
cmp edx, eax
jne 0x405f48
mov eax, 0x80
jmp 0x405f1f
cmp eax, 0x10
jne 0x405ef7
cmp edx, eax
jne 0x405f48
mov eax, 0x80
jmp 0x405f1f
cmp eax, 0x20
jne 0x405f07
cmp edx, eax
jne 0x405f48
mov eax, 0x100
jmp 0x405f1f
cmp eax, 0x40
jne 0x405f48
cmp dword [esp + 0x20], 0x40
jne 0x405f48
mov eax, 0x400
jmp 0x405f1f
mov eax, 0x800
mov edx, ebp
mov ecx, dword [esp + 0xdc]
imul edx, edi
add eax, ecx
push edx
push 0x40
mov dword [esp + 0x38], eax
call dword [sym.imp.KERNEL32.dll_GlobalAlloc_1]
test eax, eax
mov dword [esp + 0x34], eax
mov ebx, edi
jne 0x405fea
mov eax, dword [esp + 0x20]
mov edx, esi
test eax, eax
jbe 0x4063e5
mov ebp, dword [esp + 0x14]
mov esi, dword [esp + 0x10]
mov ebx, eax
test esi, esi
jbe 0x405f76
mov ecx, esi
mov eax, 0x3e003e0
mov edi, edx
shr ecx, 1
rep stosd dword es:[edi], eax
adc ecx, ecx
rep stosw word es:[edi], ax
add edx, ebp
dec ebx
jne 0x405f60
jmp 0x4063e5
mov eax, dword [esp + 0xdc]
mov edi, dword [esp + 0x10]
mov ebp, dword [esp + 0x20]
mov ebx, dword [esp + 0x14]
mov dword [esp + 0x30], eax
mov eax, dword [esp + 0x4c]
cmp eax, 0x10000000
mov dword [esp + 0x24], edi
mov dword [esp + 0x28], ebp
mov dword [esp + 0x34], esi
jg 0x405fca
je 0x405fc0
test eax, eax
jl 0x405fea
cmp eax, 1
jle 0x405fc0
cmp eax, 0x8000000
jne 0x405fea
mov dword [esp + 0x2c], 2
jmp 0x405fea
cmp eax, 0x28000000
je 0x405fe2
cmp eax, 0x30000000
jne 0x405fea
mov dword [esp + 0x2c], 1
jmp 0x405fea
mov dword [esp + 0x2c], 0
cmp edi, ebp
mov esi, edi
jl 0x405ff2
mov esi, ebp
mov eax, edi
xor edx, edx
div esi
test edx, edx
jne 0x406004
mov eax, ebp
div esi
test edx, edx
je 0x40601e
mov eax, edi
xor edx, edx
div esi
xor edx, edx
imul eax, esi
mov dword [esp + 0x24], eax
mov eax, ebp
div esi
imul eax, esi
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x2c]
sub eax, 0
je 0x40603a
dec eax
je 0x406036
dec eax
jne 0x406046
mov eax, esi
imul eax, esi
shl eax, 1
jmp 0x406042
mov eax, esi
jmp 0x40603f
lea eax, [esi + 1]
shr eax, 1
imul eax, esi
mov dword [esp + 0x3c], eax
mov eax, esi
mov ecx, dword [esp + 0x28]
imul eax, ebx
mov edi, dword [esp + 0x34]
mov ebp, dword [esp + 0x30]
test ecx, ecx
mov dword [esp + 0x18], edi
mov dword [esp + 0x40], eax
mov dword [esp + 0x1c], 0
jle 0x4060f4
mov ecx, dword [esp + 0x24]
mov dword [esp + 0x30], 0
test ecx, ecx
jle 0x4060d4
mov eax, dword [esp + 0x2c]
sub eax, 0
je 0x4060aa
dec eax
je 0x40609f
dec eax
jne 0x4060b8
push esi
push ebp
push ebx
push edi
call fcn.00406450
add esp, 0x10
lea edi, [edi + esi*2]
jmp 0x4060b8
push esi
push ebp
push ebx
push edi
call fcn.00406550
jmp 0x4060b3
push esi
push ebp
push ebx
push edi
call fcn.00406630
add esp, 0x10
add edi, esi
mov eax, dword [esp + 0x30]
mov edx, dword [esp + 0x3c]
mov ecx, dword [esp + 0x24]
add eax, esi
add ebp, edx
cmp eax, ecx
mov dword [esp + 0x30], eax
jl 0x40607f
mov eax, dword [esp + 0x40]
mov ecx, dword [esp + 0x1c]
mov edi, dword [esp + 0x18]
mov edx, dword [esp + 0x28]
add ecx, esi
add edi, eax
cmp ecx, edx
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x18], edi
jl 0x40606f
mov eax, dword [esp + 0x44]
test eax, eax
je 0x406282
mov eax, dword [esp + 0x48]
mov ecx, dword [esp + 0x14]
mov edi, dword [esp + 0x34]
mov dword [esp + 0x18], eax
lea edx, [ecx + eax]
add ecx, ecx
mov dword [esp + 0x40], ecx
mov ecx, dword [esp + 0x28]
test ecx, ecx
jle 0x406191
sub edx, eax
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x44], edx
mov ebp, dword [esp + 0x24]
test ebp, ebp
jle 0x40617c
add edx, eax
lea ecx, [eax + 2]
mov esi, edx
sub esi, eax
mov ebx, dword [esp + 0xdc]
xor eax, eax
mov al, byte [edi]
inc edi
add ecx, 4
add edx, 4
lea eax, [ebx + eax*8]
dec ebp
mov bx, word [eax]
mov word [ecx - 6], bx
mov bx, word [eax + 4]
mov word [ecx - 4], bx
mov bx, word [eax + 2]
mov word [edx - 4], bx
mov ax, word [eax + 6]
mov word [ecx + esi - 4], ax
jne 0x40613c
mov edx, dword [esp + 0x44]
mov eax, dword [esp + 0x18]
mov esi, dword [esp + 0x40]
mov ecx, dword [esp + 0x1c]
add eax, esi
dec ecx
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], ecx
jne 0x40612b
mov ecx, dword [esp + 0x34]
push ecx
call dword [sym.imp.KERNEL32.dll_GlobalFree_1]
jmp 0x406282
cmp ebp, 0x10000000
jg 0x4061c5
je 0x4061df
test ebp, ebp
jl 0x406282
cmp ebp, 1
jle 0x4061df
cmp ebp, 0x8000000
je 0x4061df
jmp 0x406282
cmp ebp, 0x28000000
je 0x406234
cmp ebp, 0x30000000
jne 0x406282
mov ecx, dword [esp + 0x10]
jmp 0x4061f4
cmp ebp, 0x30000000
jne 0x4061ed
mov ecx, dword [esp + 0x10]
jmp 0x4061f4
mov edx, dword [esp + 0x10]
lea ecx, [edx + edx]
mov edx, dword [esp + 0xdc]
mov eax, esi
mov esi, dword [esp + 0x20]
mov dword [esp + 0x18], ecx
test esi, esi
jbe 0x406282
mov dword [esp + 0x1c], esi
mov ebp, ecx
mov esi, edx
mov edi, eax
add eax, ebx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebp
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x18]
mov esi, dword [esp + 0x1c]
add edx, ecx
dec esi
mov dword [esp + 0x1c], esi
jne 0x40620d
jmp 0x406282
mov eax, dword [esp + 0x20]
mov edi, dword [esp + 0xdc]
test eax, eax
jbe 0x406282
mov ebp, eax
xor edx, edx
mov ecx, edi
cmp dword [esp + 0x10], edx
mov eax, esi
jbe 0x406274
mov bl, byte [ecx]
test dl, 1
je 0x406261
shr bl, 4
mov byte [eax], bl
inc eax
inc ecx
jmp 0x406267
and bl, 0xf
mov byte [eax], bl
inc eax
mov ebx, dword [esp + 0x10]
inc edx
cmp edx, ebx
jb 0x406251
mov ebx, dword [esp + 0x14]
mov eax, dword [esp + 0x10]
add esi, ebx
inc eax
shr eax, 1
add edi, eax
dec ebp
jne 0x406245
mov eax, dword [esp + 0x50]
test eax, eax
je 0x4063e5
mov eax, dword [esp + 0xd8]
mov ecx, dword [eax + 4]
test ecx, ecx
jne 0x406303
mov eax, dword [esp + 0x38]
and eax, 0xf0000000
cmp eax, 0x20000000
ja 0x4062be
je 0x4062c9
test eax, eax
je 0x4062c9
cmp eax, 0x10000000
je 0x4062c9
jmp 0x4063e5
cmp eax, 0x30000000
jne 0x4063e5
mov esi, dword [esp + 0x20]
mov edx, dword [esp + 0x78]
test esi, esi
jbe 0x4063e5
mov ecx, dword [esp + 0x10]
lea ebx, [ecx + ecx]
mov ecx, ebx
or eax, 0xffffffff
mov ebp, ecx
mov edi, edx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, ebp
and ecx, 3
rep stosb byte es:[edi], al
mov ecx, dword [esp + 0x64]
add edx, ecx
dec esi
jne 0x4062e0
jmp 0x4063e5
mov ecx, dword [esp + 0x4c]
cmp ecx, 0x10000000
jg 0x406366
je 0x406351
test ecx, ecx
je 0x406339
cmp ecx, 0x8000000
jne 0x4063e5
mov edx, dword [esp + 0x64]
push eax
mov eax, dword [esp + 0x7c]
push edx
push eax
call fcn.00406c30
add esp, 0xc
jmp 0x4063e5
mov ecx, dword [esp + 0x64]
mov edx, dword [esp + 0x78]
push eax
push ecx
push edx
call fcn.00406860
add esp, 0xc
jmp 0x4063e5
mov ecx, dword [esp + 0x78]
push eax
mov eax, dword [esp + 0x68]
push eax
push ecx
call fcn.004069f0
add esp, 0xc
jmp 0x4063e5
cmp ecx, 0x28000000
je 0x406376
cmp ecx, 0x30000000
jne 0x4063e5
mov edx, dword [esp + 0xe0]
mov ecx, dword [esp + 0x78]
push 1
push edx
push eax
mov eax, dword [esp + 0x70]
push eax
push ecx
call fcn.00406770
add esp, 0x14
jmp 0x4063e5
mov edx, dword [esp + 0x64]
mov esi, dword [esp + 0x78]
mov dword [esp + 0x14], edx
mov edx, ebp
sub edx, 2
neg edx
sbb edx, edx
and edx, 0xfffffc00
add edx, 0x7e0
test ebx, ebx
jbe 0x4063e5
mov eax, dword [esp + 0x10]
test eax, eax
jbe 0x4063dc
mov ecx, eax
mov eax, edx
mov bp, ax
mov edi, esi
shl ebp, 0x10
mov bp, ax
mov eax, ebp
shr ecx, 1
rep stosd dword es:[edi], eax
adc ecx, ecx
rep stosw word es:[edi], ax
mov ecx, dword [esp + 0x14]
add esi, ecx
dec ebx
jne 0x4063ba
mov esi, dword [esp + 0xd4]
push 0
push esi
mov eax, dword [esi]
call dword [eax + 0x80]
test dword [esp + 0x38], 0x40000
jne 0x40643d
mov eax, dword [esp + 0xe0]
cmp eax, 0xffffffff
je 0x40643d
mov ecx, dword [esp + 0x4c]
cmp ecx, 0x28000000
jne 0x406424
mov ecx, dword [esi]
mov edx, dword [eax*4 + 0x44388c]
jmp 0x406438
cmp ecx, 0x30000000
jne 0x40643d
mov ecx, dword [esi]
sar eax, 4
mov edx, dword [eax*4 + 0x42caa8]
push edx
push esi
call dword [ecx + 0x7c]
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0xc0
ret