Function at 0x58d3f0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x30c
push ebx
push esi
push edi
push 0x6e19c8
xor edi, edi
push str.Encoding__s_image
lea eax, [esp + 0x118]
mov word [esp + 0x118], di
call fcn.00483050
mov ecx, dword [ebp + 0xc]
mov eax, dword [ecx]
mov eax, dword [eax + 0x20]
add esp, 8
push edi
lea edx, [esp + 0x114]
push edx
call eax
mov ebx, dword [ebp + 0x10]
mov ecx, dword [ebx + 4]
mov eax, dword [ecx]
cmp eax, 1
mov dword [esp + 0x18], 0xc
jne 0x58d450
mov dword [esp + 0x18], eax
jmp 0x58d467
cmp eax, 2
jne 0x58d45b
mov dword [esp + 0x18], edi
jmp 0x58d467
cmp eax, edi
jne 0x58d467
mov dword [esp + 0x18], 2
mov ecx, dword [ebx]
mov eax, dword [esp + 0x18]
cmp dword [ecx], eax
je 0x58d77c
cmp eax, 0xc
je 0x58d77c
lea eax, [esp + 0x90]
call fcn.00408a40
push 0x50
call fcn.0069e704
mov edi, dword [esp + 0x9c]
mov ebx, dword [esp + 0x98]
mov esi, eax
add esp, 4
test esi, esi
jne 0x58d4f8
call fcn.004b05b0
mov dword [esp + 0x14], 0
mov esi, dword [esp + 0x14]
cmp dword [esi + 0x40], 0
mov dword [esp + 0x20], esi
je 0x58d4d4
cmp dword [esi], 0xffffffff
je 0x58d4d4
cmp dword [esi + 4], 0
jle 0x58d4d4
cmp dword [esi + 8], 0
jg 0x58d51d
mov edi, dword [ebp + 8]
mov ecx, esi
mov dword [edi], 2
call fcn.004d0c50
push esi
call fcn.0069d0cc
add esp, 4
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov eax, dword [esp + 0x18]
push 1
push edi
lea edx, [esp + 0xd8]
push edx
mov ecx, ebx
call fcn.004d3de0
mov ecx, esi
call fcn.004d0b40
mov esi, eax
mov dword [esp + 0x14], esi
jmp 0x58d4b9
mov eax, dword [ebp + 0x10]
mov ecx, dword [eax]
push 0
push edi
push ebx
push 0
push 0
push ecx
lea eax, [esp + 0x3c]
call fcn.004d24c0
push 0
mov eax, edi
mov edi, esi
push 0
mov ecx, ebx
lea esi, [esp + 0x54]
call fcn.004d3380
cmp dword [esp + 0x18], 0
jne 0x58d62f
mov edx, dword [esp + 0x38]
cmp edx, dword [esp + 0x24]
jae 0x58d76b
mov edx, dword [esp + 0x60]
mov edi, dword [esp + 0x4c]
cmp edx, edi
jae 0x58d76b
lea edx, [esp + 0x24]
lea ecx, [esp + 0x1c]
call dword [esp + 0x44]
mov eax, dword [eax]
mov dword [esp + 0x10], eax
lea edx, [esp + 0x10]
lea ecx, [esp + 0x4c]
mov byte [esp + 0x13], 0xff
call dword [esp + 0x74]
mov esi, dword [esp + 0x38]
mov ebx, dword [esp + 0x24]
cmp esi, ebx
jae 0x58d5d3
mov eax, dword [esp + 0x3c]
mov ecx, dword [esp + 0x40]
add eax, dword [esp + 0x30]
add ecx, 1
add esi, 1
cmp ecx, dword [esp + 0x28]
mov dword [esp + 0x3c], eax
mov dword [esp + 0x40], ecx
mov dword [esp + 0x38], esi
jne 0x58d5d3
add eax, dword [esp + 0x2c]
mov dword [esp + 0x40], 0
mov dword [esp + 0x3c], eax
mov edx, dword [esp + 0x60]
mov edi, dword [esp + 0x4c]
cmp edx, edi
jae 0x58d613
mov eax, dword [esp + 0x64]
mov ecx, dword [esp + 0x68]
add eax, dword [esp + 0x58]
add ecx, 1
add edx, 1
cmp ecx, dword [esp + 0x50]
mov dword [esp + 0x64], eax
mov dword [esp + 0x68], ecx
mov dword [esp + 0x60], edx
jne 0x58d613
add eax, dword [esp + 0x54]
mov dword [esp + 0x68], 0
mov dword [esp + 0x64], eax
cmp esi, ebx
jb 0x58d568
mov edx, dword [esp + 0x14]
mov edi, dword [esp + 0x20]
mov ebx, dword [ebp + 0x10]
mov dword [esp + 0x14], edx
jmp 0x58d780
mov ecx, dword [ebp + 0x10]
mov edx, dword [ecx + 4]
mov eax, dword [esp + 0x38]
cmp eax, dword [esp + 0x24]
mov ebx, dword [edx + 4]
mov dword [esp + 0x1c], ebx
jae 0x58d76b
mov edx, dword [esp + 0x60]
mov edi, dword [esp + 0x4c]
cmp edx, edi
jae 0x58d76b
lea edx, [esp + 0x24]
lea ecx, [esp + 0x8c]
call dword [esp + 0x44]
mov esi, dword [eax]
mov ecx, esi
shr ecx, 0x18
cmp cl, 0xff
mov dword [esp + 0x10], esi
jae 0x58d6d7
or al, 0xff
sub al, cl
movzx ecx, cl
mov edx, esi
shr edx, 0x10
movzx edx, dl
imul edx, ecx
movzx ecx, byte [esp + 0x1e]
movzx esi, byte [esp + 0x13]
movzx eax, al
imul ecx, eax
add edx, ecx
sar edx, 8
mov byte [esp + 0x12], dl
movzx edx, byte [esp + 0x11]
imul edx, esi
movzx ecx, bh
imul ecx, eax
add edx, ecx
sar edx, 8
mov byte [esp + 0x11], dl
movzx edx, byte [esp + 0x10]
movzx ecx, bl
imul edx, esi
imul ecx, eax
add edx, ecx
sar edx, 8
mov byte [esp + 0x10], dl
mov byte [esp + 0x13], 0xff
lea edx, [esp + 0x10]
lea ecx, [esp + 0x4c]
call dword [esp + 0x74]
mov esi, dword [esp + 0x38]
cmp esi, dword [esp + 0x24]
jae 0x58d721
mov eax, dword [esp + 0x3c]
mov ecx, dword [esp + 0x40]
add eax, dword [esp + 0x30]
add ecx, 1
add esi, 1
cmp ecx, dword [esp + 0x28]
mov dword [esp + 0x3c], eax
mov dword [esp + 0x40], ecx
mov dword [esp + 0x38], esi
jne 0x58d721
add eax, dword [esp + 0x2c]
mov dword [esp + 0x40], 0
mov dword [esp + 0x3c], eax
mov edx, dword [esp + 0x60]
mov edi, dword [esp + 0x4c]
cmp edx, edi
jae 0x58d761
mov eax, dword [esp + 0x64]
mov ecx, dword [esp + 0x68]
add eax, dword [esp + 0x58]
add ecx, 1
add edx, 1
cmp ecx, dword [esp + 0x50]
mov dword [esp + 0x64], eax
mov dword [esp + 0x68], ecx
mov dword [esp + 0x60], edx
jne 0x58d761
add eax, dword [esp + 0x54]
mov dword [esp + 0x68], 0
mov dword [esp + 0x64], eax
cmp esi, dword [esp + 0x24]
jb 0x58d652
mov edx, dword [esp + 0x14]
mov edi, dword [esp + 0x20]
mov ebx, dword [ebp + 0x10]
mov dword [esp + 0x14], edx
jmp 0x58d780
mov dword [esp + 0x14], ecx
xor eax, eax
mov dword [esp + 0x7c], eax
mov dword [esp + 0x80], eax
mov word [esp + 0x84], ax
lea eax, [esp + 0x1c]
push eax
lea eax, [esp + 0x80]
mov esi, ebx
call fcn.005bd510
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x58d7d8
test edi, edi
mov esi, dword [ebp + 8]
mov dword [esi], eax
je 0x58d925
mov ecx, edi
call fcn.004d0c50
push edi
call fcn.0069d0cc
add esp, 4
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov ecx, dword [esp + 0x14]
mov edx, dword [ebx + 8]
mov esi, dword [esp + 0x18]
lea eax, [esp + 0x7c]
mov dword [esp + 0x7c], ecx
mov ecx, dword [ebp + 0xc]
push eax
mov dword [esp + 0x88], edx
push ecx
lea edx, [esp + 0x94]
push edx
mov dword [esp + 0x8c], esi
mov dword [esp + 0x94], 0
call fcn.005bd5e0
mov eax, dword [eax]
test eax, eax
jne 0x58d7b0
test edi, edi
je 0x58d830
mov ecx, edi
call fcn.004d0c50
push edi
call fcn.0069d0cc
add esp, 4
test esi, esi
mov dword [esp + 0x20], 0
jne 0x58d850
mov eax, dword [esp + 0x88]
lea ecx, [eax*4 + 0x8a]
mov dword [esp + 0x14], ecx
jmp 0x58d862
mov edx, dword [esp + 0x88]
lea eax, [edx*4 + 0x36]
mov dword [esp + 0x14], eax
mov ecx, dword [ebx + 8]
add ecx, 0x10
push ecx
call fcn.0048b230
mov edx, dword [ebx + 8]
mov esi, dword [sym.imp.KERNEL32.dll_SetFilePointerEx]
xor ecx, ecx
push ecx
push ecx
mov edi, eax
push ecx
mov eax, 2
push eax
mov eax, dword [edx + 0x10]
push eax
call esi
mov eax, dword [ebx + 8]
push 0
lea ecx, [esp + 0x1c]
push ecx
push 4
lea edx, [esp + 0x28]
mov dword [esp + 0x28], edi
mov ecx, dword [eax + 0x10]
push edx
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, 4
cmp dword [esp + 0x18], eax
je 0x58d8c6
mov eax, dword [ebp + 8]
mov dword [eax], 2
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov edx, dword [ebx + 8]
push 1
xor ecx, ecx
push ecx
push ecx
push eax
mov eax, dword [edx + 0x10]
push eax
call esi
mov ecx, dword [esp + 0x14]
mov edx, dword [ebx + 8]
push ecx
call fcn.0057ab90
test al, al
jne 0x58d904
mov esi, dword [ebp + 8]
lea eax, [esp + 0x20]
mov dword [esi], 2
call fcn.0056cf30
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov edx, dword [ebx + 8]
xor eax, eax
push eax
push eax
push eax
mov eax, dword [edx + 0x10]
push edi
push eax
call esi
mov esi, dword [ebp + 8]
lea eax, [esp + 0x20]
mov dword [esi], 0
call fcn.0056cf30
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc