Function at 0x404730
Capabilities:
Check if file exists
Delete file
Write file on windows

Disassembly:
sub esp, 0xa40
mov eax, dword [0x4713c0]
xor eax, esp
mov dword [esp + 0xa3c], eax
mov eax, dword [esp + 0xa44]
push ebx
mov dword [esp + 0x1c], ecx
mov ecx, dword [esp + 0xa50]
xor ebx, ebx
push ebp
mov dword [esp + 0x38], eax
mov eax, dword [esp + 0xa50]
mov dword [esp + 0x3c], ecx
xor ecx, ecx
cmp dword [eax + 0x18], ebx
push esi
push edi
mov dword [esp + 0x20], eax
mov dword [esp + 0x38], edx
mov dword [esp + 0x2c], 0xffffffff
mov dword [esp + 0x18], ebx
mov dword [esp + 0x3c], ebx
mov dword [0x473f98], ebx
mov dword [0x473f9c], ebx
mov dword [esp + 0x24], ecx
jbe 0x404c47
mov dword [esp + 0x1c], ebx
mov ebp, dword [eax + 0x1c]
add ebp, dword [esp + 0x1c]
cmp byte [ebp + 0x1a], bl
jne 0x404a4f
mov edx, dword [esp + 0x38]
push edx
mov edx, dword [esp + 0x2c]
push edx
lea edx, [esp + 0x3c]
push edx
lea edx, [esp + 0x3c]
push edx
lea edx, [esp + 0x4c]
push edx
lea edx, [esp + 0x2c]
push edx
lea edx, [esp + 0x44]
push edx
push ecx
mov ecx, dword [esp + 0x60]
push ecx
call fcn.004017a0
add esp, 0x24
cmp eax, ebx
mov dword [esp + 0x14], eax
jne 0x404a6d
push 0x1fe
lea edx, [esp + 0x84e]
push ebx
push edx
mov word [esp + 0x854], bx
call fcn.00446fa0
add esp, 0xc
push 0x1fe
lea eax, [esp + 0x44e]
push ebx
push eax
mov word [esp + 0x454], bx
call fcn.00446fa0
add esp, 0xc
push 0x1fe
lea ecx, [esp + 0x64e]
push ebx
push ecx
mov word [esp + 0x654], bx
call fcn.00446fa0
mov ecx, dword [ebp + 0x14]
mov eax, ecx
add esp, 0xc
lea esi, [eax + 1]
mov dl, byte [eax]
add eax, 1
cmp dl, bl
jne 0x404851
push 0xff
lea edx, [esp + 0x84c]
push edx
sub eax, esi
push eax
push ecx
push ebx
push ebx
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov ecx, dword [esp + 0x44]
lea eax, [esp + 0x848]
push eax
push ecx
push 0x461b58
push 0x200
lea edx, [esp + 0x458]
push 0x100
push edx
call fcn.004415ac
lea eax, [esp + 0x460]
push eax
push str._path____s__r_n
lea ecx, [esp + 0x68]
push 0x200
push ecx
call fcn.004414db
mov edx, dword [0x474bb0]
add esp, 0x28
cmp edx, ebx
mov word [esp + 0x446], bx
je 0x404903
lea eax, [esp + 0x48]
lea esi, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x4048d4
sub eax, esi
push edx
sar eax, 1
lea edx, [eax + eax]
push edx
lea eax, [esp + 0x50]
push 1
push eax
call fcn.004422ed
mov ecx, dword [0x474bb0]
push ecx
call fcn.004428a9
add esp, 0x14
cmp byte [ebp + 0x1a], bl
lea edx, [esp + 0x448]
je 0x404912
push edx
jmp 0x404921
lea edi, [esp + 0x648]
call fcn.00404160
mov eax, edi
push eax
call fcn.004041d0
add esp, 4
cmp eax, ebx
je 0x404ad4
lea ecx, [esp + 0x448]
push ecx
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x404951
lea edx, [esp + 0x448]
push edx
call dword [sym.imp.KERNEL32.dll_DeleteFileW]
push ebx
push 0x80
push 2
push ebx
push 1
push 0x40000000
lea eax, [esp + 0x460]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
je 0x404b20
mov edx, dword [esp + 0x18]
mov ecx, dword [esp + 0x30]
mov edi, dword [esp + 0x34]
add ecx, edx
push esi
mov eax, edi
call fcn.00404030
add esp, 4
cmp eax, edi
jne 0x404b7f
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x404bdb
mov ecx, dword [ebp + 8]
mov eax, dword [0x473f98]
mov edx, dword [ebp + 0xc]
add eax, ecx
mov ecx, dword [0x473f9c]
adc ecx, edx
push ecx
push eax
push str._m_nCompleteSize____d_r_n
mov dword [0x473f98], eax
lea eax, [esp + 0x54]
push 0x200
push eax
mov dword [0x473f9c], ecx
call fcn.004414db
mov edx, dword [0x474bb0]
add esp, 0x14
cmp edx, ebx
mov word [esp + 0x446], bx
je 0x404a2e
lea eax, [esp + 0x48]
lea esi, [eax + 2]
lea esp, [esp]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x404a00
sub eax, esi
push edx
sar eax, 1
lea ecx, [eax + eax]
push ecx
lea edx, [esp + 0x50]
push 1
push edx
call fcn.004422ed
mov eax, dword [0x474bb0]
push eax
call fcn.004428a9
add esp, 0x14
mov eax, dword [0x473f8c]
cmp eax, ebx
je 0x404a4b
mov ecx, dword [0x473f98]
mov edx, dword [0x473f90]
push ebx
push ecx
push edx
call eax
add esp, 0xc
mov eax, dword [esp + 0x20]
mov ecx, dword [esp + 0x24]
add dword [esp + 0x1c], 0x20
add ecx, 1
cmp ecx, dword [eax + 0x18]
mov dword [esp + 0x24], ecx
jb 0x4047a2
jmp 0x404c47
push str._ExtractFile_:SzExtract_ERROR_r_n
lea eax, [esp + 0x4c]
push 0x200
push eax
call fcn.004414db
mov esi, dword [0x474bb0]
add esp, 0xc
cmp esi, ebx
mov word [esp + 0x446], bx
je 0x404c47
lea eax, [esp + 0x48]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x404aa1
sub eax, edx
sar eax, 1
push esi
lea ecx, [eax + eax]
push ecx
lea edx, [esp + 0x50]
push 1
push edx
call fcn.004422ed
mov eax, dword [0x474bb0]
push eax
call fcn.004428a9
add esp, 0x14
jmp 0x404c47
push str._ExtractFile_:
lea ecx, [esp + 0x4c]
push 0x200
push ecx
call fcn.004414db
mov esi, dword [0x474bb0]
add esp, 0xc
cmp esi, ebx
mov word [esp + 0x446], bx
je 0x404c3f
lea eax, [esp + 0x48]
lea edx, [eax + 2]
jmp 0x404b10
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x404b10
jmp 0x404c1b
push 0x461bb8
lea edx, [esp + 0x4c]
push 0x200
push edx
call fcn.004414db
mov esi, dword [0x474bb0]
add esp, 0xc
cmp esi, ebx
mov word [esp + 0x446], bx
je 0x404c3f
lea eax, [esp + 0x48]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x404b54
sub eax, edx
sar eax, 1
push esi
add eax, eax
push eax
lea ecx, [esp + 0x50]
push 1
push ecx
call fcn.004422ed
mov edx, dword [0x474bb0]
push edx
jmp 0x404c37
push str._ExtractFile_:can_not_write_output_file_r_n
lea eax, [esp + 0x4c]
push 0x200
push eax
call fcn.004414db
mov esi, dword [0x474bb0]
add esp, 0xc
cmp esi, ebx
mov word [esp + 0x446], bx
je 0x404c3f
lea eax, [esp + 0x48]
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x404bb3
sub eax, edx
sar eax, 1
push esi
lea ecx, [eax + eax]
push ecx
lea edx, [esp + 0x50]
push 1
push edx
call fcn.004422ed
mov eax, dword [0x474bb0]
push eax
jmp 0x404c37
push str._ExtractFile_:can_not_close_output_file_r_n
lea ecx, [esp + 0x4c]
push 0x200
push ecx
call fcn.004414db
mov esi, dword [0x474bb0]
add esp, 0xc
cmp esi, ebx
mov word [esp + 0x446], bx
je 0x404c3f
lea eax, [esp + 0x48]
lea edx, [eax + 2]
jmp 0x404c10
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x404c10
sub eax, edx
sar eax, 1
push esi
lea edx, [eax + eax]
push edx
lea eax, [esp + 0x50]
push 1
push eax
call fcn.004422ed
mov ecx, dword [0x474bb0]
push ecx
call fcn.004428a9
add esp, 0x14
mov dword [esp + 0x14], 0x80004005
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x28]
mov ecx, dword [eax + 4]
push edx
call ecx
mov ecx, dword [esp + 0xa50]
mov eax, dword [esp + 0x18]
add esp, 4
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.004414cc
add esp, 0xa40
ret