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

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x629ea8
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x44
mov eax, dword [0x6cc708]
push ebx
push esi
push edi
mov esi, ecx
mov dword [ebp - 0x10], esp
mov dword [ebp - 0x30], esi
mov dword [ebp - 4], 0
mov dword [ebp - 0x14], eax
mov edi, dword [ebp + 0xc]
push 0
push 0
push 3
push 0
push 1
push bind
push edi
mov byte [ebp - 4], 1
call dword [sym.imp.KERNEL32.dll_CreateFileW]
cmp eax, 0xffffffff
mov dword [ebp + 0xc], eax
jne 0x547212
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push edi
lea ecx, [ebp - 0x14]
push str.Error_opening_file__ls__errcode___ld._n
push ecx
call fcn.005fb90b
mov edx, dword [ebp - 0x14]
add esp, 0x10
mov ecx, esi
push edx
call fcn.00541a30
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 0
call fcn.00602ad6
mov eax, 0x7535
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
mov ecx, dword [ebp + 0xc]
lea eax, [ebp - 0x2c]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
xor ebx, ebx
cmp eax, 0xffffffff
mov dword [ebp - 0x40], eax
jne 0x54727e
test ebx, ebx
jne 0x54727e
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x54727e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
lea edx, [ebp - 0x14]
push edi
push str.Error_during_GetFileSize____errcode___d._n
push edx
call fcn.005fb90b
mov eax, dword [ebp - 0x14]
add esp, 0xc
mov ecx, esi
push eax
call fcn.00541a30
mov ecx, dword [ebp + 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [0x6d2638]
mov ecx, dword [esi + 0xd4]
push edx
call fcn.00554c40
jmp 0x547756
mov eax, dword [ebp - 0x2c]
push 1
push 0
push 0
push eax
call fcn.005e8c50
mov ecx, dword [ebp - 0x40]
add ecx, eax
adc ebx, edx
mov dword [ebp - 0x40], ecx
push ebx
push ecx
push edi
lea ecx, [ebp - 0x14]
push str.Size_of__ls_is__I64d_n
push ecx
call fcn.005fb90b
mov edx, dword [ebp - 0x14]
add esp, 0x14
mov ecx, esi
push edx
call fcn.00541a30
mov edi, dword [ebp - 0x40]
mov eax, edi
or eax, ebx
jne 0x5472d1
push str.fSize0_n
mov ecx, esi
call fcn.00541a30
mov ecx, dword [ebp + 0xc]
push ecx
jmp 0x5472ee
xor eax, eax
cmp eax, ebx
jl 0x547318
jg 0x5472de
cmp dword [ebp + 0x14], edi
jb 0x547318
push str.startPos___fSize_n
mov ecx, esi
call fcn.00541a30
mov edx, dword [ebp + 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 0
call fcn.00602ad6
mov eax, 0x757c
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
mov eax, dword [ebp + 0x10]
lea ecx, [ebp - 0x18]
push eax
push ecx
call fcn.00402500
add esp, 8
mov edx, dword [ebp - 0x18]
mov ecx, esi
push edx
push ebx
push edi
mov byte [ebp - 4], 2
call fcn.0054aca0
xor ecx, ecx
cmp eax, ecx
je 0x5473ab
mov eax, dword [ebp - 0x18]
mov ecx, dword [0x6d2498]
push eax
lea edx, [ebp - 0x14]
push ecx
push edx
call fcn.005fb90b
mov eax, dword [ebp - 0x14]
mov ecx, dword [esi + 0xd4]
add esp, 0xc
push eax
call fcn.00554c40
push str.Disk_is_full._Cannot_add_next_chunks._n
mov ecx, esi
call fcn.00541a30
mov ecx, dword [ebp + 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp - 0x18]
mov byte [ebp - 4], 1
call fcn.00602ad6
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 0
call fcn.00602ad6
mov eax, 0x755f
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
cmp ebx, ecx
mov dword [ebp - 0x38], ecx
mov dword [ebp - 0x34], ecx
jg 0x5473c4
jl 0x5473bf
cmp edi, 0x600000
jae 0x5473c4
mov dword [ebp - 0x1c], edi
jmp 0x5473cb
mov dword [ebp - 0x1c], 0x600000
mov edx, dword [ebp - 0x1c]
push edx
call fcn.005e6c79
add esp, 4
mov dword [ebp + 0x10], eax
test eax, eax
jne 0x547490
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea eax, [ebp - 0x14]
push str.VirtualAlloc_malloc_failed__error__d_n
push eax
call fcn.005fb90b
mov ecx, dword [ebp - 0x14]
add esp, 0xc
push ecx
mov ecx, esi
call fcn.00541a30
mov eax, 0xaaaaaaab
mul dword [ebp - 0x1c]
shr edx, 1
mov eax, edx
push eax
mov dword [ebp - 0x1c], eax
call fcn.005e6c79
add esp, 4
test eax, eax
jne 0x547490
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
lea edx, [ebp - 0x14]
push str.VirtualAlloc_malloc_failed__error__d_n
push edx
call fcn.005fb90b
mov eax, dword [ebp - 0x14]
add esp, 0xc
mov ecx, esi
push eax
call fcn.00541a30
mov ecx, dword [ebp + 0xc]
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [0x6d2634]
mov ecx, dword [esi + 0xd4]
push edx
call fcn.00554c40
lea ecx, [ebp - 0x18]
mov byte [ebp - 4], 1
call fcn.00602ad6
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 0
call fcn.00602ad6
mov eax, 0x7564
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
mov eax, dword [ebp + 0x14]
xor ecx, ecx
cmp eax, ecx
jbe 0x5474b3
push ecx
push ecx
mov ecx, dword [ebp + 0xc]
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edx, dword [ebp + 0x14]
xor eax, eax
mov dword [ebp - 0x38], edx
mov dword [ebp - 0x34], eax
xor ecx, ecx
mov eax, dword [esi + 0x18]
cmp eax, ecx
je 0x5474cc
mov dl, byte [eax + 0xc]
test dl, dl
jne 0x5474cc
mov byte [esi + 0x65], 1
mov dword [esi + 0x60], ecx
mov byte [esi + 0x66], 0
mov dword [ebp - 0x48], ecx
mov dword [ebp - 0x44], ecx
mov dword [ebp - 0x20], ecx
mov ecx, dword [ebp - 0x1c]
mov edx, dword [ebp + 0x10]
lea eax, [ebp - 0x20]
push 0
push eax
mov eax, dword [ebp + 0xc]
push ecx
push edx
push eax
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x5476fd
mov ecx, dword [ebp - 0x20]
test ecx, ecx
je 0x5476fd
mov eax, dword [esi + 0x18]
mov dword [ebp - 0x28], 0
test eax, eax
je 0x547540
mov edx, dword [eax + 0x3c]
test edx, edx
jne 0x547540
lea ecx, [ebp - 0x48]
lea edx, [ebp - 0x28]
push ecx
lea eax, [ebp - 0x24]
push edx
mov edx, dword [ebp - 0x34]
lea ecx, [ebp - 0x20]
push eax
mov eax, dword [ebp - 0x38]
push ecx
mov ecx, dword [ebp + 0x10]
push edx
mov edx, dword [ebp + 8]
push eax
push ebx
push edi
push ecx
push edx
mov ecx, esi
call fcn.00546bd0
jmp 0x547555
mov edx, dword [ebp + 8]
lea eax, [ebp - 0x24]
push 0
push eax
push ecx
mov ecx, dword [ebp + 0x10]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x54765f
mov ecx, dword [ebp - 0x24]
mov eax, dword [ebp - 0x20]
cmp eax, ecx
jne 0x54765f
mov edx, dword [ebp - 0x38]
xor eax, eax
add edx, ecx
mov dword [ebp - 0x38], edx
mov edx, dword [ebp - 0x34]
adc edx, eax
mov dword [ebp - 0x34], edx
mov edx, dword [esi + 0x100]
add edx, ecx
mov dword [esi + 0x100], edx
mov ecx, dword [esi + 0x104]
adc ecx, eax
mov eax, dword [esi + 0x18]
test eax, eax
mov dword [esi + 0x104], ecx
je 0x5475d4
mov edx, dword [ebp - 0x28]
test edx, edx
je 0x5475d4
mov eax, dword [ebp - 0x48]
mov ecx, dword [ebp - 0x44]
mov edi, eax
or edi, ecx
je 0x5475c9
cmp ecx, ebx
jg 0x5475c9
jl 0x5475c0
mov edi, dword [ebp - 0x40]
cmp eax, edi
jae 0x5475cc
mov edi, eax
mov ebx, ecx
mov dword [ebp - 0x40], edi
jmp 0x5475d4
mov edi, dword [ebp - 0x40]
sub edi, edx
mov dword [ebp - 0x40], edi
sbb ebx, 0
mov eax, dword [esi + 0xd8]
cmp dword [eax], 0
je 0x547608
mov ecx, dword [esi + 0x100]
mov edx, dword [esi + 0x104]
mov dword [ebp - 0x50], ecx
lea ecx, [ebp - 0x50]
mov dword [ebp - 0x4c], edx
mov edx, dword [eax]
push ecx
push 0x147b
push 0x111
push edx
call dword [sym.imp.USER32.dll_SendMessageA]
cmp dword [ebp - 0x34], ebx
jl 0x5474d5
jg 0x54761c
cmp dword [ebp - 0x38], edi
jb 0x5474d5
mov eax, dword [ebp + 0x10]
push eax
call fcn.005e6206
mov ecx, dword [ebp + 0xc]
add esp, 4
push ecx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea ecx, [ebp - 0x18]
mov byte [ebp - 4], 1
call fcn.00602ad6
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 0
call fcn.00602ad6
xor eax, eax
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
lea edx, [ebp - 0x14]
push edi
push str.Fatal_Write_Error__d_n
push edx
call fcn.005fb90b
mov eax, dword [ebp - 0x14]
add esp, 0xc
mov ecx, esi
push eax
call fcn.00541a30
mov ecx, dword [ebp + 0x10]
push ecx
call fcn.005e6206
mov edx, dword [ebp + 0xc]
add esp, 4
push edx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [0x6cc708]
mov dword [ebp + 0x14], eax
push 0
lea ecx, [ebp + 8]
push 0
push ecx
push 0x400
push edi
push 0
push 0x1100
mov byte [ebp - 4], 3
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
mov edx, dword [ebp + 8]
lea eax, [ebp + 0x14]
push edx
push 0x6a00a0
push eax
call fcn.005fb90b
mov ecx, dword [ebp + 8]
add esp, 0xc
push ecx
call dword [sym.imp.KERNEL32.dll_LocalFree]
mov edx, dword [ebp + 0x14]
mov ecx, dword [esi + 0xd4]
push edx
call fcn.00554c40
lea ecx, [ebp + 0x14]
mov byte [ebp - 4], 2
call fcn.00602ad6
jmp 0x54774a
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
lea eax, [ebp - 0x14]
push edi
push str.Fatal_Read_Error__d_n
push eax
call fcn.005fb90b
mov ecx, dword [ebp - 0x14]
add esp, 0xc
push ecx
mov ecx, esi
call fcn.00541a30
mov edx, dword [ebp + 0x10]
push edx
call fcn.005e6206
mov eax, dword [ebp + 0xc]
add esp, 4
push eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [0x6d262c]
push ecx
mov ecx, dword [esi + 0xd4]
call fcn.00554c40
lea ecx, [ebp - 0x18]
mov byte [ebp - 4], 1
call fcn.00602ad6
lea ecx, [ebp - 0x14]
mov byte [ebp - 4], 0
call fcn.00602ad6
mov eax, edi
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10