Function at 0x404a80
Capabilities:
Clear file content
Get file size
Read file on windows
Write file on windows

Disassembly:
sub esp, 0x22c
mov eax, dword [0x603144]
xor eax, esp
mov dword [esp + 0x228], eax
mov eax, dword [esp + 0x230]
push ebx
mov ebx, dword [esp + 0x238]
push ebp
mov ebp, dword [esp + 0x240]
push esi
push edi
push 0x208
mov dword [esp + 0x24], eax
lea eax, [esp + 0x34]
push 0
push eax
mov dword [esp + 0x20], ebx
mov dword [esp + 0x34], ebp
call fcn.00574900
add esp, 0xc
lea eax, [esp + 0x30]
push 0x104
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea eax, [esp + 0x30]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov esi, 0x69
mov word [esp + eax*2 + 0x2e], si
lea eax, [esp + 0x30]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov ecx, 0x6e
mov word [esp + eax*2 + 0x2c], cx
lea eax, [esp + 0x30]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
push 0
push 0x80
push 4
push 0
push 1
mov word [esp + eax*2 + 0x3e], si
lea eax, [esp + 0x44]
push SysReAllocString
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
mov dword [esp + 0x18], esi
cmp esi, 0xffffffff
je 0x404f70
push 0
push esi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov edi, eax
mov dword [esp + 0x24], edi
test edi, edi
jne 0x404b7b
push ebp
call dword [sym.imp.KERNEL32.dll_lstrlenW]
push ebx
mov edi, eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
push dword [esp + 0x20]
add edi, eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
inc edi
add edi, eax
mov dword [esp + 0x24], edi
push 4
push 0x3000
push edi
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov dword [esp + 0x10], eax
test eax, eax
je 0x404f66
push 0
lea ecx, [esp + 0x30]
mov dword [esp + 0x30], 0
push ecx
push edi
push eax
push esi
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x404f66
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 4
push 0x3000
push edi
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov esi, eax
mov dword [esp + 0x1c], esi
test esi, esi
je 0x404f66
push 0
push 0
push 0xffffffffffffffff
push dword [esp + 0x1c]
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
push eax
push esi
push 0xffffffffffffffff
push dword [esp + 0x1c]
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
push 0x8000
push 0
push dword [esp + 0x18]
call dword [sym.imp.KERNEL32.dll_VirtualFree]
push dword [esp + 0x20]
push esi
call dword [sym.imp.SHLWAPI.dll_StrStrW]
mov dword [esp + 0x18], eax
test eax, eax
jne 0x404c76
push 4
push 0x3000
lea eax, [edi + 6]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
cmp word [esi], 0x5b
mov edi, eax
push ebp
push ebx
push dword [esp + 0x28]
push esi
jne 0x404c62
push str._s_r_n_s_r_n_s_s
push edi
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x18
jmp 0x404e78
push str._s_s_r_n_s_s
push edi
call dword [sym.imp.USER32.dll_wsprintfW]
add esp, 0x18
jmp 0x404e78
push ebx
push eax
call dword [sym.imp.SHLWAPI.dll_StrStrW]
test eax, eax
jne 0x404d7d
push 0x5aeb14
push dword [esp + 0x1c]
call dword [sym.imp.SHLWAPI.dll_StrStrW]
push 4
push 0x3000
mov ebx, eax
push ebp
mov dword [esp + 0x24], ebx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
push dword [esp + 0x1c]
mov esi, eax
call dword [sym.imp.KERNEL32.dll_lstrlenW]
add eax, 3
lea ecx, [edi + esi]
add ecx, eax
push ecx
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov ecx, dword [esp + 0x1c]
xor esi, esi
mov edi, eax
cmp ecx, ebx
jae 0x404ce1
mov ax, word [ecx]
add ecx, 2
mov word [edi + esi*2], ax
inc esi
cmp ecx, ebx
jb 0x404cd2
push dword [esp + 0x14]
mov dword [edi + esi*2], 0xa000d
xor ebx, ebx
add esi, 2
call dword [sym.imp.KERNEL32.dll_lstrlenW]
test eax, eax
je 0x404d1a
mov ebp, dword [esp + 0x14]
nop
mov ax, word [ebp + ebx*2]
inc ebx
mov word [edi + esi*2], ax
inc esi
push ebp
call dword [sym.imp.KERNEL32.dll_lstrlenW]
cmp ebx, eax
jb 0x404d00
mov ebp, dword [esp + 0x28]
push ebp
xor ebx, ebx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
test eax, eax
je 0x404d46
nop word [eax + eax]
mov ax, word [ebp + ebx*2]
inc ebx
mov word [edi + esi*2], ax
inc esi
push ebp
call dword [sym.imp.KERNEL32.dll_lstrlenW]
cmp ebx, eax
jb 0x404d30
mov ebp, dword [esp + 0x18]
xor ebx, ebx
push ebp
call dword [sym.imp.KERNEL32.dll_lstrlenW]
test eax, eax
je 0x404e74
lea esi, [edi + esi*2]
nop
mov ax, word [ebp + ebx*2]
lea esi, [esi + 2]
mov word [esi - 2], ax
inc ebx
push ebp
call dword [sym.imp.KERNEL32.dll_lstrlenW]
cmp ebx, eax
jb 0x404d60
jmp 0x404e74
push 0x5aeb18
push eax
call dword [sym.imp.SHLWAPI.dll_StrStrW]
xor edi, edi
mov dword [esp + 0x14], edi
lea ebx, [eax + 2]
movzx eax, word [ebx]
mov dword [esp + 0x10], ebx
cmp eax, 0xd
je 0x404dbc
mov ecx, eax
test cx, cx
je 0x404db4
movzx eax, word [ebx + 2]
add ebx, 2
inc edi
mov ecx, eax
cmp eax, 0xd
jne 0x404da0
mov dword [esp + 0x14], edi
mov dword [esp + 0x10], ebx
push ebp
call dword [sym.imp.KERNEL32.dll_lstrlenW]
mov esi, eax
mov eax, dword [esp + 0x24]
push 4
sub eax, edi
push 0x3000
add esi, eax
push esi
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
push esi
mov edi, eax
push 0
push edi
call fcn.00574900
mov eax, dword [esp + 0x28]
mov edx, ebx
sub edx, eax
add esp, 0xc
sar edx, 1
mov esi, 0
sub edx, dword [esp + 0x14]
je 0x404e24
mov ebp, eax
mov ecx, edi
sub ebp, edi
mov esi, edx
nop dword [eax + eax]
mov ax, word [ecx + ebp]
lea ecx, [ecx + 2]
mov word [ecx - 2], ax
sub edx, 1
jne 0x404e10
mov ebp, dword [esp + 0x28]
push ebp
call dword [sym.imp.KERNEL32.dll_lstrlenW]
test eax, eax
je 0x404e4b
xor ebx, ebx
mov ax, word [ebp + ebx*2]
inc ebx
mov word [edi + esi*2], ax
inc esi
push ebp
call dword [sym.imp.KERNEL32.dll_lstrlenW]
cmp ebx, eax
jb 0x404e31
mov ebx, dword [esp + 0x10]
push ebx
call dword [sym.imp.KERNEL32.dll_lstrlenW]
xor edx, edx
test eax, eax
je 0x404e6e
nop dword [eax + eax]
mov cx, word [ebx + edx*2]
inc edx
mov word [edi + esi*2], cx
inc esi
cmp edx, eax
jb 0x404e60
xor eax, eax
mov word [edi + esi*2], ax
mov esi, dword [esp + 0x1c]
push 0x8000
push 0
push esi
call dword [sym.imp.KERNEL32.dll_VirtualFree]
push 0
push 0
push 0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
push eax
push edi
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
push 4
push 0x3000
mov ebx, eax
push ebx
push 0
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
xor edx, edx
mov esi, eax
test ebx, ebx
je 0x404ecb
nop
mov cl, byte [edi + edx*2]
mov byte [edx + esi], cl
inc edx
cmp edx, ebx
jb 0x404ec0
push 0
push 0
push ebx
push esi
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenW]
push eax
push edi
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
push 0x8000
push 0
push edi
call dword [sym.imp.KERNEL32.dll_VirtualFree]
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
lea eax, [esp + 0x48]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
je 0x404f70
push edi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
push 0
lea eax, [esp + 0x30]
push eax
push ebx
push esi
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push edi
test eax, eax
jne 0x404f4b
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x8000
push 0
push esi
call dword [sym.imp.KERNEL32.dll_VirtualFree]
jmp 0x404f70
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push 0x8000
push 0
push esi
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov eax, 1
jmp 0x404f72
push dword [esp + 0x18]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
mov ecx, dword [esp + 0x238]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.00572cc2
add esp, 0x22c
ret