Function at 0x1400017c0
Capabilities:
Encode data using xor
Extract resource via kernel32 functions
Hash data via bcrypt
Read file on windows
Write file on windows

Disassembly:
push rbp
push rbx
lea rbp, [rsp - 0x188]
sub rsp, 0x288
mov rax, qword [section..data]
xor rax, rsp
mov qword [rbp + 0x170], rax
cmp ecx, 2
jl 0x14000183e
mov rcx, qword [rdx + 8]
mov rax, 0xffffffffffffffff
inc rax
cmp byte [rcx + rax], 0
jne 0x1400017f3
cmp rax, 4
jne 0x14000183e
movzx eax, byte [rcx]
mov byte [0x140005690], al
mov rax, qword [rdx + 8]
movzx ecx, byte [rax + 1]
mov byte [0x140005691], cl
mov rax, qword [rdx + 8]
movzx ecx, byte [rax + 2]
mov byte [0x140005692], cl
mov rax, qword [rdx + 8]
movzx ecx, byte [rax + 3]
mov byte [0x140005693], cl
mov byte [0x140005694], 0
jmp 0x14000184a
lea rcx, str.Please_provide_a_4_character_n
call fcn.140001010
mov edx, 0x65
xor ecx, ecx
mov r8d, 0xa
call qword [sym.imp.KERNEL32.dll_FindResourceW]
mov rbx, rax
test rax, rax
jne 0x140001883
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.FindResource_failed__error__d_n
call fcn.140001010
mov eax, 1
jmp 0x140001aa8
mov rdx, rbx
mov qword [rsp + 0x2a8], rdi
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_LoadResource]
mov rdi, rax
test rax, rax
jne 0x1400018bc
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.LoadResource_failed__error__d_n
call fcn.140001010
mov eax, 1
jmp 0x140001aa0
mov rdx, rbx
mov qword [rsp + 0x2a0], rsi
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_SizeofResource]
mov rcx, rdi
mov ebx, eax
call qword [sym.imp.KERNEL32.dll_LockResource]
mov ecx, ebx
mov rdi, rax
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov rsi, rax
test rax, rax
jne 0x140001904
lea rcx, [0x1400035b0]
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_perror]
mov eax, 1
jmp 0x140001a98
mov qword [rsp + 0x2b0], r14
lea rdx, [0x1400035b8]
xor r9d, r9d
mov qword [rsp + 0x280], r15
xor r8d, r8d
lea rcx, [rsp + 0x48]
call qword [sym.imp.bcrypt.dll_BCryptOpenAlgorithmProvider]
mov rcx, qword [rsp + 0x48]
lea rax, [rsp + 0x54]
xor r15d, r15d
lea r8, [rsp + 0x50]
mov dword [rsp + 0x28], r15d
lea rdx, str.HashDigestLength
mov r9d, 4
mov qword [rsp + 0x20], rax
call qword [sym.imp.bcrypt.dll_BCryptGetProperty]
mov rcx, qword [rsp + 0x48]
lea rdx, [rsp + 0x40]
mov dword [rsp + 0x30], r15d
xor r9d, r9d
mov dword [rsp + 0x28], r15d
xor r8d, r8d
mov qword [rsp + 0x20], r15
call qword [sym.imp.bcrypt.dll_BCryptCreateHash]
lea rdx, [0x140005690]
mov r8, 0xffffffffffffffff
nop
inc r8
cmp byte [rdx + r8], r15b
jne 0x140001990
mov rcx, qword [rsp + 0x40]
xor r9d, r9d
call qword [sym.imp.bcrypt.dll_BCryptHashData]
mov r8d, dword [rsp + 0x50]
lea rdx, [rsp + 0x60]
mov rcx, qword [rsp + 0x40]
xor r9d, r9d
call qword [sym.imp.bcrypt.dll_BCryptFinishHash]
mov r8, rbx
mov rdx, rdi
mov rcx, rsi
call sub.VCRUNTIME140.dll_memcpy
mov rcx, r15
test rbx, rbx
je 0x1400019f6
nop word [rax + rax]
mov rax, rcx
and eax, 0xf
movzx eax, byte [rsp + rax + 0x60]
xor byte [rsi + rcx], al
inc rcx
cmp rcx, rbx
jb 0x1400019e0
mov rcx, qword [rsp + 0x40]
call qword [sym.imp.bcrypt.dll_BCryptDestroyHash]
mov rcx, qword [rsp + 0x48]
xor edx, edx
call qword [sym.imp.bcrypt.dll_BCryptCloseAlgorithmProvider]
mov edi, r15d
lea r14, str.Success
nop dword [rax + rax]
mov qword [rsp + 0x30], r15
lea rcx, str..pipewwf1
mov dword [rsp + 0x28], r15d
xor r9d, r9d
xor r8d, r8d
mov dword [rsp + 0x20], 3
mov edx, 0xc0000000
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rbx, rax
cmp rax, 0xffffffffffffffff
jne 0x140001ac1
lea ebx, [rdi + 1]
test edi, edi
jne 0x140001a71
mov rdx, rsi
call fcn.1400011a0
mov ecx, 2
call qword [sym.imp.KERNEL32.dll_Sleep]
mov edi, ebx
jmp 0x140001a20
mov ecx, 2
mov edi, ebx
call qword [sym.imp.KERNEL32.dll_Sleep]
cmp ebx, 5
jl 0x140001a20
mov eax, 1
mov r14, qword [rsp + 0x2b0]
mov r15, qword [rsp + 0x280]
mov rsi, qword [rsp + 0x2a0]
mov rdi, qword [rsp + 0x2a8]
mov rcx, qword [rbp + 0x170]
xor rcx, rsp
call fcn.140001bd0
add rsp, 0x288
pop rbx
pop rbp
ret
lea rcx, str.Enter_flag:
call fcn.140001010
xor ecx, ecx
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___acrt_iob_func]
mov edx, 0x100
lea rcx, [rsp + 0x70]
mov r8, rax
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_fgets]
lea rdx, [0x140003628]
lea rcx, [rsp + 0x70]
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_strcspn]
cmp rax, 0x100
jae 0x140001bb2
mov byte [rsp + rax + 0x70], r15b
mov r8, 0xffffffffffffffff
lea rax, [rsp + 0x70]
inc r8
cmp byte [rax + r8], r15b
jne 0x140001b17
inc r8d
mov qword [rsp + 0x20], r15
lea r9, [rsp + 0x58]
mov rcx, rbx
lea rdx, [rsp + 0x70]
call qword [sym.imp.KERNEL32.dll_WriteFile]
lea r9, [rsp + 0x5c]
mov qword [rsp + 0x20], r15
mov r8d, 0x100
lea rdx, [rbp + 0x70]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_ReadFile]
mov rax, r15
lea rdx, [rbp + 0x70]
nop
movzx ecx, byte [rdx + rax]
inc rax
cmp cl, byte [r14 + rax - 1]
jne 0x140001b94
cmp rax, 8
jne 0x140001b60
lea rdx, [rbp + 0x70]
lea rcx, str.Server_response:__s_n
call fcn.140001010
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
jmp 0x140001a88
lea rdx, [rbp + 0x70]
lea rcx, str.Server_response:__s._Please_try_again._n
call fcn.140001010
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x140001a20
call fcn.140001cf8
int3