Function at 0x4058e0
Capabilities:
Delete file
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4431c7
mov eax, dword fs:[0]
push eax
sub esp, 0x4b0
mov eax, dword [0x459054]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov ebx, ecx
mov dword [ebp - 0x4bc], ebx
push 0x105
lea eax, [ebp - 0x220]
push 0
push eax
call fcn.00427f80
add esp, 0xc
lea eax, [ebp - 0x220]
push 0x104
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea eax, [ebp - 0x220]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecA]
mov esi, dword [ebx + 0x264]
cmp esi, dword [ebx + 0x268]
je 0x405ce5
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
nop word [eax + eax]
mov eax, dword [esi + 0x10]
sub eax, 2
je 0x405a6f
sub eax, 3
jne 0x405cd0
cmp dword [esi + 0x58], 0x10
lea eax, [esi + 0x44]
jb 0x405990
mov eax, dword [eax]
push eax
lea eax, [ebp - 0x26c]
push eax
call fcn.0040ccc0
cmp dword [ebp - 0x258], 0x10
lea eax, [ebp - 0x26c]
push 1
cmovae eax, dword [ebp - 0x26c]
push eax
lea eax, [ebp - 0x220]
mov dword [ebp - 4], 4
push eax
call fcn.0040c820
push 0x105
lea eax, [ebp - 0x118]
push 0
push eax
call fcn.00427f80
lea eax, [ebp - 0x220]
push eax
lea eax, [ebp - 0x118]
push 0x105
push eax
call fcn.0042b761
add esp, 0x2c
lea eax, [ebp - 0x118]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashA]
cmp dword [ebp - 0x258], 0x10
lea eax, [ebp - 0x26c]
cmovae eax, dword [ebp - 0x26c]
push eax
lea eax, [ebp - 0x118]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendA]
lea eax, [ebp - 0x118]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
test eax, eax
jne 0x405a41
call ebx
mov dword [esi + 4], 0x1a
mov dword [esi + 8], eax
mov eax, dword [ebp - 0x258]
mov dword [ebp - 4], 0xffffffff
cmp eax, 0x10
jb 0x405cd0
inc eax
lea ecx, [ebp - 0x26c]
push eax
push dword [ebp - 0x26c]
call fcn.00410c60
jmp 0x405cd0
cmp dword [esi + 0x6c], 0
je 0x40607e
cmp dword [esi + 0x54], 0
je 0x40607e
mov dword [ebp - 0x240], 0xf
mov dword [ebp - 0x244], 0
mov byte [ebp - 0x254], 0
mov dword [ebp - 4], 0
xor ebx, ebx
cmp dword [esi + 0x70], 0x10
jb 0x405ab2
mov eax, dword [esi + 0x5c]
jmp 0x405ab5
lea eax, [esi + 0x5c]
lea ecx, [ebp - 0x254]
push ecx
push eax
call fcn.0040b240
add esp, 8
test eax, eax
jne 0x405ad9
inc ebx
cmp ebx, 3
jl 0x405aa7
mov dword [esi + 4], 0x15
mov dword [esi + 8], eax
mov dword [ebp - 0x224], 0xf
mov dword [ebp - 0x228], 0
mov byte [ebp - 0x238], 0
mov edi, dword [ebp - 0x244]
mov byte [ebp - 4], 1
test edi, edi
je 0x406091
mov ecx, dword [ebp - 0x240]
lea eax, [ebp - 0x254]
mov edx, dword [ebp - 0x254]
cmp ecx, 0x10
cmovae eax, edx
cmp byte [eax], 0x50
jne 0x405d01
cmp edi, 1
jbe 0x406091
cmp ecx, 0x10
lea eax, [ebp - 0x254]
cmovae eax, edx
cmp byte [eax + 1], 0x4b
jne 0x405d01
cmp ecx, 0x10
lea eax, [ebp - 0x254]
push 0
cmovae eax, edx
push edi
push eax
call fcn.00420c40
add esp, 0xc
mov dword [ebp - 0x4b8], eax
test eax, eax
je 0x405c5e
push 0x230
xor ebx, ebx
lea eax, [ebp - 0x4b4]
push ebx
xor edi, edi
push eax
mov dword [ebp - 0x23c], edi
call fcn.00427f80
lea eax, [ebp - 0x4b4]
push eax
push ebx
push dword [ebp - 0x4b8]
call fcn.00420b00
add esp, 0x18
test eax, eax
jne 0x405c3b
mov edi, dword [ebp - 0x288]
push edi
call fcn.00424ed6
push edi
mov ebx, eax
push 0
push ebx
call fcn.00427f80
push edi
push ebx
push 0
push dword [ebp - 0x4b8]
call fcn.004211b0
add esp, 0x20
test eax, eax
jne 0x405c35
mov ecx, dword [ebp - 0x228]
cmp edi, ecx
ja 0x405bfd
cmp dword [ebp - 0x224], 0x10
lea eax, [ebp - 0x238]
mov dword [ebp - 0x228], edi
cmovae eax, dword [ebp - 0x238]
mov byte [eax + edi], 0
jmp 0x405c0f
mov eax, edi
sub eax, ecx
lea ecx, [ebp - 0x238]
push 0
push eax
call fcn.004083b0
cmp dword [ebp - 0x224], 0x10
lea eax, [ebp - 0x238]
push edi
cmovae eax, dword [ebp - 0x238]
push ebx
push eax
call fcn.00427a00
add esp, 0xc
mov edi, 1
jmp 0x405c3b
mov edi, dword [ebp - 0x23c]
push dword [ebp - 0x4b8]
call fcn.00420310
add esp, 4
test ebx, ebx
je 0x405c56
push ebx
call fcn.00424edf
add esp, 4
test edi, edi
jne 0x405d4b
mov dword [esi + 4], 0x17
mov dword [esi + 8], 0
mov eax, dword [ebp - 0x224]
cmp eax, 0x10
jb 0x405c8a
inc eax
lea ecx, [ebp - 0x238]
push eax
push dword [ebp - 0x238]
call fcn.00410c60
mov eax, dword [ebp - 0x240]
mov dword [ebp - 0x224], 0xf
mov dword [ebp - 0x228], 0
mov byte [ebp - 0x238], 0
mov dword [ebp - 4], 0xffffffff
cmp eax, 0x10
jb 0x405cca
inc eax
lea ecx, [ebp - 0x254]
push eax
push dword [ebp - 0x254]
call fcn.00410c60
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
mov eax, dword [ebp - 0x4bc]
add esi, 0x74
cmp esi, dword [eax + 0x268]
jne 0x405970
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.00424ea2
mov esp, ebp
pop ebp
ret
cmp ecx, 0x10
lea eax, [ebp - 0x254]
cmovae eax, edx
cmp byte [eax], 0x4d
jne 0x405fb9
cmp edi, 1
jbe 0x406091
cmp ecx, 0x10
lea eax, [ebp - 0x254]
cmovae eax, edx
cmp byte [eax + 1], 0x5a
jne 0x405fb9
push 0xffffffffffffffff
push 0
lea eax, [ebp - 0x254]
push eax
lea ecx, [ebp - 0x238]
call fcn.00408460
mov dword [ebp - 0x258], 0xf
mov dword [ebp - 0x25c], 0
mov byte [ebp - 0x26c], 0
cmp dword [ebp - 0x224], 0x10
lea ecx, [ebp - 0x26c]
push ecx
push dword [ebp - 0x228]
lea eax, [ebp - 0x238]
mov byte [ebp - 4], 2
cmovae eax, dword [ebp - 0x238]
push eax
call fcn.0040ba70
add esp, 0xc
lea ecx, [ebp - 0x26c]
cmp dword [ebp - 0x258], 0x10
lea eax, [esi + 0x14]
cmovae ecx, dword [ebp - 0x26c]
cmp dword [eax + 0x14], 0x10
jb 0x405db3
mov eax, dword [eax]
push ecx
push eax
call fcn.0042b879
add esp, 8
test eax, eax
je 0x405e5c
mov dword [esi + 4], 0x16
mov dword [esi + 8], 0
mov eax, dword [ebp - 0x258]
cmp eax, 0x10
jb 0x405df1
inc eax
lea ecx, [ebp - 0x26c]
push eax
push dword [ebp - 0x26c]
call fcn.00410c60
mov eax, dword [ebp - 0x224]
mov dword [ebp - 0x258], 0xf
mov dword [ebp - 0x25c], 0
mov byte [ebp - 0x26c], 0
cmp eax, 0x10
jb 0x405e2a
inc eax
lea ecx, [ebp - 0x238]
push eax
push dword [ebp - 0x238]
call fcn.00410c60
lea ecx, [ebp - 0x254]
mov dword [ebp - 0x224], 0xf
mov dword [ebp - 0x228], 0
mov byte [ebp - 0x238], 0
mov dword [ebp - 4], 0xffffffff
call fcn.00404a40
jmp 0x405cca
cmp dword [esi + 0x58], 0x10
lea eax, [esi + 0x44]
jb 0x405e67
mov eax, dword [eax]
push eax
lea eax, [ebp - 0x284]
push eax
call fcn.0040ccc0
cmp dword [ebp - 0x270], 0x10
lea eax, [ebp - 0x284]
push 1
cmovae eax, dword [ebp - 0x284]
push eax
lea eax, [ebp - 0x220]
mov byte [ebp - 4], 3
push eax
call fcn.0040c820
push 0x105
lea eax, [ebp - 0x118]
push 0
push eax
call fcn.00427f80
lea eax, [ebp - 0x220]
push eax
lea eax, [ebp - 0x118]
push 0x105
push eax
call fcn.0042b761
add esp, 0x2c
lea eax, [ebp - 0x118]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAddBackslashA]
cmp dword [ebp - 0x270], 0x10
lea eax, [ebp - 0x284]
cmovae eax, dword [ebp - 0x284]
push eax
lea eax, [ebp - 0x118]
push eax
call dword [sym.imp.SHLWAPI.dll_PathAppendA]
lea eax, [ebp - 0x118]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
push 0
push 0x80
push 2
push 0
push 0
push 0xc0000000
lea eax, [ebp - 0x118]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
je 0x405f6f
cmp dword [ebp - 0x224], 0x10
lea eax, [ebp - 0x23c]
push 0
push eax
push dword [ebp - 0x228]
lea ecx, [ebp - 0x238]
mov dword [ebp - 0x23c], 0
cmovae ecx, dword [ebp - 0x238]
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x405f81
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
call ebx
mov dword [esi + 4], 0x19
mov dword [esi + 8], eax
lea ecx, [ebp - 0x284]
call fcn.00404a40
lea ecx, [ebp - 0x26c]
call fcn.00404a40
lea ecx, [ebp - 0x238]
call fcn.00404a40
lea ecx, [ebp - 0x254]
mov dword [ebp - 4], 0xffffffff
call fcn.00404a40
jmp 0x405cd0
mov dword [esi + 4], 0x18
mov dword [esi + 8], 0
mov eax, dword [ebp - 0x224]
mov byte [ebp - 4], 0
cmp eax, 0x10
jb 0x406017
mov ecx, dword [ebp - 0x238]
inc eax
cmp eax, 0x1000
jb 0x40600e
test cl, 0x1f
jne 0x40609b
mov eax, dword [ecx - 4]
cmp eax, ecx
jae 0x40609b
sub ecx, eax
cmp ecx, 4
jb 0x40609b
cmp ecx, 0x23
ja 0x40609b
mov ecx, eax
push ecx
call fcn.004249eb
add esp, 4
mov eax, dword [ebp - 0x240]
mov dword [ebp - 0x224], 0xf
mov dword [ebp - 0x228], 0
mov byte [ebp - 0x238], 0
mov dword [ebp - 4], 0xffffffff
cmp eax, 0x10
jb 0x405cca
mov ecx, dword [ebp - 0x254]
inc eax
cmp eax, 0x1000
jb 0x406070
test cl, 0x1f
jne 0x40609b
mov eax, dword [ecx - 4]
cmp eax, ecx
jae 0x40609b
sub ecx, eax
cmp ecx, 4
jb 0x40609b
cmp ecx, 0x23
ja 0x40609b
mov ecx, eax
push ecx
call fcn.004249eb
add esp, 4
jmp 0x405cca
mov dword [esi + 4], 0x14
mov dword [esi + 8], 0
jmp 0x405cd0
push str.invalid_string_position
call fcn.00425f28
call fcn.0042b711
int3