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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x43b1c0
mov eax, dword fs:[0]
push eax
sub esp, 0x14
push ebx
push esi
push edi
mov eax, dword [0x445040]
xor eax, ebp
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, dword [0x4454a8]
mov edi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov dword [ebp - 0x10], 6
mov eax, dword [ebx + 0x2c]
test eax, eax
je 0x405a7d
cmp byte [ebx + 1], 0
je 0x405a7d
mov byte [eax + 0x10], 0
mov esi, dword [ebx + 0x2c]
mov dword [ebp - 0x1c], esi
test esi, esi
je 0x405a7d
mov ecx, esi
mov dword [ebp - 4], 0
call fcn.004264b0
mov ecx, esi
call fcn.004266b0
lea ecx, [esi + 0x3c]
xor esi, esi
mov dword [ebp - 0x14], ecx
cmp dword [ecx], esi
jle 0x4059f2
mov eax, dword [ecx + 8]
mov edi, dword [eax + esi*4]
test edi, edi
je 0x4059e3
mov ecx, edi
call fcn.00428f00
mov ecx, dword [0x4454a8]
test ecx, ecx
je 0x4059d2
movsx eax, word [ecx + 0x5eec]
mov edx, dword [ecx + 0x3f10]
add eax, 0xbde
mov dword [ebp - 0x18], edx
cmp dword [ecx + eax*8], edx
lea eax, [ecx + eax*8]
je 0x4059c8
movsx eax, word [ecx + 0x5eec]
inc eax
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov edx, dword [ebp - 0x18]
mov word [ecx + 0x5eec], ax
cwde
add eax, 0xbde
lea eax, [ecx + eax*8]
mov dword [eax], edx
xor edx, edx
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5ee8]
push edi
mov edi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
call edi
mov ecx, dword [ebp - 0x14]
add esp, 4
jmp 0x4059e9
mov edi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
inc esi
cmp esi, dword [ecx]
jl 0x405967
call fcn.00401010
mov esi, dword [ebp - 0x1c]
lea ecx, [esi + 0x54]
mov byte [esi + 0x18], 0
call fcn.00419e80
lea ecx, [esi + 0x48]
call fcn.00419e80
mov ecx, dword [ebp - 0x14]
call fcn.00419e80
mov dword [ebp - 4], 0xffffffff
mov ecx, dword [0x4454a8]
test ecx, ecx
je 0x405a77
movsx eax, word [ecx + 0x5eec]
mov edx, dword [ecx + 0x3f10]
add eax, 0xbde
mov dword [ebp - 0x1c], edx
cmp dword [ecx + eax*8], edx
lea eax, [ecx + eax*8]
je 0x405a6d
movsx eax, word [ecx + 0x5eec]
inc eax
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov edx, dword [ebp - 0x1c]
mov word [ecx + 0x5eec], ax
cwde
add eax, 0xbde
lea eax, [ecx + eax*8]
mov dword [eax], edx
xor edx, edx
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5ee8]
push esi
call edi
add esp, 4
lea ecx, [ebx + 0x3d34]
mov dword [ebx + 0x2c], 0
call fcn.00401010
cmp byte [ebx], 0
je 0x406269
cmp byte [ebx + 0x5dc4], 0
je 0x405af1
mov esi, dword [ebx + 0x20]
test esi, esi
je 0x405af1
mov eax, dword [0x4454a8]
lea ecx, [ebp - 0x14]
mov dword [ebp - 0x14], 0
mov dword [eax + 0x5dc8], 0
call fcn.00418dd0
mov edx, 0x43d130
mov ecx, esi
mov edi, eax
call fcn.00403e30
mov esi, eax
test esi, esi
je 0x405af1
push esi
push dword [ebp - 0x14]
push 1
push edi
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 + 0x5dfc]
mov esi, dword [ebx + 0x5e04]
lea eax, [eax + eax*4]
lea edi, [esi + eax*4]
cmp esi, edi
je 0x405b1e
cmp dword [esi + 4], 6
jne 0x405b17
mov eax, dword [esi + 0xc]
push esi
push ebx
call eax
add esp, 8
add esi, 0x14
cmp esi, edi
jne 0x405b07
lea ecx, [ebx + 0x3f48]
xor esi, esi
cmp dword [ecx], esi
jle 0x405bb0
nop
mov eax, dword [ecx + 8]
mov edi, dword [eax + esi*4]
test edi, edi
je 0x405bab
mov ecx, edi
call fcn.00406a80
mov ecx, dword [0x4454a8]
test ecx, ecx
je 0x405b9b
movsx eax, word [ecx + 0x5eec]
mov edx, dword [ecx + 0x3f10]
add eax, 0xbde
mov dword [ebp - 0x1c], edx
cmp dword [ecx + eax*8], edx
lea eax, [ecx + eax*8]
je 0x405b91
movsx eax, word [ecx + 0x5eec]
inc eax
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov edx, dword [ebp - 0x1c]
mov word [ecx + 0x5eec], ax
cwde
add eax, 0xbde
lea eax, [ecx + eax*8]
mov dword [eax], edx
xor edx, edx
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5ee8]
push edi
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
add esp, 4
lea ecx, [ebx + 0x3f48]
inc esi
cmp esi, dword [ecx]
jl 0x405b30
call fcn.00401010
lea ecx, [ebx + 0x3f54]
call fcn.00401010
lea ecx, [ebx + 0x3f60]
call fcn.00401010
mov dword [ebx + 0x3f94], 0
mov esi, dword [ebx + 0x3f74]
test esi, esi
je 0x405c5a
mov ecx, dword [0x4454a8]
mov dword [ebx + 0x3f70], 0
mov dword [ebx + 0x3f6c], 0
test ecx, ecx
je 0x405c42
movsx edx, word [ecx + 0x5eec]
lea eax, [ecx + 0x5ef0]
mov edi, dword [ecx + 0x3f10]
lea eax, [eax + edx*8]
cmp dword [eax], edi
je 0x405c38
lea eax, [edx + 1]
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov word [ecx + 0x5eec], ax
cwde
add eax, 0xbde
xor edx, edx
lea eax, [ecx + eax*8]
mov dword [eax], edi
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5ee8]
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 + 0x3f74], 0
jmp 0x405c60
mov esi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
lea ecx, [ebx + 0x3f78]
call fcn.00401010
or eax, 0xffffffff
mov dword [ebx + 0x4a44], 0
mov dword [ebx + 0x3f9c], 0
lea edi, [ebx + 0x4784]
mov dword [ebx + 0x3f98], 0
mov ecx, 0x4d
mov dword [ebx + 0x4014], 0
mov dword [ebx + 0x4004], 0
mov dword [ebx + 0x3fa0], 0
rep stosd dword es:[edi], eax
lea ecx, [ebx + 0x48b8]
call fcn.00401010
lea ecx, [ebx + 0x48c4]
call fcn.00401010
mov edi, dword [ebx + 0x49d4]
test edi, edi
je 0x405d55
mov ecx, dword [0x4454a8]
mov dword [ebx + 0x49d0], 0
mov dword [ebx + 0x49cc], 0
test ecx, ecx
je 0x405d45
movsx eax, word [ecx + 0x5eec]
mov edx, dword [ecx + 0x3f10]
add eax, 0xbde
mov dword [ebp - 0x1c], edx
cmp dword [ecx + eax*8], edx
lea eax, [ecx + eax*8]
je 0x405d3b
movsx eax, word [ecx + 0x5eec]
inc eax
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov edx, dword [ebp - 0x1c]
mov word [ecx + 0x5eec], ax
cwde
add eax, 0xbde
lea eax, [ecx + eax*8]
mov dword [eax], edx
xor edx, edx
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5ee8]
push edi
call esi
add esp, 4
mov dword [ebx + 0x49d4], 0
mov edi, dword [ebx + 0x49e0]
test edi, edi
je 0x405ddd
mov ecx, dword [0x4454a8]
mov dword [ebx + 0x49dc], 0
mov dword [ebx + 0x49d8], 0
test ecx, ecx
je 0x405dcd
movsx eax, word [ecx + 0x5eec]
mov edx, dword [ecx + 0x3f10]
add eax, 0xbde
mov dword [ebp - 0x1c], edx
cmp dword [ecx + eax*8], edx
lea eax, [ecx + eax*8]
je 0x405dc3
movsx eax, word [ecx + 0x5eec]
inc eax
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov edx, dword [ebp - 0x1c]
mov word [ecx + 0x5eec], ax
cwde
add eax, 0xbde
lea eax, [ecx + eax*8]
mov dword [eax], edx
xor edx, edx
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5ee8]
push edi
call esi
add esp, 4
mov dword [ebx + 0x49e0], 0
lea ecx, [ebx + 0x49e4]
call fcn.00401010
lea ecx, [ebx + 0x4a14]
call fcn.00401010
lea ecx, [ebx + 0x4a20]
call fcn.00401010
mov edi, dword [ebx + 0x4a34]
test edi, edi
je 0x405e86
mov ecx, dword [0x4454a8]
mov dword [ebx + 0x4a30], 0
mov dword [ebx + 0x4a2c], 0
test ecx, ecx
je 0x405e76
movsx eax, word [ecx + 0x5eec]
mov edx, dword [ecx + 0x3f10]
add eax, 0xbde
mov dword [ebp - 0x1c], edx
cmp dword [ecx + eax*8], edx
lea eax, [ecx + eax*8]
je 0x405e6c
movsx eax, word [ecx + 0x5eec]
inc eax
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov edx, dword [ebp - 0x1c]
mov word [ecx + 0x5eec], ax
cwde
add eax, 0xbde
lea eax, [ecx + eax*8]
mov dword [eax], edx
xor edx, edx
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5ee8]
push edi
call esi
add esp, 4
mov dword [ebx + 0x4a34], 0
lea ecx, [ebx + 0x4a38]
call fcn.0041a170
lea ecx, [ebx + 0x4d3c]
call fcn.00419f20
mov edi, dword [ebx + 0x4d64]
test edi, edi
je 0x405f24
mov ecx, dword [0x4454a8]
mov dword [ebx + 0x4d60], 0
mov dword [ebx + 0x4d5c], 0
test ecx, ecx
je 0x405f14
movsx eax, word [ecx + 0x5eec]
mov edx, dword [ecx + 0x3f10]
add eax, 0xbde
mov dword [ebp - 0x1c], edx
cmp dword [ecx + eax*8], edx
lea eax, [ecx + eax*8]
je 0x405f0a
movsx eax, word [ecx + 0x5eec]
inc eax
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov edx, dword [ebp - 0x1c]
mov word [ecx + 0x5eec], ax
cwde
add eax, 0xbde
lea eax, [ecx + eax*8]
mov dword [eax], edx
xor edx, edx
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5ee8]
push edi
call esi
add esp, 4
mov dword [ebx + 0x4d64], 0
mov edi, dword [ebx + 0x4d70]
test edi, edi
je 0x405fac
mov ecx, dword [0x4454a8]
mov dword [ebx + 0x4d6c], 0
mov dword [ebx + 0x4d68], 0
test ecx, ecx
je 0x405f9c
movsx eax, word [ecx + 0x5eec]
mov edx, dword [ecx + 0x3f10]
add eax, 0xbde
mov dword [ebp - 0x1c], edx
cmp dword [ecx + eax*8], edx
lea eax, [ecx + eax*8]
je 0x405f92
movsx eax, word [ecx + 0x5eec]
inc eax
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov edx, dword [ebp - 0x1c]
mov word [ecx + 0x5eec], ax
cwde
add eax, 0xbde
lea eax, [ecx + eax*8]
mov dword [eax], edx
xor edx, edx
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5ee8]
push edi
call esi
add esp, 4
mov dword [ebx + 0x4d70], 0
xor edi, edi
lea eax, [ebx + 0x4ce4]
mov dword [ebp - 0x14], eax
cmp dword [ebx + 0x4cdc], edi
jle 0x405fe4
xor esi, esi
mov ecx, dword [eax]
add ecx, esi
call fcn.00401540
inc edi
lea eax, [ebx + 0x4ce4]
add esi, 0x1c
cmp edi, dword [ebx + 0x4cdc]
jl 0x405fc1
lea eax, [ebx + 0x4ce4]
jmp 0x405fe7
mov dword [ebp - 0x14], eax
mov esi, dword [eax]
test esi, esi
je 0x406063
mov ecx, dword [0x4454a8]
mov dword [ebx + 0x4ce0], 0
mov dword [ebx + 0x4cdc], 0
test ecx, ecx
je 0x406050
movsx edx, word [ecx + 0x5eec]
lea eax, [ecx + 0x5ef0]
mov edi, dword [ecx + 0x3f10]
lea eax, [eax + edx*8]
cmp dword [eax], edi
je 0x406046
lea eax, [edx + 1]
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov word [ecx + 0x5eec], ax
cwde
add eax, 0xbde
xor edx, edx
lea eax, [ecx + eax*8]
mov dword [eax], edi
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5ee8]
push esi
call dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov eax, dword [ebp - 0x14]
add esp, 4
mov dword [eax], 0
lea ecx, [ebx + 0x4d00]
call fcn.0041a050
xor edi, edi
cmp dword [ebx + 0x4cf4], edi
jle 0x406099
xor esi, esi
nop word [eax + eax]
mov ecx, dword [ebx + 0x4cfc]
add ecx, esi
call fcn.0041ac70
inc edi
add esi, 0x78
cmp edi, dword [ebx + 0x4cf4]
jl 0x406080
mov esi, dword [ebx + 0x4cfc]
test esi, esi
je 0x40611e
mov ecx, dword [0x4454a8]
mov dword [ebx + 0x4cf8], 0
mov dword [ebx + 0x4cf4], 0
test ecx, ecx
je 0x406106
movsx edx, word [ecx + 0x5eec]
lea eax, [ecx + 0x5ef0]
mov edi, dword [ecx + 0x3f10]
lea eax, [eax + edx*8]
cmp dword [eax], edi
je 0x4060fc
lea eax, [edx + 1]
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov word [ecx + 0x5eec], ax
cwde
add eax, 0xbde
xor edx, edx
lea eax, [ecx + eax*8]
mov dword [eax], edi
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5ee8]
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 + 0x4cfc], 0
jmp 0x406124
mov esi, dword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
lea ecx, [ebx + 0x4d2c]
call fcn.00401010
lea ecx, [ebx + 0x5d2c]
call fcn.00401010
lea ecx, [ebx + 0x5d38]
call fcn.00401010
lea ecx, [ebx + 0x4dac]
call fcn.00401010
lea ecx, [ebx + 0x4db8]
call fcn.00401010
lea ecx, [ebx + 0x4dc4]
call fcn.00401010
lea ecx, [ebx + 0x5c24]
mov dword [ebx + 0x5c20], 0
call fcn.00401010
lea ecx, [ebx + 0x5de4]
call fcn.00401010
mov eax, dword [ebx + 0x5de0]
mov dword [ebp - 0x1c], eax
test eax, eax
je 0x406209
mov ecx, dword [0x4454a8]
mov dword [ebx + 0x5ddc], 0
mov dword [ebx + 0x5dd8], 0
test ecx, ecx
je 0x4061f9
movsx edx, word [ecx + 0x5eec]
lea eax, [ecx + 0x5ef0]
mov edi, dword [ecx + 0x3f10]
lea eax, [eax + edx*8]
cmp dword [eax], edi
je 0x4061ec
lea eax, [edx + 1]
cdq
idiv dword [ebp - 0x10]
movzx eax, dx
mov word [ecx + 0x5eec], ax
cwde
add eax, 0xbde
xor edx, edx
lea eax, [ecx + eax*8]
mov dword [eax], edi
mov dword [eax + 4], edx
inc word [eax + 6]
inc dword [ecx + 0x5ee8]
mov eax, dword [ebp - 0x1c]
push eax
call esi
add esp, 4
mov dword [ebx + 0x5de0], 0
cmp dword [ebx + 0x5e34], 0
je 0x40623b
mov esi, dword [ebx + 0x5e34]
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 0x406231
push esi
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fclose]
add esp, 4
mov dword [ebx + 0x5e34], 0
lea ecx, [ebx + 0x5e38]
call fcn.00401010
lea ecx, [ebx + 0x5e64]
call fcn.00401010
lea ecx, [ebx + 0x5e70]
call fcn.00401010
mov dword [ebx + 0x5e7c], 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