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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x101bf59d
mov eax, dword fs:[0]
push eax
sub esp, 0x60
mov eax, dword [0x1024bdac]
xor eax, ebp
mov dword [ebp - 0x10], eax
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov dword [ebp - 0x54], ecx
mov ecx, dword [ebp + 8]
call fcn.10045be0
movzx eax, al
test eax, eax
je 0x1012cd31
xor eax, eax
jmp 0x1012cf94
mov ecx, dword [ebp + 8]
push ecx
mov ecx, dword [ebp - 0x54]
add ecx, 0x20
call fcn.10045e30
push 0
push 0x80
push 3
push 0
push 0
push connect
mov ecx, dword [ebp + 8]
call fcn.10045c30
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x30], eax
cmp dword [ebp - 0x30], 0xffffffff
jne 0x1012cd89
push 0
push str.N3TableBase___Cant_open_file_read__File_Handle_error_n
mov ecx, dword [ebp + 8]
call fcn.10045c30
push eax
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
xor eax, eax
jmp 0x1012cf94
push str..tmp
mov edx, dword [ebp + 8]
push edx
lea eax, [ebp - 0x2c]
push eax
call fcn.1004bd80
add esp, 0xc
mov dword [ebp - 4], 0
mov dword [ebp - 0x5c], 0
lea ecx, [ebp - 0x5c]
push ecx
mov edx, dword [ebp - 0x30]
push edx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x44], eax
cmp dword [ebp - 0x44], 0
ja 0x1012cdfc
mov eax, dword [ebp - 0x30]
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp - 0x2c]
call fcn.10045c30
push eax
call fcn.1017aee0
add esp, 4
mov dword [ebp - 0x60], 0
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x2c]
call fcn.10045ea0
mov eax, dword [ebp - 0x60]
jmp 0x1012cf94
mov ecx, dword [ebp - 0x44]
push ecx
call fcn.10041b20
add esp, 4
mov dword [ebp - 0x64], eax
mov edx, dword [ebp - 0x64]
mov dword [ebp - 0x3c], edx
mov dword [ebp - 0x50], 0
push 0
lea eax, [ebp - 0x50]
push eax
mov ecx, dword [ebp - 0x44]
push ecx
mov edx, dword [ebp - 0x3c]
push edx
mov eax, dword [ebp - 0x30]
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov ecx, dword [ebp - 0x30]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, 0x816
mov word [ebp - 0x38], dx
mov eax, 0x6081
mov word [ebp - 0x48], ax
mov ecx, 0x1608
mov word [ebp - 0x4c], cx
mov dword [ebp - 0x40], 0
jmp 0x1012ce67
mov edx, dword [ebp - 0x40]
add edx, 1
mov dword [ebp - 0x40], edx
mov eax, dword [ebp - 0x40]
cmp eax, dword [ebp - 0x44]
jae 0x1012ceb1
mov ecx, dword [ebp - 0x3c]
add ecx, dword [ebp - 0x40]
movzx edx, byte [ecx]
movzx eax, word [ebp - 0x38]
sar eax, 8
xor edx, eax
mov byte [ebp - 0x31], dl
mov ecx, dword [ebp - 0x3c]
add ecx, dword [ebp - 0x40]
movzx edx, byte [ecx]
movzx eax, word [ebp - 0x38]
add edx, eax
movzx ecx, word [ebp - 0x48]
imul edx, ecx
movzx eax, word [ebp - 0x4c]
add edx, eax
mov word [ebp - 0x38], dx
mov ecx, dword [ebp - 0x3c]
add ecx, dword [ebp - 0x40]
mov dl, byte [ebp - 0x31]
mov byte [ecx], dl
jmp 0x1012ce5e
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
lea ecx, [ebp - 0x2c]
call fcn.10045c30
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x30], eax
push 0
lea eax, [ebp - 0x50]
push eax
mov ecx, dword [ebp - 0x44]
push ecx
mov edx, dword [ebp - 0x3c]
push edx
mov eax, dword [ebp - 0x30]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [ebp - 0x30]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [ebp - 0x3c]
mov dword [ebp - 0x68], edx
mov eax, dword [ebp - 0x68]
push eax
call fcn.10154ec0
add esp, 4
mov dword [ebp - 0x3c], 0
push 0
push 0x80
push 3
push 0
push 0
push connect
lea ecx, [ebp - 0x2c]
call fcn.10045c30
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x30], eax
mov ecx, dword [ebp - 0x30]
push ecx
mov ecx, dword [ebp - 0x54]
call fcn.1012dc20
mov dword [ebp - 0x58], eax
mov edx, dword [ebp - 0x30]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x58], 0
jne 0x1012cf6b
push 0
push str.N3TableBase___incorrect_table_n
mov ecx, dword [ebp + 8]
call fcn.10045c30
push eax
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
lea ecx, [ebp - 0x2c]
call fcn.10045c30
push eax
call fcn.1017aee0
add esp, 4
mov eax, dword [ebp - 0x58]
mov dword [ebp - 0x6c], eax
mov dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x2c]
call fcn.10045ea0
mov eax, dword [ebp - 0x6c]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.10154eb0
mov esp, ebp
pop ebp
ret 4