Function at 0x47fa83
Capabilities:
Get file size

Disassembly:
push rbp
push r12
push rdi
push rsi
push rbx
mov rbp, rsp
sub rsp, 0x50
mov qword [rbp + 0x30], rcx
mov dword [rbp + 0x38], edx
mov dword [rbp + 0x40], r8d
mov dword [rbp + 0x48], r9d
mov rax, qword [0x00c85640]
test rax, rax
jne 0x47fac1
mov edx, 0
mov ecx, 0
call fcn.00446bd2
mov qword [0x00c85640], rax
mov edx, 1
lea rcx, [0x005b5d1c]
call fcn.004469a9
mov rdx, rax
mov rcx, qword [rbp + 0x30]
call fcn.004476fd
mov rdx, rax
mov rax, qword [0x00c85640]
mov rcx, rax
call fcn.00446da0
call fcn.0047e6cb
mov dword [0x00c8562c], eax
mov rdx, qword [0x007240b0]
mov eax, dword [0x00c8562c]
cdqe
imul rax, rax, 0x88
add rax, rdx
mov qword [0x00c85648], rax
mov rax, qword [rbp + 0x30]
mov rax, qword [rax]
mov qword [rbp - 8], rax
mov rax, qword [rbp - 8]
movzx eax, byte [rax]
movzx eax, al
mov dword [rbp - 0xc], eax
cmp dword [rbp - 0xc], 0x53
je 0x47fb43
cmp dword [rbp - 0xc], 0x73
jne 0x47fbce
add qword [rbp - 8], 1
mov rax, qword [rbp - 8]
movzx eax, byte [rax]
movzx eax, al
mov dword [rbp - 0xc], eax
cmp dword [rbp - 0xc], 0x43
je 0x47fb61
cmp dword [rbp - 0xc], 0x63
jne 0x47fbce
add qword [rbp - 8], 1
mov rax, qword [rbp - 8]
movzx eax, byte [rax]
movzx eax, al
mov dword [rbp - 0xc], eax
cmp dword [rbp - 0xc], 0x52
je 0x47fb7f
cmp dword [rbp - 0xc], 0x72
jne 0x47fbce
add qword [rbp - 8], 1
mov rax, qword [rbp - 8]
movzx eax, byte [rax]
movzx eax, al
mov dword [rbp - 0xc], eax
cmp dword [rbp - 0xc], 0x4e
je 0x47fb9d
cmp dword [rbp - 0xc], 0x6e
jne 0x47fbce
add qword [rbp - 8], 1
mov rax, qword [rbp - 8]
movzx eax, byte [rax]
movzx eax, al
mov dword [rbp - 0xc], eax
cmp dword [rbp - 0xc], 0x3a
jne 0x47fbce
mov rax, qword [0x00c85648]
mov byte [rax + 0x80], 1
mov eax, dword [0x00c8562c]
jmp 0x4804ed
mov eax, dword [rbp + 0x38]
and eax, 1
test eax, eax
je 0x47fbe3
mov rax, qword [0x00c85648]
mov byte [rax + 9], 1
mov eax, dword [rbp + 0x38]
and eax, 2
test eax, eax
je 0x47fbf8
mov rax, qword [0x00c85648]
mov byte [rax + 0xa], 1
mov eax, dword [rbp + 0x40]
and eax, 1
test eax, eax
je 0x47fc0d
mov rax, qword [0x00c85648]
mov byte [rax + 0xb], 1
mov eax, dword [rbp + 0x40]
and eax, 2
test eax, eax
je 0x47fc22
mov rax, qword [0x00c85648]
mov byte [rax + 0xc], 1
mov rax, qword [0x00c85648]
mov qword [rax + 0x10], 0
mov rdx, qword [0x00c85648]
mov rax, qword [0x00c85640]
mov rcx, rax
call fcn.0047ed13
mov dword [0x00c85630], eax
mov eax, dword [0x00c85630]
test eax, eax
setne al
test al, al
je 0x47fc7e
mov eax, dword [0x00c85630]
cmp eax, 0xffffffff
jne 0x47fc7e
mov eax, dword [0x00c8562c]
mov ecx, eax
call fcn.0047e9f3
mov eax, 0xfffffff5
jmp 0x4804ed
mov rdx, qword [0x007240a8]
mov eax, dword [0x00c8562c]
cdqe
shl rax, 3
add rax, rdx
mov qword [0x00c85650], rax
mov dword [0x00c85630], 0
mov eax, dword [rbp + 0x38]
and eax, 1
test eax, eax
je 0x47fcc0
mov eax, dword [0x00c85630]
or eax, 0x80000000
mov dword [0x00c85630], eax
mov eax, dword [rbp + 0x38]
and eax, 2
test eax, eax
je 0x47fcdb
mov eax, dword [0x00c85630]
or eax, 0x40000000
mov dword [0x00c85630], eax
mov dword [0x00c85634], 3
mov eax, dword [rbp + 0x40]
and eax, 1
test eax, eax
je 0x47fcfe
mov eax, dword [0x00c85634]
xor eax, 1
mov dword [0x00c85634], eax
mov eax, dword [rbp + 0x40]
and eax, 2
test eax, eax
je 0x47fd17
mov eax, dword [0x00c85634]
xor eax, 2
mov dword [0x00c85634], eax
mov rax, qword [0x00c85648]
movzx eax, byte [rax + 0x60]
test al, al
je 0x480185
mov rax, qword [0x00c85658]
test rax, rax
jne 0x47fd4c
mov edx, 0
mov ecx, 0
call fcn.00446bd2
mov qword [0x00c85658], rax
mov rax, qword [0x00c85648]
movzx eax, byte [rax + 0x60]
movzx eax, al
mov ecx, eax
call fcn.00449984
mov rbx, rax
lea rcx, [0x005b650d]
call fcn.004468ee
mov rdx, rbx
mov rcx, rax
call fcn.004476fd
mov rdx, rax
mov rax, qword [0x00c85658]
mov rcx, rax
call fcn.00446da0
mov edx, 2
lea rcx, [0x005b6510]
call fcn.004469a9
mov rdx, rax
mov rax, qword [0x00c85658]
mov rcx, rax
call fcn.004476fd
mov rdx, rax
mov rax, qword [0x00c85658]
mov rcx, rax
call fcn.00446da0
mov rax, qword [0x00c85658]
mov rax, qword [rax]
add rax, 2
mov byte [rax], 0x4d
mov eax, dword [0x00c85630]
mov edx, eax
mov rax, qword [0x00c85658]
mov rax, qword [rax]
mov rbx, qword [0x00c85650]
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0
mov dword [rsp + 0x20], 3
mov r9d, 0
mov r8d, 0
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_CreateFileA]
call rax
mov qword [rbx], rax
mov rax, qword [0x00c85650]
mov rax, qword [rax]
cmp rax, 0xffffffffffffffff
jne 0x47fe47
mov eax, dword [0x00c8562c]
mov ecx, eax
call fcn.0047e9f3
mov eax, 0xfffffff8
jmp 0x4804ed
mov r8d, 0x1c
mov edx, 0
lea rcx, [0x00c85660]
call sub.msvcrt.dll_memset
mov dword [0x00c85660], 0x1c
mov rax, qword [0x00c85650]
mov rax, qword [rax]
lea rdx, [0x00c85660]
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_GetCommState]
call rax
test eax, eax
sete al
test al, al
je 0x47febb
mov rax, qword [0x00c85650]
mov rax, qword [rax]
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_CloseHandle]
call rax
mov eax, dword [0x00c8562c]
mov ecx, eax
call fcn.0047e9f3
mov eax, 0xfffffff8
jmp 0x4804ed
mov r8d, 0x14
mov edx, 0
lea rcx, [0x00c85680]
call sub.msvcrt.dll_memset
mov rax, qword [0x00c85648]
mov eax, dword [rax + 0x64]
mov dword [0x00c85664], eax
mov rax, qword [0x00c85648]
movzx eax, byte [rax + 0x6a]
movsx eax, al
mov dword [0x00c85630], eax
mov eax, dword [0x00c85630]
cmp eax, 0xa
jne 0x47ff0b
mov dword [0x00c85634], 0
mov eax, dword [0x00c85630]
cmp eax, 0xf
jne 0x47ff20
mov dword [0x00c85634], 1
mov eax, dword [0x00c85630]
cmp eax, 0x14
jne 0x47ff35
mov dword [0x00c85634], 2
mov eax, dword [0x00c85634]
mov byte [0x00c85674], al
mov rax, qword [0x00c85648]
movzx eax, byte [rax + 0x69]
mov byte [0x00c85672], al
mov rax, qword [0x00c85648]
movzx eax, byte [rax + 0x68]
movsx eax, al
mov dword [0x00c85630], eax
mov eax, dword [0x00c85630]
test eax, eax
jne 0x47ff7a
mov dword [0x00c85634], 0
mov eax, dword [0x00c85630]
cmp eax, 1
jne 0x47ff8f
mov dword [0x00c85634], 2
mov eax, dword [0x00c85630]
cmp eax, 2
jne 0x47ffa4
mov dword [0x00c85634], 1
mov eax, dword [0x00c85630]
cmp eax, 3
jne 0x47ffb9
mov dword [0x00c85634], 4
mov eax, dword [0x00c85630]
cmp eax, 4
jne 0x47ffce
mov dword [0x00c85634], 3
mov eax, dword [0x00c85634]
mov byte [0x00c85673], al
mov eax, dword [0x00c85634]
test eax, eax
jne 0x47fff6
movzx eax, byte [0x00c85668]
and eax, 0xfffffffd
mov byte [0x00c85668], al
jmp 0x480006
movzx eax, byte [0x00c85668]
or eax, 2
mov byte [0x00c85668], al
mov rax, qword [0x00c85648]
movzx eax, byte [rax + 0x6d]
test al, al
je 0x480025
movzx eax, byte [0x00c85669]
and eax, 0xffffffcf
mov byte [0x00c85669], al
mov rax, qword [0x00c85648]
movzx eax, byte [rax + 0x6b]
test al, al
jne 0x480046
movzx eax, byte [0x00c85668]
or eax, 1
mov byte [0x00c85668], al
jmp 0x480056
movzx eax, byte [0x00c85668]
and eax, 0xfffffffe
mov byte [0x00c85668], al
mov byte [0x00c85678], 0x1a
mov rax, qword [0x00c85650]
mov rax, qword [rax]
lea rdx, [0x00c85660]
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_SetCommState]
call rax
test eax, eax
sete al
test al, al
je 0x4800b0
mov rax, qword [0x00c85650]
mov rax, qword [rax]
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_CloseHandle]
call rax
mov eax, dword [0x00c8562c]
mov ecx, eax
call fcn.0047e9f3
mov eax, 0xfffffff8
jmp 0x4804ed
mov rax, qword [0x00c85648]
mov eax, dword [rax + 0x78]
test eax, eax
jne 0x4800de
mov dword [0x00c85680], 0xffffffff
mov dword [0x00c85684], 0
mov dword [0x00c85688], 0
jmp 0x480102
mov dword [0x00c85680], 0
mov dword [0x00c85684], 0
mov rax, qword [0x00c85648]
mov eax, dword [rax + 0x78]
mov dword [0x00c85688], eax
mov dword [0x00c8568c], 0
mov rax, qword [0x00c85648]
mov eax, dword [rax + 0x74]
mov dword [0x00c85690], eax
mov rax, qword [0x00c85650]
mov rax, qword [rax]
lea rdx, [0x00c85680]
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_SetCommTimeouts]
call rax
test eax, eax
sete al
test al, al
je 0x48016f
mov rax, qword [0x00c85650]
mov rax, qword [rax]
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_CloseHandle]
call rax
mov eax, dword [0x00c8562c]
mov ecx, eax
call fcn.0047e9f3
mov eax, 0xfffffff8
jmp 0x4804ed
mov rax, qword [0x00c85648]
mov byte [rax + 8], 1
mov eax, dword [0x00c8562c]
jmp 0x4804ed
mov dword [0x00c85638], 3
cmp dword [rbp + 0x48], 0
je 0x4801a1
mov dword [0x00c85638], 4
jmp 0x4801a2
nop
mov eax, dword [0x00c85638]
mov edi, eax
mov eax, dword [0x00c85634]
mov r12d, eax
mov eax, dword [0x00c85630]
mov esi, eax
mov rax, qword [0x00c85640]
mov rcx, rax
call fcn.00439a75
mov rbx, qword [0x00c85650]
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], pe_nt_image_headers64
mov dword [rsp + 0x20], edi
mov r9d, 0
mov r8d, r12d
mov edx, esi
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_CreateFileA]
call rax
mov qword [rbx], rax
mov rax, qword [0x00c85650]
mov rax, qword [rax]
cmp rax, 0xffffffffffffffff
jne 0x480343
cmp dword [rbp + 0x48], 3
jne 0x480243
mov dword [0x00c85630], 0x80000000
mov rax, qword [0x00c85648]
mov byte [rax + 9], 1
mov rax, qword [0x00c85648]
mov byte [rax + 0xa], 0
add dword [rbp + 0x48], 1
jmp 0x4801a2
cmp dword [rbp + 0x48], 4
jne 0x480272
mov dword [0x00c85630], 0x40000000
mov rax, qword [0x00c85648]
mov byte [rax + 9], 0
mov rax, qword [0x00c85648]
mov byte [rax + 0xa], 1
add dword [rbp + 0x48], 1
jmp 0x4801a2
mov eax, dword [0x00c8562c]
mov ecx, eax
call fcn.0047e9f3
mov rax, qword [sym.imp.KERNEL32.dll_GetLastError]
call rax
mov dword [0x00c8563c], eax
mov eax, dword [0x00c8563c]
cmp eax, 3
jne 0x4802a3
mov eax, 0xfffffffa
jmp 0x4804ed
mov eax, dword [0x00c8563c]
cmp eax, 4
je 0x4802c4
mov eax, dword [0x00c8563c]
cmp eax, 0x1d
je 0x4802c4
mov eax, dword [0x00c8563c]
cmp eax, 0x1e
jne 0x4802ce
mov eax, 0xfffffff7
jmp 0x4804ed
mov eax, dword [0x00c8563c]
cmp eax, 5
je 0x4802fa
mov eax, dword [0x00c8563c]
cmp eax, 0x13
je 0x4802fa
mov eax, dword [0x00c8563c]
cmp eax, 0x21
je 0x4802fa
mov eax, dword [0x00c8563c]
cmp eax, 0x20
jne 0x480304
mov eax, 0xfffffff9
jmp 0x4804ed
mov eax, dword [0x00c8563c]
cmp eax, 0xf
je 0x48031a
mov eax, dword [0x00c8563c]
cmp eax, 0x15
jne 0x480324
mov eax, 0xfffffff8
jmp 0x4804ed
mov eax, dword [0x00c8563c]
cmp eax, 2
jne 0x480339
mov eax, 0xfffffffb
jmp 0x4804ed
mov eax, 0xfffffffb
jmp 0x4804ed
cmp dword [rbp + 0x48], 2
jne 0x4804dc
mov rax, qword [0x00c85650]
mov rax, qword [rax]
lea rdx, [0x00c85698]
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_GetFileSize]
call rax
mov dword [0x00c85694], eax
mov eax, dword [0x00c85694]
test eax, eax
jne 0x480388
mov eax, dword [0x00c85698]
test eax, eax
je 0x4804dc
mov rax, qword [0x00c85650]
mov rax, qword [rax]
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_CloseHandle]
call rax
mov dword [0x00c85638], 5
mov eax, dword [0x00c85638]
mov edi, eax
mov eax, dword [0x00c85634]
mov r12d, eax
mov eax, dword [0x00c85630]
mov esi, eax
mov rax, qword [0x00c85640]
mov rcx, rax
call fcn.00439a75
mov rbx, qword [0x00c85650]
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], pe_nt_image_headers64
mov dword [rsp + 0x20], edi
mov r9d, 0
mov r8d, r12d
mov edx, esi
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_CreateFileA]
call rax
mov qword [rbx], rax
mov rax, qword [0x00c85650]
mov rax, qword [rax]
cmp rax, 0xffffffffffffffff
jne 0x4804dc
mov eax, dword [0x00c8562c]
mov ecx, eax
call fcn.0047e9f3
mov rax, qword [sym.imp.KERNEL32.dll_GetLastError]
call rax
mov dword [0x00c8563c], eax
mov eax, dword [0x00c8563c]
cmp eax, 3
jne 0x48044b
mov eax, 0xfffffffa
jmp 0x4804ed
mov eax, dword [0x00c8563c]
cmp eax, 4
je 0x48046c
mov eax, dword [0x00c8563c]
cmp eax, 0x1d
je 0x48046c
mov eax, dword [0x00c8563c]
cmp eax, 0x1e
jne 0x480473
mov eax, 0xfffffff7
jmp 0x4804ed
mov eax, dword [0x00c8563c]
cmp eax, 5
je 0x48049f
mov eax, dword [0x00c8563c]
cmp eax, 0x13
je 0x48049f
mov eax, dword [0x00c8563c]
cmp eax, 0x21
je 0x48049f
mov eax, dword [0x00c8563c]
cmp eax, 0x20
jne 0x4804a6
mov eax, 0xfffffff9
jmp 0x4804ed
mov eax, dword [0x00c8563c]
cmp eax, 0xf
je 0x4804bc
mov eax, dword [0x00c8563c]
cmp eax, 0x15
jne 0x4804c3
mov eax, 0xfffffff8
jmp 0x4804ed
mov eax, dword [0x00c8563c]
cmp eax, 2
jne 0x4804d5
mov eax, 0xfffffffb
jmp 0x4804ed
mov eax, 0xfffffffb
jmp 0x4804ed
mov rax, qword [0x00c85648]
mov byte [rax + 8], 1
mov eax, dword [0x00c8562c]
add rsp, 0x50
pop rbx
pop rsi
pop rdi
pop r12
pop rbp
ret