Function at 0x49a93c
Capabilities:
Get file size
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
push ebx
push esi
push edi
xor esi, esi
push esi
push 0x80
push 3
push esi
push esi
push 0xc0000000
push dword [ebp + 8]
or edi, 0xffffffff
mov dword [ebp - 4], esi
mov dword [ebp - 0x18], esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
mov dword [ebp - 0x10], ebx
cmp ebx, edi
je 0x49ab83
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
cmp esi, edi
je 0x49ab6b
push esi
call fcn.0052f69b
pop ecx
mov dword [ebp - 4], eax
test eax, eax
je 0x49ab6b
push 0
lea eax, [ebp - 8]
push eax
push esi
push dword [ebp - 4]
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x49ab6b
cmp esi, dword [ebp - 8]
jne 0x49ab6b
mov eax, dword [ebp - 4]
cmp word [eax], 0
jne 0x49ab6b
cmp word [eax + 2], 1
jne 0x49ab6b
movzx eax, word [eax + 4]
test ax, ax
je 0x49ab6b
mov esi, dword [ebp - 4]
and dword [ebp - 0xc], 0
and dword [ebp - 0x14], 0
movzx eax, ax
add esi, 6
test eax, eax
jbe 0x49aa1a
lea ecx, [esi + 8]
mov edx, dword [ecx]
mov ebx, dword [ecx + 4]
add dword [ebp - 0xc], edx
add ebx, edx
cmp ebx, dword [ebp - 8]
ja 0x49aa14
inc dword [ebp - 0x14]
add ecx, 0x10
cmp dword [ebp - 0x14], eax
jb 0x49a9f8
jmp 0x49aa1a
mov ecx, dword [ebp - 8]
mov dword [ebp - 0xc], ecx
mov ecx, dword [ebp - 0xc]
add ecx, 6
cmp ecx, dword [ebp - 8]
ja 0x49ab6b
lea ecx, [eax - 1]
test ecx, ecx
jl 0x49ab6b
mov eax, ecx
shl eax, 4
add eax, esi
mov dl, byte [eax]
cmp dl, 0x10
jne 0x49aa47
cmp byte [eax + 1], dl
je 0x49aa5d
cmp dl, 0x20
jne 0x49aa53
cmp byte [eax + 1], dl
jne 0x49aa53
mov edi, ecx
dec ecx
sub eax, 0x10
test ecx, ecx
jge 0x49aa3b
jmp 0x49aa5f
mov edi, ecx
cmp edi, 0xffffffff
je 0x49ab6b
mov ecx, dword [ebp - 4]
shl edi, 4
lea eax, [edi + esi]
mov edi, dword [eax + 0xc]
mov eax, dword [eax + 8]
add edi, ecx
lea ebx, [ecx + 0x16]
mov dword [ebp - 0xc], eax
cmp ebx, edi
je 0x49aae9
xor eax, eax
inc eax
mov word [ecx + 4], ax
mov dword [esi + 0xc], 0x16
mov al, byte [edi + 4]
mov byte [esi], al
mov eax, dword [edi + 8]
cdq
sub eax, edx
sar eax, 1
mov byte [esi + 1], al
mov byte [esi + 3], 0
mov ax, word [edi + 0xc]
mov word [esi + 4], ax
movzx eax, word [edi + 0xe]
movzx ecx, ax
mov word [esi + 6], ax
movzx eax, word [esi + 4]
imul ecx, eax
cmp ecx, 8
jl 0x49aaca
mov byte [esi + 2], 0
jmp 0x49aad1
mov al, 1
shl al, cl
mov byte [esi + 2], al
mov eax, dword [ebp - 0xc]
push eax
mov dword [esi + 8], eax
push edi
xor esi, esi
push ebx
mov dword [edi + 0x14], esi
call fcn.00537090
add esp, 0xc
jmp 0x49aaeb
xor esi, esi
mov edi, dword [ebp - 0xc]
add edi, 0x16
cmp dword [ebp - 8], edi
je 0x49ab21
push esi
push esi
push esi
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push esi
lea eax, [ebp - 8]
push eax
push edi
push dword [ebp - 4]
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x49ab28
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov dword [ebp - 0x18], 1
mov edi, dword [ebp + 0xc]
cmp edi, esi
je 0x49ab6b
mov eax, dword [ebx + 8]
cdq
push 0
sub eax, edx
sar eax, 1
push eax
push dword [ebx + 4]
mov esi, 0x30000
push esi
push 1
push dword [ebp - 0xc]
push ebx
call dword [sym.imp.USER32.dll_CreateIconFromResourceEx]
mov dword [edi], eax
test eax, eax
jne 0x49ab6b
cmp word [ebx + 0xe], 0x10
je 0x49ab6b
push esi
push 1
push dword [ebp - 0xc]
push ebx
call dword [sym.imp.USER32.dll_CreateIconFromResource]
mov dword [edi], eax
push dword [ebp - 0x10]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 4], 0
je 0x49ab83
push dword [ebp - 4]
call fcn.00530cbd
pop ecx
mov eax, dword [ebp - 0x18]
pop edi
pop esi
pop ebx
leave
ret