Function at 0x419366
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 0x4195ad
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
cmp esi, edi
je 0x419595
push esi
call fcn.004d4f20
pop ecx
mov dword [ebp - 4], eax
test eax, eax
je 0x419595
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 0x419595
cmp esi, dword [ebp - 8]
jne 0x419595
mov eax, dword [ebp - 4]
cmp word [eax], 0
jne 0x419595
cmp word [eax + 2], 1
jne 0x419595
movzx eax, word [eax + 4]
test ax, ax
je 0x419595
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 0x419444
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 0x41943e
inc dword [ebp - 0x14]
add ecx, 0x10
cmp dword [ebp - 0x14], eax
jb 0x419422
jmp 0x419444
mov ecx, dword [ebp - 8]
mov dword [ebp - 0xc], ecx
mov ecx, dword [ebp - 0xc]
add ecx, 6
cmp ecx, dword [ebp - 8]
ja 0x419595
lea ecx, [eax - 1]
test ecx, ecx
jl 0x419595
mov eax, ecx
shl eax, 4
add eax, esi
mov dl, byte [eax]
cmp dl, 0x10
jne 0x419471
cmp byte [eax + 1], dl
je 0x419487
cmp dl, 0x20
jne 0x41947d
cmp byte [eax + 1], dl
jne 0x41947d
mov edi, ecx
dec ecx
sub eax, 0x10
test ecx, ecx
jge 0x419465
jmp 0x419489
mov edi, ecx
cmp edi, 0xffffffff
je 0x419595
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 0x419513
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 0x4194f4
mov byte [esi + 2], 0
jmp 0x4194fb
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.004dbd40
add esp, 0xc
jmp 0x419515
xor esi, esi
mov edi, dword [ebp - 0xc]
add edi, 0x16
cmp dword [ebp - 8], edi
je 0x41954b
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 0x419552
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 0x419595
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 0x419595
cmp word [ebx + 0xe], 0x10
je 0x419595
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 0x4195ad
push dword [ebp - 4]
call fcn.004d5a72
pop ecx
mov eax, dword [ebp - 0x18]
pop edi
pop esi
pop ebx
leave
ret