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

Disassembly:
sub esp, 0x3c8
push ebx
push ebp
mov ebp, dword [esp + 0x3dc]
mov eax, dword [ebp + 4]
push esi
push edi
mov edi, dword [eax]
push 0x6e17f0
xor esi, esi
push str.Encoding__s_image
lea eax, [esp + 0x1d8]
mov word [esp + 0x1d8], si
call fcn.00483050
mov ecx, dword [esp + 0x3e8]
mov edx, dword [ecx]
mov edx, dword [edx + 0x20]
add esp, 8
push esi
lea eax, [esp + 0x1d4]
push eax
call edx
mov eax, dword [ebp]
mov dword [esp + 0x1c], eax
mov eax, 1
mov dword [esp + 0x7c], eax
mov dword [esp + 0x80], eax
lea ecx, [edi + 1]
mov eax, ecx
cdq
mov ebx, 3
idiv ebx
mov dword [esp + 0x70], 0xffffffff
mov dword [esp + 0x74], esi
mov dword [esp + 0x78], esi
mov dword [esp + 0x8c], esi
mov dword [esp + 0x84], esi
mov dword [esp + 0x88], esi
mov dword [esp + 0x90], esi
mov dword [esp + 0x94], esi
mov dword [esp + 0xa8], esi
mov dword [esp + 0x98], esi
mov dword [esp + 0x9c], esi
mov dword [esp + 0xa0], esi
mov dword [esp + 0xa4], esi
mov dword [esp + 0xac], esi
mov dword [esp + 0xb0], esi
mov dword [esp + 0xb4], esi
mov dword [esp + 0xb8], esi
mov dword [esp + 0xbc], esi
mov byte [esp + 0xc8], 0
cmp edx, esi
sete byte [esp + 0x12]
cmp edx, 1
sete bl
cmp edx, 2
sete byte [esp + 0x13]
cmp edi, 3
setl byte [esp + 0x1a]
test bl, bl
mov byte [esp + 0x1b], bl
je 0x58f32a
mov edi, dword [esp + 0x1c]
mov edx, dword [edi + 8]
mov eax, dword [edi + 4]
push edx
push eax
push ecx
push str.P_d_n_d__d_n
lea eax, [esp + 0xd8]
call fcn.00553f00
jmp 0x58f34c
mov eax, dword [esp + 0x1c]
mov edx, dword [eax + 8]
mov eax, dword [eax + 4]
push edx
push eax
push ecx
push str.P_d_n_d__d_n255_n
lea eax, [esp + 0xd8]
call fcn.00553f00
mov edi, dword [esp + 0x2c]
lea eax, [esp + 0xd8]
add esp, 0x10
lea edx, [eax + 1]
lea esp, [esp]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x58f360
push esi
sub eax, edx
lea ecx, [esp + 0x24]
push ecx
push eax
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0x10]
lea edx, [esp + 0xd4]
push edx
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
lea eax, [esp + 0xc8]
lea edx, [eax + 1]
mov cl, byte [eax]
add eax, 1
test cl, cl
jne 0x58f391
sub eax, edx
cmp dword [esp + 0x20], eax
je 0x58f3b4
mov esi, dword [esp + 0x3dc]
mov dword [esi], 2
jmp 0x58f6f5
test bl, bl
jne 0x58f3be
cmp byte [esp + 0x13], bl
je 0x58f3e1
push esi
push esi
mov eax, edi
push esi
lea edi, [esp + 0x7c]
call fcn.004d0d70
mov edx, dword [ebp]
mov ecx, edi
call fcn.004d35f0
mov eax, edi
call fcn.005b8500
mov edi, dword [esp + 0x1c]
xor edx, edx
cmp byte [esp + 0x12], dl
setne dl
lea edx, [edx + edx + 1]
imul edx, dword [edi + 4]
mov edi, edx
push edi
mov dword [esp + 0x2c], edi
call fcn.0069c0de
test edi, edi
mov dword [esp + 0x3c], edi
fild dword [esp + 0x3c]
mov ebx, eax
mov dword [esp + 0x24], esi
jge 0x58f416
fadd qword [0x7235b8]
fmul qword [0x723e70]
push ecx
fstp qword [esp]
call fcn.0069c430
fnstcw word [esp + 0x1c]
movzx eax, word [esp + 0x1c]
or eax, 0xc00
mov dword [esp + 0x2c], eax
fldcw word [esp + 0x2c]
fistp qword [esp + 0xc8]
mov eax, dword [esp + 0xc8]
push eax
mov dword [esp + 0x50], eax
fldcw word [esp + 0x20]
call fcn.0069c0de
mov ebp, eax
mov eax, dword [esp + 0x3f0]
mov ecx, dword [eax + 4]
mov edx, dword [ecx + 4]
add esp, 0xc
cmp byte [esp + 0x12], 0
mov dword [esp + 0x24], edx
je 0x58f478
mov eax, dword [eax]
jmp 0x58f47c
lea eax, [esp + 0x70]
mov edi, eax
push 0
lea eax, [esp + 0x4c]
call fcn.004d2430
mov eax, dword [esp + 0x5c]
cmp eax, dword [esp + 0x48]
jae 0x58f6d6
jmp 0x58f4a0
lea edx, [esp + 0x48]
lea ecx, [esp + 0xc0]
call dword [esp + 0x68]
cmp byte [esp + 0x12], 0
mov eax, dword [eax]
je 0x58f4d3
mov ecx, eax
shr ecx, 0x10
mov byte [esi + ebx], cl
mov edx, eax
add esi, 1
shr edx, 8
mov byte [esi + ebx], dl
add esi, 1
mov byte [esi + ebx], al
jmp 0x58f4ef
shr eax, 0x10
cmp byte [esp + 0x13], 0
je 0x58f4e2
mov byte [esi + ebx], al
jmp 0x58f4ef
movzx eax, al
cmp eax, dword [esp + 0x24]
setge cl
mov byte [esi + ebx], cl
mov edi, dword [esp + 0x28]
add esi, 1
cmp esi, edi
jb 0x58f68e
cmp byte [esp + 0x1a], 0
je 0x58f59e
xor esi, esi
cmp edi, esi
mov dword [esp + 0x2c], esi
mov dword [esp + 0x30], esi
mov dword [esp + 0x34], esi
jbe 0x58f542
test esi, esi
mov eax, 0x6fe3e0
ja 0x58f529
mov eax, 0x6fda0c
movzx edx, byte [esi + ebx]
push edx
push eax
lea eax, [esp + 0x34]
call fcn.00552eb0
add esi, 1
add esp, 8
cmp esi, edi
jb 0x58f51b
push 0x6f0fd8
lea eax, [esp + 0x30]
call fcn.00552d80
mov eax, dword [esp + 0x2c]
test eax, eax
jne 0x58f55d
mov eax, 0x6bc0ce
mov edx, dword [esp + 0x30]
push 0
lea ecx, [esp + 0x40]
push ecx
push edx
push eax
mov eax, dword [esp + 0x3f4]
mov ecx, dword [eax + 8]
mov edx, dword [ecx + 0x10]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [esp + 0x3c]
cmp eax, dword [esp + 0x30]
jne 0x58f70d
mov ecx, dword [esp + 0x2c]
push ecx
call fcn.0069c8fa
add esp, 4
jmp 0x58f642
cmp byte [esp + 0x1b], 0
jne 0x58f5c8
mov eax, dword [esp + 0x3e4]
mov ecx, dword [eax + 8]
push 0
lea edx, [esp + 0x44]
push edx
mov edx, dword [ecx + 0x10]
push edi
push ebx
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [esp + 0x40], edi
jmp 0x58f63c
test edi, edi
mov dword [esp + 0x14], 0
jbe 0x58f617
mov esi, dword [esp + 0x14]
shr esi, 3
mov byte [esi + ebp], 0
xor al, al
mov ecx, dword [esp + 0x14]
movzx edx, al
lea edi, [edx + ecx]
cmp edi, dword [esp + 0x28]
jae 0x58f606
mov ecx, 7
sub ecx, edx
mov dl, byte [edi + ebx]
shl dl, cl
add al, 1
add byte [esi + ebp], dl
cmp al, 8
jb 0x58f5e1
mov eax, dword [esp + 0x14]
add eax, 8
cmp eax, dword [esp + 0x28]
mov dword [esp + 0x14], eax
jb 0x58f5d4
mov ecx, dword [esp + 0x3e4]
mov esi, dword [esp + 0x44]
mov edx, dword [ecx + 8]
push 0
lea eax, [esp + 0x3c]
push eax
mov eax, dword [edx + 0x10]
push esi
push ebp
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp dword [esp + 0x38], esi
jne 0x58f729
mov eax, dword [esp + 0x20]
mov edi, dword [esp + 0x3e0]
mov edx, dword [edi]
add eax, 1
xor esi, esi
test eax, eax
mov dword [esp + 0x14], eax
fild dword [esp + 0x14]
mov dword [esp + 0x20], eax
jge 0x58f66a
fadd qword [0x7235b8]
mov eax, dword [esp + 0x1c]
fidiv dword [eax + 8]
mov edx, dword [edx + 0x24]
sub esp, 8
mov ecx, edi
fstp qword [esp]
call edx
mov eax, dword [edi]
mov edx, dword [eax]
mov ecx, edi
call edx
test al, al
jne 0x58f738
mov edx, dword [esp + 0x5c]
mov edi, dword [esp + 0x48]
cmp edx, edi
jae 0x58f6d6
mov eax, dword [esp + 0x60]
mov ecx, dword [esp + 0x64]
add eax, dword [esp + 0x54]
add ecx, 1
add edx, 1
cmp ecx, dword [esp + 0x4c]
mov dword [esp + 0x60], eax
mov dword [esp + 0x64], ecx
mov dword [esp + 0x5c], edx
jne 0x58f6ce
add eax, dword [esp + 0x50]
mov dword [esp + 0x64], 0
mov dword [esp + 0x60], eax
cmp edx, edi
jb 0x58f4a0
mov esi, dword [esp + 0x3dc]
mov dword [esi], 0
push ebp
call fcn.0069c8fa
add esp, 4
push ebx
call fcn.0069c8fa
add esp, 4
lea ecx, [esp + 0x70]
call fcn.004d0c50
pop edi
mov eax, esi
pop esi
pop ebp
pop ebx
add esp, 0x3c8
ret 0xc
mov eax, dword [esp + 0x2c]
mov esi, dword [esp + 0x3dc]
push eax
mov dword [esi], 2
call fcn.0069c8fa
add esp, 4
jmp 0x58f6e3
mov esi, dword [esp + 0x3dc]
mov dword [esi], 2
jmp 0x58f6e3
mov esi, dword [esp + 0x3dc]
mov dword [esi], 1
jmp 0x58f6e3