Function at 0x180020510
Capabilities:
Read file on windows

Disassembly:
push rbp
push r12
push r13
push r14
lea rbp, [rsp - 0x1058]
mov eax, 0x1158
call fcn.18007fc70
sub rsp, rax
mov rax, qword [0x1800d1eb0]
xor rax, rsp
mov qword [rbp + 0x1030], rax
mov rax, rdx
xor r12d, r12d
mov r13, rcx
mov qword [rcx + 0x200], r12
mov qword [rsp + 0x30], r12
xor r9d, r9d
mov rcx, rax
xor r8d, r8d
mov edx, 0x80000000
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 3
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov r14, rax
cmp rax, 0xffffffffffffffff
jne 0x18002058f
mov rcx, r13
call fcn.18001ff70
xor al, al
jmp 0x180020b89
xor eax, eax
lea r9, [rsp + 0x40]
lea rdx, [rbp + 0xc08]
lea r8d, [rax + 4]
mov rcx, r14
mov qword [rsp + 0x1148], rdi
mov qword [rbp + 0xc08], rax
mov word [rbp + 0xc10], ax
mov byte [rbp + 0xc12], al
mov qword [rsp + 0x20], r12
call qword [sym.imp.KERNEL32.dll_ReadFile]
cmp dword [rsp + 0x40], 4
jne 0x180020c5c
lea r8, [rsp + 0x44]
lea rdx, [0x1800a97a8]
lea rcx, [rbp + 0xc08]
mov byte [rbp + 0xc0c], r12b
call fcn.18007b890
mov r8d, dword [rsp + 0x44]
lea r9, [rsp + 0x40]
lea rdx, [rbp + 0xc20]
mov rcx, r14
mov qword [rsp + 0x20], r12
call qword [sym.imp.KERNEL32.dll_ReadFile]
movsxd r11, dword [rsp + 0x44]
movsxd rdi, dword [rsp + 0x40]
cmp r11d, edi
jne 0x180020c5c
mov rax, r11
mov byte [rbp + r11 + 0xc20], r12b
cmp edi, 0xffffffff
je 0x180020c5c
lea rdx, str._encry_mode_
lea rcx, [rbp + 0xc20]
call fcn.18007d888
test rax, rax
je 0x180020c5c
mov edx, r12d
mov ecx, r12d
mov rax, r12
test rdi, rdi
jle 0x180020c5c
nop dword [rax]
cmp ecx, 3
je 0x180020694
cmp byte [rbp + rax + 0xc20], 9
jne 0x180020681
inc ecx
inc rax
inc edx
cmp rax, rdi
jl 0x180020670
cmp ecx, 3
jl 0x180020c5c
mov qword [rsp + 0x1190], rbx
movsxd rax, edx
mov qword [rsp + 0x1140], r15
mov ebx, r12d
cmp rax, rdi
jge 0x1800206cc
sub rdi, rax
lea rdx, [rbp + rax + 0xc20]
lea rcx, [rbp + 0xbf0]
mov r8, rdi
mov rbx, rdi
call fcn.18007abc0
movsxd rax, ebx
lea rcx, [rbp + 0xbf0]
mov byte [rbp + rax + 0xbf0], r12b
call fcn.18007bbf0
lea rdx, [rbp + 0xc20]
mov r8d, eax
mov rcx, r14
mov r15d, eax
call fcn.180020430
movsxd rdi, eax
cmp edi, 0xffffffff
je 0x180020c44
lea rdx, str._hardware_type_
lea rcx, [rbp + 0xc20]
call fcn.18007d888
test rax, rax
je 0x180020c44
mov edx, r12d
mov ecx, r12d
mov rax, r12
test rdi, rdi
jle 0x180020c44
cmp ecx, 3
je 0x180020756
cmp byte [rbp + rax + 0xc20], 9
jne 0x180020743
inc ecx
inc rax
inc edx
cmp rax, rdi
jl 0x180020732
cmp ecx, 3
jl 0x180020c44
movsxd rax, edx
mov dword [r13 + 4], r12d
mov ebx, r12d
cmp rax, rdi
jge 0x180020782
sub rdi, rax
lea rdx, [rbp + rax + 0xc20]
lea rcx, [rbp + 0xbf0]
mov r8, rdi
mov rbx, rdi
call fcn.18007abc0
movsxd rax, ebx
lea rcx, [rbp + 0xbf0]
mov byte [rbp + rax + 0xbf0], r12b
call fcn.18007bbf0
lea rdx, [rbp + 0xc20]
mov r8d, r15d
mov rcx, r14
mov dword [r13 + 4], eax
call fcn.180020430
movsxd rdi, eax
cmp edi, 0xffffffff
je 0x180020c44
lea rdx, str._hardware_No_
lea rcx, [rbp + 0xc20]
call fcn.18007d888
test rax, rax
je 0x180020c44
mov edx, r12d
mov ecx, r12d
mov rax, r12
test rdi, rdi
jle 0x180020c44
nop dword [rax]
cmp ecx, 3
je 0x180020814
cmp byte [rbp + rax + 0xc20], 9
jne 0x180020801
inc ecx
inc rax
inc edx
cmp rax, rdi
jl 0x1800207f0
cmp ecx, 3
jl 0x180020c44
movsxd rcx, edx
mov r8d, r12d
cmp rcx, rdi
jge 0x180020848
mov r8d, edi
lea rdx, [r13 + 8]
sub r8d, ecx
nop dword [rax]
movzx eax, byte [rbp + rcx + 0xc20]
inc rcx
add rdx, 2
mov word [rdx - 2], ax
cmp rcx, rdi
jl 0x180020830
movsxd rax, r8d
lea rdi, [rsp + 0x54]
mov ecx, 0x41
mov word [r13 + rax*2 + 8], r12w
movzx eax, r12w
lea r8, [r13 + 8]
rep stosw word [rdi], ax
mov eax, dword [r13 + 4]
lea rcx, [rsp + 0x54]
mov edx, 0x41
mov dword [rsp + 0x50], eax
call fcn.18007b470
mov r8, qword [r13 + 0x98]
lea rax, [rsp + 0x50]
cmp rax, r8
jae 0x1800208f9
mov rax, qword [r13 + 0x90]
lea rcx, [rsp + 0x50]
cmp rax, rcx
ja 0x1800208f9
lea rcx, [rsp + 0x50]
sub rcx, rax
movabs rax, 0x7878787878787879
imul rcx
mov rbx, rdx
sar rbx, 6
mov rax, rbx
shr rax, 0x3f
add rbx, rax
cmp r8, qword [r13 + 0xa0]
jne 0x1800208da
lea rcx, [r13 + 0x90]
call fcn.18000ff90
mov rcx, qword [r13 + 0x98]
imul rbx, rbx, 0x88
add rbx, qword [r13 + 0x90]
test rcx, rcx
je 0x18002092a
mov rdx, rbx
jmp 0x18002091f
cmp r8, qword [r13 + 0xa0]
jne 0x18002090e
lea rcx, [r13 + 0x90]
call fcn.18000ff90
mov rcx, qword [r13 + 0x98]
test rcx, rcx
je 0x18002092a
lea rdx, [rsp + 0x50]
mov r8d, 0x88
call fcn.18007abc0
add qword [r13 + 0x98], 0x88
lea rcx, [rbp - 0x1c]
xor edx, edx
mov r8d, 0x400
mov qword [rsp + 0x1150], rsi
mov dword [rbp - 0x20], r12d
call fcn.18007e840
movzx eax, r12w
lea rdi, [rbp + 0x3e8]
mov ecx, 0x400
mov dword [rbp + 0x3e4], r12d
lea rdx, [rbp + 0xc20]
rep stosw word [rdi], ax
mov rcx, r14
mov r8d, r15d
call fcn.180020430
cmp eax, 0xffffffff
je 0x180020b56
nop word [rax + rax]
lea rdx, str._unit_key_
lea rcx, [rbp + 0xc20]
movsxd rsi, eax
call fcn.18007d888
test rax, rax
je 0x180020ba7
mov ebx, r12d
mov rdi, r12
mov eax, r12d
test rsi, rsi
jle 0x180020b56
cmp eax, 3
je 0x1800209e5
cmp byte [rbp + rdi + 0xc20], 9
jne 0x1800209d2
inc eax
inc rdi
inc ebx
cmp rdi, rsi
jl 0x1800209c1
cmp eax, 3
jl 0x180020b56
mov rcx, r12
cmp rdi, rsi
jge 0x180020a1c
lea rdx, [rbp + 0xbf0]
sub rdx, rdi
nop word [rax + rax]
movzx eax, byte [rbp + rdi + 0xc20]
cmp al, 9
je 0x180020a1c
mov byte [rdi + rdx], al
inc rdi
inc ebx
inc rcx
cmp rdi, rsi
jl 0x180020a00
mov byte [rbp + rcx + 0xbf0], 0
lea rcx, [rbp + 0xbf0]
call fcn.18007bbf0
inc rdi
inc ebx
mov dword [rbp - 0x20], eax
mov eax, 1
cmp rdi, rsi
jge 0x180020b56
cmp eax, 3
jge 0x180020a6a
cmp byte [rbp + rdi + 0xc20], 9
jne 0x180020a61
inc rdi
inc eax
inc ebx
cmp rdi, rsi
jl 0x180020a46
cmp eax, 3
jl 0x180020b56
movsxd rax, ebx
mov rcx, r12
cmp rax, rsi
jge 0x180020aa1
nop word [rax + rax]
movzx edx, byte [rbp + rax + 0xc20]
cmp dl, 9
je 0x180020aa1
inc rax
mov byte [rbp + rcx + 0xbf0], dl
inc ebx
inc rcx
cmp rax, rsi
jl 0x180020a80
mov byte [rbp + rcx + 0xbf0], 0
lea rcx, [rbp + 0xbf0]
call fcn.18007bbf0
inc ebx
mov ecx, 1
mov dword [rbp + 0x3e4], eax
movsxd rax, ebx
cmp rax, rsi
jge 0x180020b56
nop
cmp ecx, 3
jge 0x180020af0
cmp byte [rbp + rax + 0xc20], 9
jne 0x180020aeb
inc rax
inc ecx
inc ebx
cmp rax, rsi
jl 0x180020ad0
cmp ecx, 3
jl 0x180020b56
movsxd rax, ebx
xor edi, edi
cmp rax, rsi
jge 0x180020b17
sub rsi, rax
lea rdx, [rbp + rax + 0xc20]
lea rcx, [rbp - 0x1c]
mov r8, rsi
mov r12, rsi
mov rdi, rsi
call fcn.18007abc0
mov byte [rbp + rdi - 0x1c], 0
cmp r12d, dword [rbp + 0x3e4]
jne 0x180020b56
lea rcx, [r13 + 0xb0]
lea rdx, [rbp - 0x20]
call fcn.18000fe50
lea rdx, [rbp + 0xc20]
mov r8d, r15d
mov rcx, r14
call fcn.180020430
mov r12d, 0
cmp eax, 0xffffffff
jne 0x180020990
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, r13
call fcn.18001ff70
xor al, al
mov rsi, qword [rsp + 0x1150]
mov rbx, qword [rsp + 0x1190]
mov r15, qword [rsp + 0x1140]
mov rdi, qword [rsp + 0x1148]
mov rcx, qword [rbp + 0x1030]
xor rcx, rsp
call fcn.18007a7c0
add rsp, 0x1158
pop r14
pop r13
pop r12
pop rbp
ret
lea rdx, str._file_create_time_
lea rcx, [rbp + 0xc20]
call fcn.18007d888
test rax, rax
je 0x180020b56
mov edx, r12d
mov ecx, r12d
mov rax, r12
test rsi, rsi
jle 0x180020b56
nop dword [rax]
cmp ecx, 3
je 0x180020bf4
cmp byte [rbp + rax + 0xc20], 9
jne 0x180020be1
inc ecx
inc rax
inc edx
cmp rax, rsi
jl 0x180020bd0
cmp ecx, 3
jl 0x180020b56
movsxd rcx, edx
mov edi, r12d
cmp rcx, rsi
jge 0x180020c28
mov edi, esi
lea rdx, [r13 + 0xd0]
sub edi, ecx
nop word [rax + rax]
movzx eax, byte [rbp + rcx + 0xc20]
inc rcx
add rdx, 2
mov word [rdx - 2], ax
cmp rcx, rsi
jl 0x180020c10
movsxd rax, edi
mov rcx, r14
mov word [r13 + rax*2 + 0xd0], r12w
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov al, 1
jmp 0x180020b69
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, r13
call fcn.18001ff70
xor al, al
jmp 0x180020b71
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, r13
call fcn.18001ff70
xor al, al
jmp 0x180020b81