Function at 0x479780
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30
push ebx
push esi
push edi
mov dword [ebp - 0x24], 0
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x1c], 0xffffffff
mov dword [ebp - 0x18], 0xffffffff
push 0x1000
call fcn.00472a54
add esp, 4
mov dword [ebp - 0xc], eax
cmp dword [ebp + 0xc], 0xffffffff
jne 0x479858
cmp dword [ebp + 8], 0
je 0x479858
mov eax, dword [ebp + 8]
movsx eax, byte [eax]
or eax, eax
je 0x479858
mov dword [ebp - 0x28], 0
jmp 0x4797e6
inc dword [ebp - 0x28]
cmp dword [ebp - 0x28], 0x32
jge 0x479858
push 0
push 0x8000000
push 3
push 0
push 1
push 0x80000000
push dword [ebp + 8]
call sub.KERNEL32.dll_CreateFileA
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0xffffffff
jne 0x479847
call sub.KERNEL32.dll_GetLastError
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0x20
je 0x479842
cmp dword [ebp - 4], 0x21
je 0x479842
cmp dword [ebp - 4], 5
je 0x479842
jmp 0x479858
jmp 0x479853
mov dword [ebp - 0x24], 1
jmp 0x479858
jmp 0x4797e3
cmp dword [ebp + 0xc], 0xffffffff
jne 0x479878
cmp dword [ebp - 0x1c], 0xffffffff
jne 0x479878
mov dword [ebp - 0x30], 1
jmp 0x479a5a
cmp dword [ebp + 0x14], 0xffffffff
jne 0x47991b
cmp dword [ebp + 0x10], 0
je 0x47991b
mov eax, dword [ebp + 0x10]
movsx eax, byte [eax]
or eax, eax
je 0x47991b
mov dword [ebp - 0x28], 0
jmp 0x4798a9
inc dword [ebp - 0x28]
cmp dword [ebp - 0x28], 0x32
jge 0x47991b
push 0
push 0x80000000
push 2
push 0
push 0
push 0x40000000
push dword [ebp + 0x10]
call sub.KERNEL32.dll_CreateFileA
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0xffffffff
jne 0x47990a
call sub.KERNEL32.dll_GetLastError
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0x20
je 0x479905
cmp dword [ebp - 4], 0x21
je 0x479905
cmp dword [ebp - 4], 5
je 0x479905
jmp 0x47991b
jmp 0x479916
mov dword [ebp - 0x20], 1
jmp 0x47991b
jmp 0x4798a6
cmp dword [ebp + 0x14], 0xffffffff
jne 0x47993b
cmp dword [ebp - 0x18], 0xffffffff
jne 0x47993b
mov dword [ebp - 0x30], 2
jmp 0x479a5a
cmp dword [ebp - 0x24], 0
je 0x479979
push 0
lea eax, [ebp - 8]
push eax
push 0x1000
push dword [ebp - 0xc]
push dword [ebp - 0x1c]
call sub.KERNEL32.dll_ReadFile
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jne 0x479974
mov dword [ebp - 0x30], 3
jmp 0x479a5a
jmp 0x4799a5
push 0x1000
push dword [ebp - 0xc]
push dword [ebp + 0xc]
call fcn.00482100
add esp, 0xc
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0xffffffff
jne 0x4799a5
mov dword [ebp - 0x30], 3
jmp 0x479a5a
cmp dword [ebp - 8], 0
jne 0x4799b4
jmp 0x479a53
cmp dword [ebp + 0x1c], 0
je 0x4799d0
push dword [ebp + 0x14]
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push dword [ebp + 8]
call dword [ebp + 0x1c]
add esp, 0x10
cmp dword [ebp - 0x20], 0
je 0x479a0c
push 0
lea eax, [ebp - 0x2c]
push eax
push dword [ebp - 8]
push dword [ebp - 0xc]
push dword [ebp - 0x18]
call sub.KERNEL32.dll_WriteFile
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jne 0x479a07
mov dword [ebp - 0x30], 4
jmp 0x479a5a
jmp 0x479a32
push dword [ebp - 8]
push dword [ebp - 0xc]
push dword [ebp + 0x14]
call fcn.00481ac0
add esp, 0xc
cmp eax, 0xffffffff
jne 0x479a32
mov dword [ebp - 0x30], 4
jmp 0x479a5a
cmp dword [ebp + 0x1c], 0
je 0x479a4e
push dword [ebp + 0x14]
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push dword [ebp + 8]
call dword [ebp + 0x1c]
add esp, 0x10
jmp 0x47993b
mov dword [ebp - 0x30], 0
cmp dword [ebp - 0x24], 0
je 0x479a76
cmp dword [ebp - 0x1c], 0xffffffff
je 0x479a76
push dword [ebp - 0x1c]
call sub.KERNEL32.dll_CloseHandle
cmp dword [ebp - 0x20], 0
je 0x479a92
cmp dword [ebp - 0x18], 0xffffffff
je 0x479a92
push dword [ebp - 0x18]
call sub.KERNEL32.dll_CloseHandle
push dword [ebp - 0xc]
call fcn.00472a0c
add esp, 4
mov eax, dword [ebp - 0x30]
mov ecx, dword [ebp + 0x18]
mov dword [ecx], eax
mov eax, dword [ebp - 0x30]
jmp 0x479aad
pop edi
pop esi
pop ebx
leave
ret