Function at 0x406020
Capabilities:
Resolve function by parsing pe exports
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x43d270
mov eax, dword fs:[0]
push eax
sub esp, 0x1c
push ebx
push esi
push edi
mov eax, dword [0x447040]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, dword [0x4474b8]
mov edi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x10], 6
mov eax, dword [ebx + 0x2c]
test eax, eax
je 0x4061c9
cmp byte [ebx + 1], 0
je 0x4061c9
mov byte [eax + 0x10], 0
mov esi, dword [ebx + 0x2c]
mov dword [ebp - 0x14], esi
test esi, esi
je 0x4061c9
mov ecx, esi
mov dword [ebp - 4], 0
call fcn.004275e0
mov ecx, esi
call fcn.004277e0
add esi, 0x3c
xor edx, edx
mov dword [ebp - 0x20], esi
mov dword [ebp - 0x18], edx
cmp dword [esi], edx
jle 0x406143
xor ecx, ecx
mov ebx, esi
mov dword [ebp - 0x1c], ecx
mov eax, dword [ebx + 8]
mov esi, dword [ecx + eax]
test esi, esi
je 0x40612b
mov ecx, esi
call fcn.0042a060
mov ecx, dword [0x4474b8]
test ecx, ecx
je 0x40611f
movsx eax, word [ecx + 0x520c]
mov edx, dword [ecx + 0x3f70]
add eax, 0xa42
mov dword [ebp - 0x24], edx
cmp dword [ecx + eax*8], edx
lea eax, [ecx + eax*8]
je 0x406115
movsx eax, word [ecx + 0x520c]
inc eax
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov edx, dword [ebp - 0x24]
mov word [ecx + 0x520c], ax
cwde
add eax, 0xa42
lea eax, [ecx + eax*8]
mov dword [eax], edx
xor edx, edx
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5208]
push esi
call edi
mov ecx, dword [ebp - 0x1c]
add esp, 4
mov edx, dword [ebp - 0x18]
inc edx
add ecx, 4
mov dword [ebp - 0x18], edx
mov dword [ebp - 0x1c], ecx
cmp edx, dword [ebx]
jl 0x4060b4
mov ebx, dword [ebp - 0x28]
mov esi, dword [ebp - 0x20]
mov ecx, esi
call fcn.00401010
mov eax, dword [ebp - 0x14]
lea ecx, [eax + 0x54]
mov byte [eax + 0x18], 0
call fcn.0041af60
mov ecx, dword [ebp - 0x14]
lea ecx, [ecx + 0x48]
call fcn.0041af60
mov ecx, esi
call fcn.0041af60
mov dword [ebp - 4], 0xffffffff
mov ecx, dword [0x4474b8]
test ecx, ecx
je 0x4061c1
movsx edx, word [ecx + 0x520c]
lea eax, [ecx + 0x5210]
mov esi, dword [ecx + 0x3f70]
lea eax, [eax + edx*8]
cmp dword [eax], esi
je 0x4061b7
lea eax, [edx + 1]
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov word [ecx + 0x520c], ax
cwde
add eax, 0xa42
xor edx, edx
lea eax, [ecx + eax*8]
mov dword [eax], esi
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5208]
push dword [ebp - 0x14]
call edi
add esp, 4
lea ecx, [ebx + 0x3d90]
mov dword [ebx + 0x2c], 0
call fcn.00401010
cmp byte [ebx], 0
je 0x4069e4
cmp byte [ebx + 0x50d0], 0
je 0x406240
mov esi, dword [ebx + 0x20]
test esi, esi
je 0x406240
mov eax, dword [0x4474b8]
lea ecx, [ebp - 0x20]
mov dword [ebp - 0x20], 0
mov dword [eax + 0x50d4], 0
call fcn.00419e30
mov edx, 0x43f3fc
mov dword [ebp - 0x28], eax
mov ecx, esi
call fcn.004027c0
mov esi, eax
test esi, esi
je 0x406240
push esi
push dword [ebp - 0x20]
push 1
push dword [ebp - 0x28]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fwrite]
push esi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 0x14
mov eax, dword [ebx + 0x5108]
mov esi, dword [ebx + 0x5110]
lea eax, [eax + eax*4]
lea eax, [esi + eax*4]
mov dword [ebp - 0x28], eax
cmp esi, eax
je 0x40627a
nop dword [eax]
cmp dword [esi + 4], 6
jne 0x406273
mov eax, dword [esi + 0xc]
push esi
push ebx
call eax
mov eax, dword [ebp - 0x28]
add esp, 8
add esi, 0x14
cmp esi, eax
jne 0x406260
xor ecx, ecx
lea edx, [ebx + 0x3fb8]
mov dword [ebp - 0x20], ecx
cmp dword [edx], ecx
jle 0x406323
xor edi, edi
nop
mov eax, dword [edx + 8]
mov esi, dword [edi + eax]
test esi, esi
je 0x40630e
mov ecx, esi
call fcn.00407200
mov ecx, dword [0x4474b8]
test ecx, ecx
je 0x4062fb
movsx eax, word [ecx + 0x520c]
mov edx, dword [ecx + 0x3f70]
add eax, 0xa42
mov dword [ebp - 0x28], edx
cmp dword [ecx + eax*8], edx
lea eax, [ecx + eax*8]
je 0x4062f1
movsx eax, word [ecx + 0x520c]
inc eax
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov edx, dword [ebp - 0x28]
mov word [ecx + 0x520c], ax
cwde
add eax, 0xa42
lea eax, [ecx + eax*8]
mov dword [eax], edx
xor edx, edx
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5208]
push esi
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov ecx, dword [ebp - 0x20]
lea edx, [ebx + 0x3fb8]
add esp, 4
inc ecx
add edi, 4
mov dword [ebp - 0x20], ecx
cmp ecx, dword [edx]
jl 0x406290
mov edi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov ecx, edx
call fcn.00401010
lea ecx, [ebx + 0x3fc4]
call fcn.00401010
lea ecx, [ebx + 0x3fd0]
call fcn.00401010
mov dword [ebx + 0x4004], 0
mov esi, dword [ebx + 0x3fe4]
test esi, esi
je 0x4063d2
mov ecx, dword [0x4474b8]
mov dword [ebx + 0x3fe0], 0
mov dword [ebx + 0x3fdc], 0
test ecx, ecx
je 0x4063c2
movsx eax, word [ecx + 0x520c]
mov edx, dword [ecx + 0x3f70]
add eax, 0xa42
mov dword [ebp - 0x28], edx
cmp dword [ecx + eax*8], edx
lea eax, [ecx + eax*8]
je 0x4063b8
movsx eax, word [ecx + 0x520c]
inc eax
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov edx, dword [ebp - 0x28]
mov word [ecx + 0x520c], ax
cwde
add eax, 0xa42
lea eax, [ecx + eax*8]
mov dword [eax], edx
xor edx, edx
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5208]
push esi
call edi
add esp, 4
mov dword [ebx + 0x3fe4], 0
lea ecx, [ebx + 0x3fe8]
call fcn.00401010
or eax, 0xffffffff
mov dword [ebx + 0x4ad8], 0
mov dword [ebx + 0x400c], 0
lea edi, [ebx + 0x4804]
mov dword [ebx + 0x4008], 0
mov ecx, 0x4d
mov dword [ebx + 0x4090], 0
mov dword [ebx + 0x4080], 0
mov dword [ebx + 0x4014], 0
rep stosd dword es:[edi], eax
lea ecx, [ebx + 0x4938]
call fcn.00401010
lea ecx, [ebx + 0x4944]
call fcn.00401010
mov esi, dword [ebx + 0x4a68]
test esi, esi
je 0x4064c4
mov ecx, dword [0x4474b8]
mov dword [ebx + 0x4a64], 0
mov dword [ebx + 0x4a60], 0
test ecx, ecx
je 0x4064ac
movsx edx, word [ecx + 0x520c]
lea eax, [ecx + 0x5210]
mov edi, dword [ecx + 0x3f70]
lea eax, [eax + edx*8]
cmp dword [eax], edi
je 0x4064a2
lea eax, [edx + 1]
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov word [ecx + 0x520c], ax
cwde
add eax, 0xa42
xor edx, edx
lea eax, [ecx + eax*8]
mov dword [eax], edi
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5208]
push esi
mov esi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
call esi
add esp, 4
mov dword [ebx + 0x4a68], 0
jmp 0x4064ca
mov esi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov edi, dword [ebx + 0x4a74]
test edi, edi
je 0x406552
mov ecx, dword [0x4474b8]
mov dword [ebx + 0x4a70], 0
mov dword [ebx + 0x4a6c], 0
test ecx, ecx
je 0x406542
movsx eax, word [ecx + 0x520c]
mov edx, dword [ecx + 0x3f70]
add eax, 0xa42
mov dword [ebp - 0x28], edx
cmp dword [ecx + eax*8], edx
lea eax, [ecx + eax*8]
je 0x406538
movsx eax, word [ecx + 0x520c]
inc eax
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov edx, dword [ebp - 0x28]
mov word [ecx + 0x520c], ax
cwde
add eax, 0xa42
lea eax, [ecx + eax*8]
mov dword [eax], edx
xor edx, edx
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5208]
push edi
call esi
add esp, 4
mov dword [ebx + 0x4a74], 0
lea ecx, [ebx + 0x4a78]
call fcn.00401010
lea ecx, [ebx + 0x4aa8]
call fcn.00401010
lea ecx, [ebx + 0x4ab4]
call fcn.00401010
mov edi, dword [ebx + 0x4ac8]
test edi, edi
je 0x4065fb
mov ecx, dword [0x4474b8]
mov dword [ebx + 0x4ac4], 0
mov dword [ebx + 0x4ac0], 0
test ecx, ecx
je 0x4065eb
movsx eax, word [ecx + 0x520c]
mov edx, dword [ecx + 0x3f70]
add eax, 0xa42
mov dword [ebp - 0x28], edx
cmp dword [ecx + eax*8], edx
lea eax, [ecx + eax*8]
je 0x4065e1
movsx eax, word [ecx + 0x520c]
inc eax
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov edx, dword [ebp - 0x28]
mov word [ecx + 0x520c], ax
cwde
add eax, 0xa42
lea eax, [ecx + eax*8]
mov dword [eax], edx
xor edx, edx
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5208]
push edi
call esi
add esp, 4
mov dword [ebx + 0x4ac8], 0
lea ecx, [ebx + 0x4acc]
call fcn.0041b410
lea ecx, [ebx + 0x4dd8]
call fcn.0041b1b0
mov edi, dword [ebx + 0x4e00]
test edi, edi
je 0x406699
mov ecx, dword [0x4474b8]
mov dword [ebx + 0x4dfc], 0
mov dword [ebx + 0x4df8], 0
test ecx, ecx
je 0x406689
movsx eax, word [ecx + 0x520c]
mov edx, dword [ecx + 0x3f70]
add eax, 0xa42
mov dword [ebp - 0x28], edx
cmp dword [ecx + eax*8], edx
lea eax, [ecx + eax*8]
je 0x40667f
movsx eax, word [ecx + 0x520c]
inc eax
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov edx, dword [ebp - 0x28]
mov word [ecx + 0x520c], ax
cwde
add eax, 0xa42
lea eax, [ecx + eax*8]
mov dword [eax], edx
xor edx, edx
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5208]
push edi
call esi
add esp, 4
mov dword [ebx + 0x4e00], 0
mov edi, dword [ebx + 0x4e0c]
test edi, edi
je 0x406721
mov ecx, dword [0x4474b8]
mov dword [ebx + 0x4e08], 0
mov dword [ebx + 0x4e04], 0
test ecx, ecx
je 0x406711
movsx eax, word [ecx + 0x520c]
mov edx, dword [ecx + 0x3f70]
add eax, 0xa42
mov dword [ebp - 0x28], edx
cmp dword [ecx + eax*8], edx
lea eax, [ecx + eax*8]
je 0x406707
movsx eax, word [ecx + 0x520c]
inc eax
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov edx, dword [ebp - 0x28]
mov word [ecx + 0x520c], ax
cwde
add eax, 0xa42
lea eax, [ecx + eax*8]
mov dword [eax], edx
xor edx, edx
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5208]
push edi
call esi
add esp, 4
mov dword [ebx + 0x4e0c], 0
xor edi, edi
lea eax, [ebx + 0x4d80]
mov dword [ebp - 0x20], eax
cmp dword [ebx + 0x4d78], edi
jle 0x406759
xor esi, esi
mov ecx, dword [eax]
add ecx, esi
call fcn.00401600
inc edi
lea eax, [ebx + 0x4d80]
add esi, 0x1c
cmp edi, dword [ebx + 0x4d78]
jl 0x406736
lea eax, [ebx + 0x4d80]
jmp 0x40675c
mov dword [ebp - 0x20], eax
mov esi, dword [eax]
test esi, esi
je 0x4067d8
mov ecx, dword [0x4474b8]
mov dword [ebx + 0x4d7c], 0
mov dword [ebx + 0x4d78], 0
test ecx, ecx
je 0x4067c5
movsx edx, word [ecx + 0x520c]
lea eax, [ecx + 0x5210]
mov edi, dword [ecx + 0x3f70]
lea eax, [eax + edx*8]
cmp dword [eax], edi
je 0x4067bb
lea eax, [edx + 1]
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov word [ecx + 0x520c], ax
cwde
add eax, 0xa42
xor edx, edx
lea eax, [ecx + eax*8]
mov dword [eax], edi
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5208]
push esi
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov eax, dword [ebp - 0x20]
add esp, 4
mov dword [eax], 0
lea ecx, [ebx + 0x4d9c]
call fcn.0041b2f0
xor edi, edi
cmp dword [ebx + 0x4d90], edi
jle 0x406809
xor esi, esi
nop
mov ecx, dword [ebx + 0x4d98]
add ecx, esi
call fcn.0041be60
inc edi
add esi, 0x78
cmp edi, dword [ebx + 0x4d90]
jl 0x4067f0
mov esi, dword [ebx + 0x4d98]
test esi, esi
je 0x40688e
mov ecx, dword [0x4474b8]
mov dword [ebx + 0x4d94], 0
mov dword [ebx + 0x4d90], 0
test ecx, ecx
je 0x406876
movsx edx, word [ecx + 0x520c]
lea eax, [ecx + 0x5210]
mov edi, dword [ecx + 0x3f70]
lea eax, [eax + edx*8]
cmp dword [eax], edi
je 0x40686c
lea eax, [edx + 1]
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov word [ecx + 0x520c], ax
cwde
add eax, 0xa42
xor edx, edx
lea eax, [ecx + eax*8]
mov dword [eax], edi
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5208]
push esi
mov esi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
call esi
add esp, 4
mov dword [ebx + 0x4d98], 0
jmp 0x406894
mov esi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
lea ecx, [ebx + 0x4dc8]
call fcn.00401010
lea ecx, [ebx + 0x4e84]
call fcn.0041b000
lea ecx, [ebx + 0x4e78]
call fcn.0041b100
lea ecx, [ebx + 0x5038]
call fcn.00401010
lea ecx, [ebx + 0x5044]
call fcn.00401010
lea ecx, [ebx + 0x4edc]
call fcn.00401010
lea ecx, [ebx + 0x4ee8]
call fcn.00401010
lea ecx, [ebx + 0x4f28]
mov dword [ebx + 0x4f24], 0
call fcn.00401010
lea ecx, [ebx + 0x50f0]
call fcn.00401010
mov eax, dword [ebx + 0x50ec]
mov dword [ebp - 0x28], eax
test eax, eax
je 0x406984
mov ecx, dword [0x4474b8]
mov dword [ebx + 0x50e8], 0
mov dword [ebx + 0x50e4], 0
test ecx, ecx
je 0x406974
movsx edx, word [ecx + 0x520c]
lea eax, [ecx + 0x5210]
mov edi, dword [ecx + 0x3f70]
lea eax, [eax + edx*8]
cmp dword [eax], edi
je 0x406967
lea eax, [edx + 1]
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov word [ecx + 0x520c], ax
cwde
add eax, 0xa42
xor edx, edx
lea eax, [ecx + eax*8]
mov dword [eax], edi
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5208]
mov eax, dword [ebp - 0x28]
push eax
call esi
add esp, 4
mov dword [ebx + 0x50ec], 0
cmp dword [ebx + 0x5148], 0
je 0x4069b6
mov esi, dword [ebx + 0x5148]
push 1
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
add esp, 4
cmp esi, eax
je 0x4069ac
push esi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 4
mov dword [ebx + 0x5148], 0
lea ecx, [ebx + 0x514c]
call fcn.00401010
lea ecx, [ebx + 0x5184]
call fcn.00401010
lea ecx, [ebx + 0x5190]
call fcn.00401010
mov dword [ebx + 0x519c], 0
mov byte [ebx], 0
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret