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

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffff40
xor ecx, ecx
mov dword [ebp - 0xc0], ecx
mov dword [ebp - 0xb8], ecx
mov dword [ebp - 0xbc], ecx
mov dword [ebp - 0xb0], ecx
mov dword [ebp - 0xb4], ecx
mov dword [ebp - 0x1c], ecx
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
call fcn.00403a94
mov eax, dword [ebp - 8]
call fcn.00403a94
xor eax, eax
push ebp
push 0x4178f2
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, 0x41eb54
mov edx, 0x417908
call fcn.00403780
mov byte [ebp - 9], 0
mov eax, dword [ebp - 4]
call fcn.004038a4
test eax, eax
je 0x4178b9
mov eax, dword [ebp - 8]
call fcn.004038a4
test eax, eax
je 0x4178b9
push 0
lea eax, [ebp - 0xac]
push eax
mov eax, dword [ebp - 4]
call fcn.00403aa4
push eax
call sub.kernel32.dll_OpenFile
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0xffffffff
jne 0x41755b
push 0x417930
push dword [ebp - 4]
push 0x417940
lea edx, [ebp - 0xb4]
xor eax, eax
call fcn.00406434
push dword [ebp - 0xb4]
lea eax, [ebp - 0xb0]
mov edx, 4
call fcn.00403964
mov eax, dword [ebp - 0xb0]
call fcn.00412764
jmp 0x4178b9
push 0
mov eax, dword [ebp - 0x10]
push eax
call sub.kernel32.dll_GetFileSize_1
add eax, 5
jae 0x417570
call fcn.00402f1c
mov dword [ebp - 0x14], eax
mov eax, 0x41eb54
mov edx, 0x41794c
call fcn.00403780
mov eax, dword [ebp - 0x14]
push eax
lea eax, [ebp - 0x1c]
in al, 0xb9
add dword [eax], eax
add byte [eax], al
mov edx, dword [0x417458]
call fcn.00404218
add esp, 4
xor eax, eax
mov edx, dword [ebp - 0x1c]
test edx, edx
je 0x4175aa
cmp eax, dword [edx - 4]
jb 0x4175af
call fcn.00402f14
lea eax, [edx + eax]
mov edx, 0x41d2e0
mov ecx, 5
call fcn.0040492c
push 0
lea eax, [ebp - 0x18]
push eax
mov eax, dword [ebp - 0x14]
sub eax, 5
jae 0x4175d4
call fcn.00402f1c
push eax
mov eax, 5
mov edx, dword [ebp - 0x1c]
test edx, edx
je 0x4175e6
cmp eax, dword [edx - 4]
jb 0x4175eb
call fcn.00402f14
lea eax, [edx + eax]
push eax
mov eax, dword [ebp - 0x10]
push eax
call sub.kernel32.dll_ReadFile_1
test eax, eax
jne 0x41763c
push 0x4179fc
push dword [ebp - 4]
push 0x417940
lea edx, [ebp - 0xbc]
xor eax, eax
call fcn.00406434
push dword [ebp - 0xbc]
lea eax, [ebp - 0xb8]
mov edx, 4
call fcn.00403964
mov eax, dword [ebp - 0xb8]
call fcn.00412764
jmp 0x4178b9
mov eax, dword [ebp - 0x10]
push eax
call sub.kernel32.dll_CloseHandle_1
cmp dword [ebp - 0x14], 0xa
jbe 0x41772c
mov eax, 5
mov edx, dword [ebp - 0x1c]
test edx, edx
je 0x417660
cmp eax, dword [edx - 4]
jb 0x417665
call fcn.00402f14
mov al, byte [edx + eax]
cmp al, byte [0x41d2e0]
jne 0x41772c
mov eax, 6
mov edx, dword [ebp - 0x1c]
test edx, edx
je 0x417685
cmp eax, dword [edx - 4]
jb 0x41768a
call fcn.00402f14
mov al, byte [edx + eax]
cmp al, byte [0x41d2e1]
jne 0x41772c
mov eax, 7
mov edx, dword [ebp - 0x1c]
test edx, edx
je 0x4176aa
cmp eax, dword [edx - 4]
jb 0x4176af
call fcn.00402f14
mov al, byte [edx + eax]
cmp al, byte [0x41d2e2]
jne 0x41772c
mov eax, 8
mov edx, dword [ebp - 0x1c]
test edx, edx
je 0x4176cb
cmp eax, dword [edx - 4]
jb 0x4176d0
call fcn.00402f14
mov al, byte [edx + eax]
cmp al, byte [0x41d2e3]
jne 0x41772c
mov eax, 9
mov edx, dword [ebp - 0x1c]
test edx, edx
je 0x4176ec
cmp eax, dword [edx - 4]
jb 0x4176f1
call fcn.00402f14
mov al, byte [edx + eax]
cmp al, byte [0x41d2e4]
jne 0x41772c
push 0x417a10
push dword [ebp - 4]
push 0x417a20
push dword [ebp - 8]
lea eax, [ebp - 0xc0]
mov edx, 4
call fcn.00403964
mov eax, dword [ebp - 0xc0]
call fcn.00412764
jmp 0x4178b9
mov eax, dword [ebp - 0x14]
sub eax, 1
jae 0x417739
call fcn.00402f1c
sub eax, 5
jb 0x417811
inc eax
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x18], 5
mov eax, dword [ebp - 0x18]
mov edx, dword [ebp - 0x1c]
test edx, edx
je 0x41775c
cmp eax, dword [edx - 4]
jb 0x417761
call fcn.00402f14
xor byte [edx + eax], 0xc2
mov eax, dword [ebp - 0x18]
mov edx, dword [ebp - 0x1c]
test edx, edx
je 0x417774
cmp eax, dword [edx - 4]
jb 0x417779
call fcn.00402f14
movzx eax, byte [edx + eax]
add eax, 0x79
jno 0x417787
call fcn.00402f1c
add eax, 0x8000
cmp eax, 0xffff
jbe 0x417798
call fcn.00402f14
add eax, 0xffff8000
mov word [ebp - 0x1e], ax
cmp word [ebp - 0x1e], 0xff
jle 0x4177dd
movsx eax, word [ebp - 0x1e]
sub eax, 0xff
jno 0x4177b9
call fcn.00402f1c
sub eax, 1
jno 0x4177c3
call fcn.00402f1c
add eax, 0x8000
cmp eax, 0xffff
jbe 0x4177d4
call fcn.00402f14
add eax, 0xffff8000
mov word [ebp - 0x1e], ax
mov eax, dword [ebp - 0x18]
mov edx, dword [ebp - 0x1c]
test edx, edx
je 0x4177ec
cmp eax, dword [edx - 4]
jb 0x4177f1
call fcn.00402f14
movsx ecx, word [ebp - 0x1e]
cmp ecx, 0xff
jbe 0x417802
call fcn.00402f14
mov byte [edx + eax], cl
inc dword [ebp - 0x18]
dec dword [ebp - 0x24]
jne 0x41774d
mov eax, dword [ebp - 8]
call fcn.004038a4
test eax, eax
jne 0x417828
lea eax, [ebp - 8]
mov edx, dword [ebp - 4]
call fcn.004037c4
mov eax, 0x41eb54
mov edx, 0x417a38
call fcn.00403780
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
mov eax, dword [ebp - 8]
call fcn.00403aa4
push eax
call sub.kernel32.dll_CreateFileA_1
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0xffffffff
je 0x4178b9
push 0
lea eax, [ebp - 0x18]
push eax
mov eax, dword [ebp - 0x14]
push eax
xor eax, eax
mov edx, dword [ebp - 0x1c]
test edx, edx
je 0x417878
cmp eax, dword [edx - 4]
jb 0x41787d
call fcn.00402f14
lea eax, [edx + eax]
push eax
mov eax, dword [ebp - 0x10]
push eax
call sub.kernel32.dll_WriteFile_1
test eax, eax
je 0x417892
mov byte [ebp - 9], 1
mov eax, 0x41eb54
mov edx, 0x417ab0
call fcn.00403780
mov eax, dword [ebp - 0x10]
push eax
call sub.kernel32.dll_CloseHandle_1
mov eax, 0x41eb54
mov edx, 0x417a38
call fcn.00403780
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x4178f9
lea eax, [ebp - 0xc0]
mov edx, 5
call fcn.00403750
lea eax, [ebp - 0x1c]
mov edx, dword [0x417458]
call fcn.00404224
lea eax, [ebp - 8]
mov edx, 2
call fcn.00403750
ret