Function at 0x180004d08
Capabilities:
Get file size
Read file on windows

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x78]
sub rsp, 0x178
mov r13, rcx
mov rbx, rdx
lea rcx, [rsp + 0x61]
xor edi, edi
xor edx, edx
mov r8d, 0x103
mov byte [rsp + 0x60], dil
call fcn.18001cca0
mov r15d, 0xc800
lea rcx, [r13 + 0x24]
mov r8d, r15d
xor edx, edx
lea r14, [rbx + 0x22]
call fcn.18001cca0
mov eax, dword [rbx]
mov dword [r13 + 0x2e], eax
movzx r8d, word [r14 + 0xa]
mov esi, 0x104
lea rcx, [rsp + 0x60]
mov edx, esi
add r8, r14
call fcn.18001d58c
lea rcx, [rsp + 0x60]
mov edx, esi
call fcn.180008f74
lea eax, [rdi + 3]
mov qword [rsp + 0x30], rdi
lea rcx, [rsp + 0x60]
mov r8d, eax
xor r9d, r9d
mov edx, 0x80000000
mov dword [rsp + 0x28], edi
mov dword [rsp + 0x20], eax
call qword [sym.imp.KERNEL32.dll_CreateFileA]
lea rbx, [r13 + 0x50]
mov r12, rax
mov qword [rsp + 0x48], rax
cmp rax, 0xffffffffffffffff
jne 0x180004dfc
lea eax, [rdi + 0xa]
mov word [rbx], ax
call qword [sym.imp.KERNEL32.dll_GetLastError]
movzx ecx, word [rbx]
mov word [rbx + 2], cx
mov dword [rbx + 6], eax
movzx r8d, word [r14 + 0xa]
add rcx, rbx
mov edx, esi
add r8, r14
call fcn.18001d58c
movzx ecx, word [rbx + 2]
add rcx, rbx
call fcn.18001d680
lea esi, [rdi + 1]
mov edx, 0x104
jmp 0x1800050c3
mov eax, reloc.WS2_32.dll_ntohl
mov qword [rbx + 2], rdi
lea rcx, [rbx + 0xe]
mov word [rbx], ax
mov word [rbx + 0xa], ax
movzx r8d, word [r14 + 0xa]
add r8, r14
mov rdx, rsi
call fcn.18001d58c
movzx ecx, word [rbx + 0xa]
add rcx, rbx
call fcn.18001d680
mov esi, 1
mov edx, 0x104
add ax, si
add word [rbx], ax
movzx ecx, word [rbx]
mov word [rbx + 0xc], cx
movzx r8d, word [r14 + 0xc]
add rcx, rbx
add r8, r14
call fcn.18001d58c
movzx ecx, word [rbx + 0xc]
add rcx, rbx
call fcn.18001d680
lea edx, [rsi + 0xb]
mov rcx, r13
add ax, si
add word [rbx], ax
movzx r8d, word [rbx]
add r8d, 0x2c
call fcn.180003e70
cmp eax, esi
je 0x180004e83
xor eax, eax
jmp 0x18000510f
xor edx, edx
mov r8d, 0xc7d4
mov rcx, rbx
call fcn.18001cca0
mov eax, reloc.WS2_32.dll_inet_ntoa
lea rcx, [rbx + 0xc]
mov word [rbx], ax
mov word [rbx + 0xa], ax
movzx r8d, word [r14 + 0xc]
add r8, r14
mov edx, 0x104
call fcn.18001d58c
movzx ecx, word [rbx + 0xa]
add rcx, rbx
call fcn.18001d680
xor edx, edx
add ax, si
add word [rbx], ax
movzx eax, word [rbx]
lea ecx, [rax + 0x2c]
mov word [rbx + 8], ax
mov dword [rbp + 0xc0], edi
mov dword [rbp + 0xc8], ecx
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_GetFileSize]
mov edx, dword [r14 + 2]
mov ecx, dword [r14 + 6]
mov r8d, eax
mov dword [rsp + 0x40], eax
mov dword [rsp + 0x44], edi
mov dword [rbp + 0xd0], ecx
test edx, edx
je 0x180004f0e
lea r8d, [rdx + rcx]
mov dword [rsp + 0x40], r8d
movsxd rax, dword [rbp + 0xc8]
mov r12d, edi
sub r15d, eax
lea r9, [rax + 0x24]
movsxd rdx, r15d
mov r15d, dword [rbp + 0xc8]
add r9, r13
mov qword [rsp + 0x50], r9
mov qword [rsp + 0x58], rdx
mov eax, r8d
mov r10d, 0xc000
mov r8, rdx
sub eax, ecx
mov rcx, r9
cmp eax, r10d
cmovg eax, r10d
xor edx, edx
mov dword [rbp + 0xc0], eax
call fcn.18001cca0
mov edx, dword [rbp + 0xd0]
mov rcx, qword [rsp + 0x48]
xor r9d, r9d
xor r8d, r8d
call qword [sym.imp.KERNEL32.dll_SetFilePointer]
mov r8d, dword [rbp + 0xc0]
mov rdx, qword [rsp + 0x50]
mov rcx, qword [rsp + 0x48]
lea r9, [rbp + 0xc0]
mov qword [rsp + 0x20], rdi
call qword [sym.imp.KERNEL32.dll_ReadFile]
movzx eax, word [rbp + 0xc0]
mov ecx, dword [rbp + 0xd0]
mov dword [rbx + 2], ecx
mov word [rbx + 6], ax
mov eax, dword [rbp + 0xc0]
add ecx, eax
lea r8d, [rax + r15]
mov edx, ntohl
mov dword [rbp + 0xd0], ecx
mov rcx, r13
call fcn.180003e70
cmp eax, esi
je 0x180005035
lea rcx, str.0x01__SSD_failed__d.
mov edx, eax
call fcn.180002148
mov dword [rbp + 0xd8], edi
mov r8d, dword [rbp + 0xc0]
mov edx, ntohl
mov rcx, r13
add r8d, dword [rbp + 0xc8]
call fcn.180003e70
mov r15d, eax
cmp eax, esi
je 0x180005025
lea rcx, str.0x01__SSD_failed__d.
mov edx, eax
call fcn.180002148
mov eax, dword [rbp + 0xd8]
add eax, esi
mov dword [rbp + 0xd8], eax
cmp eax, 3
jl 0x180004fe0
jmp 0x180005029
mov dword [rsp + 0x44], edi
cmp r15d, esi
jne 0x18000505c
mov r15d, dword [rbp + 0xc8]
mov ecx, dword [rbp + 0xd0]
mov r8d, dword [rsp + 0x40]
add r12d, esi
cmp ecx, r8d
jge 0x180005057
mov r9, qword [rsp + 0x50]
mov rdx, qword [rsp + 0x58]
jmp 0x180004f36
mov r15d, dword [rsp + 0x44]
test r12d, r12d
jle 0x180005075
lea rcx, str.0x01___d_d_times.
mov r8d, r12d
mov edx, ntohl
call fcn.180002148
mov rcx, qword [rsp + 0x48]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
xor edx, edx
mov r8d, 0xc7d4
mov rcx, rbx
call fcn.18001cca0
mov dword [rbx + 6], r15d
mov dword [rbx], 0xa000a
movzx r8d, word [r14 + 0xa]
mov r15d, 0x104
lea rcx, [rbx + 0xa]
add r8, r14
mov edx, r15d
call fcn.18001d58c
movzx ecx, word [rbx + 2]
add rcx, rbx
call fcn.18001d680
mov edx, r15d
add ax, si
add word [rbx], ax
movzx ecx, word [rbx]
mov word [rbx + 4], cx
movzx r8d, word [r14 + 0xc]
add rcx, rbx
add r8, r14
call fcn.18001d58c
movzx ecx, word [rbx + 4]
add rcx, rbx
call fcn.18001d680
mov edx, reloc.WS2_32.dll_ntohl
mov rcx, r13
add ax, si
add word [rbx], ax
movzx r8d, word [rbx]
add r8d, 0x2c
call fcn.180003e70
cmp eax, esi
sete dil
mov eax, edi
add rsp, 0x178
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret