joyce8/EMBER2024-capa huggingface dataset:
Function at 0x140016c14
Capabilities:
Clear file content

Disassembly:
mov rax, rsp
mov qword [rax + 8], rbx
mov qword [rax + 0x10], rbp
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], rdi
push r12
push r14
push r15
sub rsp, 0x20
mov rbx, rdx
mov rsi, r8
xor edx, edx
mov r14d, ecx
lea r8d, [rdx + 1]
call fcn.14001358c
xor edx, edx
mov ecx, r14d
mov r12, rax
lea r8d, [rdx + 2]
call fcn.14001358c
mov rbp, rbx
sub rbp, rax
cmp r12, 0xffffffffffffffff
je 0x140016d61
cmp rax, 0xffffffffffffffff
je 0x140016d61
xor edi, edi
test rbp, rbp
jle 0x140016d0f
lea edx, [rdi + 1]
mov ecx, 0x1000
call fcn.14000acf0
mov rbx, rax
test rax, rax
jne 0x140016c9c
lea edi, [rax + 0xc]
mov byte [rsi + 0x30], 1
mov dword [rsi + 0x2c], edi
jmp 0x140016d05
mov edx, 0x8000
mov ecx, r14d
call fcn.1400099c0
mov r15d, eax
mov eax, 0x1000
mov r8d, ebp
cmp rbp, rax
mov r9, rsi
mov rdx, rbx
mov ecx, r14d
cmovge r8d, eax
call fcn.14000d1f0
cmp eax, 0xffffffff
je 0x140016ce5
cdqe
sub rbp, rax
test rbp, rbp
jg 0x140016cac
mov edx, r15d
mov ecx, r14d
call fcn.1400099c0
jmp 0x140016d05
cmp byte [rsi + 0x38], dil
je 0x140016cfc
cmp dword [rsi + 0x34], 5
jne 0x140016cfc
mov byte [rsi + 0x30], 1
mov dword [rsi + 0x2c], 0xd
cmp byte [rsi + 0x30], dil
je 0x140016d05
mov edi, dword [rsi + 0x2c]
mov rcx, rbx
call fcn.14000ad70
jmp 0x140016d73
jns 0x140016d73
xor r8d, r8d
mov rdx, rbx
mov ecx, r14d
call fcn.14001358c
cmp rax, 0xffffffffffffffff
jne 0x140016d2d
cmp byte [rsi + 0x30], dil
je 0x140016d73
jmp 0x140016d69
mov ecx, r14d
call fcn.14000c794
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetEndOfFile]
test eax, eax
jne 0x140016d73
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov byte [rsi + 0x38], 1
mov edi, 0xd
mov dword [rsi + 0x34], eax
mov byte [rsi + 0x30], 1
mov dword [rsi + 0x2c], 0xd
jmp 0x140016d73
xor edi, edi
cmp byte [rsi + 0x30], dil
je 0x140016d6e
mov edi, dword [rsi + 0x2c]
jmp 0x140016d73
mov edi, 0x16
xor r8d, r8d
mov rdx, r12
mov ecx, r14d
call fcn.14001358c
mov rbx, qword [rsp + 0x40]
mov eax, edi
mov rdi, qword [rsp + 0x58]
mov rbp, qword [rsp + 0x48]
mov rsi, qword [rsp + 0x50]
add rsp, 0x20
pop r15
pop r14
pop r12
ret

Function at 0x140018ac0
Capabilities:
Parse pe header

Disassembly:
mov eax, 0x5a4d
cmp word [rcx], ax
jne 0x140018ae8
movsxd rdx, dword [rcx + 0x3c]
add rdx, rcx
cmp dword [rdx], 0x4550
jne 0x140018ae8
xor eax, eax
mov ecx, 0x20b
cmp word [rdx + 0x18], cx
sete al
ret
xor eax, eax
ret
Function at 0x3859e1390
Capabilities:
Get common file path

Disassembly:
push rbp
sub rsp, 0x130
lea rbp, [rsp + 0x80]
mov rax, qword [sym.dxgi.dll_hOriginalDll]
test rax, rax
jne 0x3859e1425
lea rax, [rbp - 0x60]
mov edx, 0x104
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_GetSystemDirectoryA]
call rax
lea rax, [rbp - 0x60]
lea r8, str.dxgi.dll
mov edx, 0x104
mov rcx, rax
mov rax, qword [sym.imp.msvcrt.dll_strcat_s]
call rax
lea rax, [rbp - 0x60]
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_LoadLibraryA]
call rax
mov qword [sym.dxgi.dll_hOriginalDll], rax
mov rax, qword [sym.dxgi.dll_hOriginalDll]
test rax, rax
jne 0x3859e1425
mov r9d, 0x10
lea r8, str.Error
lea rax, str.Failed_to_load_original_dxgi.dll
mov rdx, rax
mov ecx, 0
mov rax, qword [sym.imp.USER32.dll_MessageBoxA]
call rax
nop
add rsp, 0x130
pop rbp
ret

Function at 0x3859e1a7f
Capabilities:
Run powershell expression

Disassembly:
push rbp
push rbx
sub rsp, 0x48
lea rbp, [rsp + 0x40]
mov qword [rbp + 0x20], rcx
mov qword [rbp + 0x28], rdx
lea rax, [rbp - 0x20]
mov rdx, qword [rbp + 0x28]
mov r8, rdx
lea rdx, str.param___string__Password__n_nif___not__Password___n____Write_Host__Usage:_.decrypt_script.ps1__password___n____exit_n_n_n_encryptedText___
mov rcx, rax
call method.std::__cxx11::basic_string_char__std::char_traits_char___std::allocator_char____std::operator_char__std::char_traits_char___std.allocator_char____char_const__std::__cxx11::basic_string_char__std::char_traits_char___std::allocator_char____const_
mov rax, qword [rbp + 0x20]
lea rdx, [rbp - 0x20]
lea r8, str.__n_nfunction_Decrypt_XOR__n____param___n_________string__encryptedText__n_________string__key_n______n_n_____encryptedBytes___System.Convert_::FromBase64String__encryptedText__n_____decryptedBytes______n_____keyLength___key.Length_n_n____for___i__0___i__lt__encryptedBytes.Length___i___n_________keyChar___int__char__key__i____keyLength__n_________encChar___encryptedBytes__i__n_________decChar___encChar__bxor__keyChar_n_________decryptedBytes___byte__decChar_n_____n_n____return__System.Text.Encoding_::UTF8.GetString__decryptedBytes__n_n_ntry__n_____decryptedScript__Decrypt_XOR__encryptedText__encryptedText__key__Password_n_n____if___not__decryptedScript___n________throw__Decryption_failed._The_decrypted_script_is_null_or_empty.__n_____n_n____Write_Output__The_decrypted_script_is:__n____Write_Output__decryptedScript_n____Invoke_Expression__decryptedScript_n_catch__n____Write_Error__Error_during_decryption:_____n_n
mov rcx, rax
call method.std::__cxx11::basic_string_char__std::char_traits_char___std::allocator_char____std::operator_char__std::char_traits_char___std.allocator_char____std::__cxx11::basic_string_char__std::char_traits_char___std::allocator_char_____char_const_
lea rax, [rbp - 0x20]
mov rcx, rax
call sym.std::__cxx11::basic_string_char__std::char_traits_char___std::allocator_char___::basic_string__
jmp 0x3859e1aeb
mov rax, qword [rbp + 0x20]
add rsp, 0x48
pop rbx
pop rbp
ret
Function at 0x3859e1d40
Capabilities:
Get common file path

Disassembly:
push rbp
push rbx
sub rsp, 0x348
lea rbp, [rsp + 0x80]
mov qword [rbp + 0x2e0], rcx
mov qword [rbp + 0x2e8], rdx
lea rax, [rbp + 0x1b0]
mov qword [rsp + 0x20], rax
mov r9d, 0
mov r8d, 0
mov edx, 0x1c
mov ecx, 0
mov rax, qword [sym.imp.SHELL32.dll_SHGetFolderPathA]
call rax
test eax, eax
sete al
test al, al
je 0x3859e1ea2
lea rax, [rbp + 0x2b7]
mov qword [rbp + 0x2b8], rax
nop
nop
lea rcx, [rbp + 0x2b7]
lea rdx, [rbp + 0x1b0]
lea rax, [rbp - 0x50]
mov r8, rcx
mov rcx, rax
call method.std::__cxx11::basic_string_char__std::char_traits_char___std::allocator_char___::basic_string_std.allocator_char____char_const__std::allocator_char__const_
lea rax, [rbp + 0x2b7]
mov rcx, rax
call method.std::__new_allocator_char_.__new_allocator__
nop
lea rax, [rbp - 0x50]
lea rdx, str.Microsoft_
mov rcx, rax
call method.std::__cxx11::basic_string_char__std::char_traits_char___std::allocator_char___.append_char_const_
mov rdx, qword [rbp + 0x2e0]
lea rax, [rbp - 0x50]
mov rcx, rax
call method.std::__cxx11::basic_string_char__std::char_traits_char___std::allocator_char___.append_char_const_
lea rdx, [rbp - 0x50]
lea rax, [rbp - 0x30]
mov r8d, 0x10
mov rcx, rax
call fcn.385a70ba0
lea rax, [rbp - 0x30]
mov rcx, rax
call method.std::basic_ofstream_char__std::char_traits_char___.is_open__
test al, al
je 0x3859e1e3f
mov rdx, qword [rbp + 0x2e8]
lea rax, [rbp - 0x30]
mov rcx, rax
call method.std::basic_ostream_char__std::char_traits_char____std::operator____std.char_traits_char____std::basic_ostream_char__std::char_traits_char_____char_const_
lea rax, [rbp - 0x30]
mov rcx, rax
call method.std::basic_ofstream_char__std::char_traits_char___.close__
lea rax, [rbp - 0x30]
mov rcx, rax
call method.std::basic_ofstream_char__std::char_traits_char___.basic_ofstream__
lea rax, [rbp - 0x50]
mov rcx, rax
call sym.std::__cxx11::basic_string_char__std::char_traits_char___std::allocator_char___::basic_string__
jmp 0x3859e1ea2
nop
add rsp, 0x348
pop rbx
pop rbp
ret
Function at 0x3859e1ead
Capabilities:
Get common file path

Disassembly:
push rbp
push rbx
sub rsp, 0x328
lea rbp, [rsp + 0x80]
mov qword [rbp + 0x2c0], rcx
mov qword [rbp + 0x2c8], rdx
lea rax, [rbp + 0x190]
mov qword [rsp + 0x20], rax
mov r9d, 0
mov r8d, 0
mov edx, 0x1a
mov ecx, 0
mov rax, qword [sym.imp.SHELL32.dll_SHGetFolderPathA]
call rax
test eax, eax
sete al
test al, al
je 0x3859e1fa0
lea rax, [rbp + 0x190]
lea rdx, str.Adobe_
mov rcx, rax
call sym.dxgi.dll_int_strcat_s_260ull__char_____260ull___char_const_
mov rdx, qword [rbp + 0x2c0]
lea rax, [rbp + 0x190]
mov rcx, rax
call sym.dxgi.dll_int_strcat_s_260ull__char_____260ull___char_const_
lea rdx, [rbp + 0x190]
lea rax, [rbp - 0x50]
mov r8d, 0x10
mov rcx, rax
call method.std::basic_ofstream_char__std::char_traits_char___.basic_ofstream_char_const__std::_Ios_Openmode_
lea rax, [rbp - 0x50]
mov rcx, rax
call method.std::basic_ofstream_char__std::char_traits_char___.is_open__
test al, al
je 0x3859e1f78
mov rdx, qword [rbp + 0x2c8]
lea rax, [rbp - 0x50]
mov rcx, rax
call method.std::basic_ostream_char__std::char_traits_char____std::operator____std.char_traits_char____std::basic_ostream_char__std::char_traits_char_____char_const_
lea rax, [rbp - 0x50]
mov rcx, rax
call method.std::basic_ofstream_char__std::char_traits_char___.close__
lea rax, [rbp - 0x50]
mov rcx, rax
call method.std::basic_ofstream_char__std::char_traits_char___.basic_ofstream__
jmp 0x3859e1fa0
nop
add rsp, 0x328
pop rbx
pop rbp
ret
Function at 0x3859ec530
Capabilities:
Write file on windows

Disassembly:
push rbp
push rsi
push rbx
sub rsp, 0x30
lea rbp, [rsp + 0x30]
mov rbx, rcx
lea rax, [rbp + 0x28]
mov ecx, 2
mov qword [rbp + 0x28], rdx
mov qword [rbp + 0x30], r8
mov qword [rbp + 0x38], r9
mov qword [rbp - 8], rax
call dbg.__acrt_iob_func
mov r8d, 0x1b
mov edx, 1
lea rcx, str.Mingw_w64_runtime_failure:_n
mov r9, rax
call sym.fwrite
mov rsi, qword [rbp - 8]
mov ecx, 2
call dbg.__acrt_iob_func
mov rdx, rbx
mov rcx, rax
mov r8, rsi
call sym.vfprintf
call sym.abort
nop
nop dword [rax]

Function at 0x3859ec5a0
Capabilities:
Allocate or change rwx memory

Disassembly:
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x58
lea rbp, [rsp + 0x50]
movsxd rsi, dword [0x385ada0a4]
mov rbx, rcx
test esi, esi
jle 0x3859ec6d0
mov rax, qword [0x385ada0a8]
xor r9d, r9d
add rax, 0x18
nop dword [rax]
mov r8, qword [rax]
cmp rbx, r8
jb 0x3859ec5eb
mov rdx, qword [rax + 8]
mov edx, dword [rdx + 8]
add r8, rdx
cmp rbx, r8
jb 0x3859ec673
add r9d, 1
add rax, 0x28
cmp r9d, esi
jne 0x3859ec5d0
mov rcx, rbx
call dbg.__mingw_GetSectionForAddress
mov rdi, rax
test rax, rax
je 0x3859ec6f2
mov rax, qword [0x385ada0a8]
lea rbx, [rsi + rsi*4]
shl rbx, 3
add rax, rbx
mov qword [rax + 0x20], rdi
mov dword [rax], 0
call dbg._GetPEImageBase
mov edx, dword [rdi + 0xc]
mov r8d, 0x30
lea rcx, [rax + rdx]
mov rax, qword [0x385ada0a8]
lea rdx, [rbp - 0x30]
mov qword [rax + rbx + 0x18], rcx
call qword [sym.imp.KERNEL32.dll_VirtualQuery]
test rax, rax
je 0x3859ec6d7
mov eax, dword [rbp - 0xc]
lea edx, [rax - 4]
and edx, 0xfffffffb
je 0x3859ec66c
lea edx, [rax - 0x40]
and edx, 0xffffffbf
jne 0x3859ec680
add dword [0x385ada0a4], 1
add rsp, 0x58
pop rbx
pop rsi
pop rdi
pop rbp
ret
cmp eax, 2
mov rcx, qword [rbp - 0x30]
mov rdx, qword [rbp - 0x18]
mov r8d, 0x40
mov eax, 4
cmove r8d, eax
add rbx, qword [0x385ada0a8]
mov qword [rbx + 8], rcx
mov r9, rbx
mov qword [rbx + 0x10], rdx
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
jne 0x3859ec66c
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.__VirtualProtect_failed_with_code_0x_x
mov edx, eax
call dbg.__report_error
nop word [rax + rax]
xor esi, esi
jmp 0x3859ec5f8
mov rax, qword [0x385ada0a8]
mov edx, dword [rdi + 8]
lea rcx, str.__VirtualQuery_failed_for__d_bytes_at_address__p
mov r8, qword [rax + rbx + 0x18]
call dbg.__report_error
mov rdx, rbx
lea rcx, str.Address__p_has_no_image_section
call dbg.__report_error
nop
nop word cs:[rax + rax]
nop dword [rax]
Function at 0x3859eca70
Capabilities:
Get thread local storage value

Disassembly:
push rbp
push r13
push r12
push rdi
push rsi
push rbx
sub rsp, 0x28
lea rbp, [rsp + 0x20]
lea r13, [0x385ada0e0]
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov rbx, qword [0x385ada0c0]
test rbx, rbx
je 0x3859ecad5
mov r12, qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rdi, qword [sym.imp.KERNEL32.dll_GetLastError]
nop dword [rax + rax]
mov ecx, dword [rbx]
call r12
mov rsi, rax
call rdi
test rsi, rsi
je 0x3859ecacc
test eax, eax
jne 0x3859ecacc
mov rax, qword [rbx + 8]
mov rcx, rsi
call rax
mov rbx, qword [rbx + 0x10]
test rbx, rbx
jne 0x3859ecab0
mov rcx, r13
add rsp, 0x28
pop rbx
pop rsi
pop rdi
pop r12
pop r13
pop rbp
jmp qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]

Function at 0x3859ecd10
Capabilities:
Parse pe header

Disassembly:
xor eax, eax
cmp word [rcx], 0x5a4d
jne 0x3859ecd28
movsxd rdx, dword [rcx + 0x3c]
add rcx, rdx
cmp dword [rcx], 0x4550
je 0x3859ecd30
ret
xor eax, eax
cmp word [rcx + 0x18], 0x20b
sete al
ret

Function at 0x3859ecd40
Capabilities:
Enumerate pe sections

Disassembly:
movsxd rax, dword [rcx + 0x3c]
add rcx, rax
movzx eax, word [rcx + 0x14]
movzx r8d, word [rcx + 6]
lea rax, [rcx + rax + 0x18]
test r8w, r8w
je 0x3859ecd8d
lea ecx, [r8 - 1]
lea rcx, [rcx + rcx*4]
lea r9, [rax + rcx*8 + 0x28]
nop dword [rax + rax]
mov r8d, dword [rax + 0xc]
mov rcx, r8
cmp rdx, r8
jb 0x3859ecd84
add ecx, dword [rax + 8]
cmp rdx, rcx
jb 0x3859ecd8f
add rax, 0x28
cmp rax, r9
jne 0x3859ecd70
xor eax, eax
ret

Function at 0x3859ecd90
Capabilities:
Parse pe header

Disassembly:
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x28
lea rbp, [rsp + 0x20]
mov rsi, rcx
call sym.strlen
cmp rax, 8
ja 0x3859ece28
mov rdx, qword [0x385ab1900]
xor ebx, ebx
cmp word [rdx], 0x5a4d
jne 0x3859ece16
movsxd rax, dword [rdx + 0x3c]
add rax, rdx
cmp dword [rax], 0x4550
jne 0x3859ece16
cmp word [rax + 0x18], 0x20b
jne 0x3859ece16
movzx edx, word [rax + 0x14]
lea rbx, [rax + rdx + 0x18]
movzx edx, word [rax + 6]
test dx, dx
je 0x3859ece28
lea eax, [rdx - 1]
lea rax, [rax + rax*4]
lea rdi, [rbx + rax*8 + 0x28]
jmp 0x3859ece01
add rbx, 0x28
cmp rbx, rdi
je 0x3859ece28
mov r8d, 8
mov rdx, rsi
mov rcx, rbx
call sym.strncmp
test eax, eax
jne 0x3859ecdf8
mov rax, rbx
add rsp, 0x28
pop rbx
pop rsi
pop rdi
pop rbp
ret
xor ebx, ebx
mov rax, rbx
add rsp, 0x28
pop rbx
pop rsi
pop rdi
pop rbp
ret

Function at 0x3859ece40
Capabilities:
Enumerate pe sections
Parse pe header

Disassembly:
mov rdx, qword [0x385ab1900]
xor eax, eax
cmp word [rdx], 0x5a4d
jne 0x3859ece60
movsxd r8, dword [rdx + 0x3c]
add r8, rdx
cmp dword [r8], 0x4550
je 0x3859ece68
ret
cmp word [r8 + 0x18], 0x20b
jne 0x3859ece60
movzx eax, word [r8 + 0x14]
sub rcx, rdx
lea rax, [r8 + rax + 0x18]
movzx r8d, word [r8 + 6]
test r8w, r8w
je 0x3859ecebd
lea edx, [r8 - 1]
lea rdx, [rdx + rdx*4]
lea r9, [rax + rdx*8 + 0x28]
nop word cs:[rax + rax]
mov r8d, dword [rax + 0xc]
mov rdx, r8
cmp rcx, r8
jb 0x3859eceb4
add edx, dword [rax + 8]
cmp rcx, rdx
jb 0x3859ece60
add rax, 0x28
cmp rax, r9
jne 0x3859ecea0
xor eax, eax
ret
Function at 0x3859ecec0
Capabilities:
Parse pe header

Disassembly:
mov rax, qword [0x385ab1900]
xor ecx, ecx
cmp word [rax], 0x5a4d
jne 0x3859ecedf
movsxd rdx, dword [rax + 0x3c]
add rax, rdx
cmp dword [rax], 0x4550
je 0x3859ecee8
mov eax, ecx
ret
cmp word [rax + 0x18], 0x20b
jne 0x3859ecedf
movzx ecx, word [rax + 6]
mov eax, ecx
ret

Function at 0x3859ecf00
Capabilities:
Parse pe header

Disassembly:
mov r8, qword [0x385ab1900]
xor eax, eax
cmp word [r8], 0x5a4d
jne 0x3859ecf20
movsxd rdx, dword [r8 + 0x3c]
add rdx, r8
cmp dword [rdx], 0x4550
je 0x3859ecf28
ret
cmp word [rdx + 0x18], 0x20b
jne 0x3859ecf20
movzx eax, word [rdx + 0x14]
movzx r8d, word [rdx + 6]
lea rax, [rdx + rax + 0x18]
test r8w, r8w
je 0x3859ecf70
lea edx, [r8 - 1]
lea rdx, [rdx + rdx*4]
lea rdx, [rax + rdx*8 + 0x28]
nop dword [rax]
test byte [rax + 0x27], 0x20
je 0x3859ecf67
test rcx, rcx
je 0x3859ecf20
sub rcx, 1
add rax, 0x28
cmp rdx, rax
jne 0x3859ecf58
xor eax, eax
ret

Function at 0x3859ecf80
Capabilities:
Parse pe header

Disassembly:
mov rax, qword [0x385ab1900]
xor edx, edx
cmp word [rax], 0x5a4d
jne 0x3859ecf9f
movsxd rcx, dword [rax + 0x3c]
add rcx, rax
cmp dword [rcx], 0x4550
je 0x3859ecfa8
mov rax, rdx
ret
cmp word [rcx + 0x18], 0x20b
cmove rdx, rax
mov rax, rdx
ret

Function at 0x3859ecfc0
Capabilities:
Enumerate pe sections
Parse pe header

Disassembly:
mov rdx, qword [0x385ab1900]
xor eax, eax
cmp word [rdx], 0x5a4d
jne 0x3859ecfe0
movsxd r8, dword [rdx + 0x3c]
add r8, rdx
cmp dword [r8], 0x4550
je 0x3859ecfe8
ret
cmp word [r8 + 0x18], 0x20b
jne 0x3859ecfe0
sub rcx, rdx
movzx r9d, word [r8 + 6]
movzx edx, word [r8 + 0x14]
lea rdx, [r8 + rdx + 0x18]
test r9w, r9w
je 0x3859ecfe0
lea eax, [r9 - 1]
lea rax, [rax + rax*4]
lea r9, [rdx + rax*8 + 0x28]
nop word cs:[rax + rax]
mov r8d, dword [rdx + 0xc]
mov rax, r8
cmp rcx, r8
jb 0x3859ed034
add eax, dword [rdx + 8]
cmp rcx, rax
jb 0x3859ed040
add rdx, 0x28
cmp rdx, r9
jne 0x3859ed020
xor eax, eax
ret
mov eax, dword [rdx + 0x24]
not eax
shr eax, 0x1f
ret

Function at 0x3859ed050
Capabilities:
Enumerate pe sections
Parse pe header

Disassembly:
mov r11, qword [0x385ab1900]
xor r8d, r8d
cmp word [r11], 0x5a4d
mov r10d, ecx
jne 0x3859ed074
movsxd rcx, dword [r11 + 0x3c]
add rcx, r11
cmp dword [rcx], 0x4550
je 0x3859ed080
mov rax, r8
ret
cmp word [rcx + 0x18], 0x20b
jne 0x3859ed074
mov eax, dword [rcx + 0x90]
test eax, eax
je 0x3859ed074
movzx edx, word [rcx + 0x14]
movzx r9d, word [rcx + 6]
lea rdx, [rcx + rdx + 0x18]
test r9w, r9w
je 0x3859ed074
lea ecx, [r9 - 1]
lea rcx, [rcx + rcx*4]
lea r9, [rdx + rcx*8 + 0x28]
nop dword [rax + rax]
mov r8d, dword [rdx + 0xc]
mov rcx, r8
cmp rax, r8
jb 0x3859ed0cc
add ecx, dword [rdx + 8]
cmp rax, rcx
jb 0x3859ed0e0
add rdx, 0x28
cmp r9, rdx
jne 0x3859ed0b8
xor r8d, r8d
mov rax, r8
ret
add rax, r11
jmp 0x3859ed0f0
sub r10d, 1
add rax, 0x14
mov ecx, dword [rax + 4]
test ecx, ecx
jne 0x3859ed0fe
mov edx, dword [rax + 0xc]
test edx, edx
je 0x3859ed0d5
test r10d, r10d
jg 0x3859ed0e8
mov r8d, dword [rax + 0xc]
add r8, r11
mov rax, r8
ret
Function at 0x3859ed3d0
Capabilities:
Allocate thread local storage

Disassembly:
push rsi
push rbx
sub rsp, 0x28
mov rsi, rcx
mov rbx, rdx
call qword [sym.imp.KERNEL32.dll_TlsAlloc]
cmp eax, 0xffffffff
je 0x3859ed400
mov rdx, rbx
mov ecx, eax
mov dword [rsi], eax
add rsp, 0x28
pop rbx
pop rsi
jmp dbg.__mingwthr_key_dtor
add rsp, 0x28
pop rbx
pop rsi
jmp qword [sym.imp.KERNEL32.dll_GetLastError]

Function at 0x3859ed440
Capabilities:
Get thread local storage value

Disassembly:
push rsi
push rbx
sub rsp, 0x28
mov ebx, ecx
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, ebx
mov esi, eax
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ecx, esi
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov rax, rbx
add rsp, 0x28
pop rbx
pop rsi
ret

Function at 0x3859ed470
Capabilities:
Set thread local storage value

Disassembly:
sub rsp, 0x28
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
je 0x3859ed488
xor eax, eax
add rsp, 0x28
ret
add rsp, 0x28
jmp qword [sym.imp.KERNEL32.dll_GetLastError]
Function at 0x3859edca0
Capabilities:
Allocate thread local storage
Get thread local storage value
Set thread local storage value

Disassembly:
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x28
mov rsi, qword [0x385ab0d10]
mov r11d, dword [rsi]
mov rbx, rcx
test r11d, r11d
jne 0x3859edcd8
mov rax, qword [rcx + 0x10]
test rax, rax
je 0x3859edd40
add rsp, 0x28
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
ret
mov r12, qword [rcx + 0x10]
test r12, r12
je 0x3859edd50
mov esi, dword [0x385ada168]
mov r13, qword [sym.imp.KERNEL32.dll_GetLastError]
call r13
mov edi, eax
mov ecx, esi
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ecx, edi
mov rsi, rax
call qword [sym.imp.KERNEL32.dll_SetLastError]
test rsi, rsi
je 0x3859edda8
mov rbp, qword [rsi]
cmp rbp, r12
jb 0x3859eddf0
sub r12, 1
mov rax, qword [rsi + r12*8 + 8]
test rax, rax
jne 0x3859edcc7
mov rcx, rbx
call fcn.3859edc00
mov qword [rsi + r12*8 + 8], rax
jmp 0x3859edcc7
call fcn.3859edc00
mov qword [rbx + 0x10], rax
jmp 0x3859edcc7
mov r10d, dword [rsi]
test r10d, r10d
je 0x3859ede81
mov r9d, dword [0x385aa5040]
test r9d, r9d
je 0x3859edea9
lea rcx, [0x385ada180]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov r12, qword [rbx + 0x10]
test r12, r12
je 0x3859ede8e
mov eax, dword [rsi]
test eax, eax
je 0x3859edce1
lea rcx, [0x385ada180]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
jmp 0x3859edce1
lea rcx, [r12 + 0x21]
mov edx, 8
lea rdi, [r12 + 0x20]
call sym.calloc
mov rsi, rax
test rax, rax
je 0x3859edee4
mov qword [rax], rdi
mov ecx, dword [0x385ada168]
mov rdx, rsi
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x3859edd1b
call r13
jmp 0x3859edd1b
lea rdi, [rbp + rbp]
lea rax, [r12 + 0x20]
mov rcx, rsi
cmp rdi, r12
cmovb rdi, rax
lea rdx, [rdi*8 + 8]
call sym.realloc
mov rsi, rax
test rax, rax
je 0x3859edee4
mov qword [rax], rdi
sub rdi, rbp
lea rcx, [rax + rbp*8 + 8]
xor edx, edx
lea r8, [rdi*8]
call sym.memset
jmp 0x3859eddcb
lea rcx, [0x385ada180]
call qword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
call qword [sym.imp.KERNEL32.dll_TlsAlloc]
cmp eax, 0xffffffff
je 0x3859ededc
lea rdx, [0x3859edbb0]
mov ecx, eax
mov dword [0x385ada168], eax
call dbg.__mingwthr_key_dtor
test eax, eax
jne 0x3859edee4
mov dword [0x385aa5040], 1
mov edx, dword [rsi]
test edx, edx
jne 0x3859edd6c
mov r12, qword [rbx + 0x10]
test r12, r12
jne 0x3859edce1
mov rax, qword [0x385ada160]
lea r12, [rax + 1]
mov qword [0x385ada160], r12
mov qword [rbx + 0x10], r12
jmp 0x3859edd86
lock add dword [0x385aa5044], 1
je 0x3859ede39
mov r8d, dword [0x385aa5040]
mov rbp, qword [sym.imp.KERNEL32.dll_Sleep]
lea rdi, [0x385aa5040]
test r8d, r8d
jne 0x3859ede77
nop dword [rax]
xor ecx, ecx
call rbp
mov ecx, dword [rdi]
test ecx, ecx
je 0x3859eded0
jmp 0x3859ede77
call qword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x3859ede69
call sym.abort
nop
nop word [rax + rax]
Function at 0x3859f6200
Capabilities:
Generate random numbers via rtlgenrandom

Disassembly:
push rbp
push rsi
push rbx
sub rsp, 0x20
lea rbp, [rsp + 0x20]
mov rbx, rcx
lea rcx, str.msvcrt.dll
call qword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov rsi, qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rdx, str.rand_s
mov rcx, rax
call rsi
test rax, rax
je 0x3859f6250
mov rcx, rbx
mov qword [dbg.init_rand_s], rax
add rsp, 0x20
pop rbx
pop rsi
pop rbp
jmp rax
lea rcx, str.advapi32.dll
call qword [sym.imp.KERNEL32.dll_LoadLibraryW]
lea rdx, str.SystemFunction036
mov rcx, rax
call rsi
mov qword [0x385adaca0], rax
lea rax, [dbg.mingw_rand_s]
jmp 0x3859f6234

Function at 0x3859f8a50
Capabilities:
Read file on windows

Disassembly:
push rsi
push rbx
sub rsp, 0x28
mov r9, qword [rcx + 0x40]
mov rsi, rdx
mov rbx, rcx
mov edx, 1
mov rcx, rsi
call sym.fread
mov edx, 0xffffffff
test rax, rax
jle 0x3859f8a7c
movzx edx, byte [rsi + rax - 1]
mov dword [rbx + 0x48], edx
add rsp, 0x28
pop rbx
pop rsi
ret

Function at 0x3859f96f0
Capabilities:
Write file on windows

Disassembly:
push rdi
push rsi
push rbx
sub rsp, 0x30
cmp byte [0x385aa8000], 0
jne 0x3859f97f6
mov byte [0x385aa8000], 1
call sym.__cxa_current_exception_type
test rax, rax
je 0x3859f97cc
mov rbx, qword [rax + 8]
xor eax, eax
lea r9, [rsp + 0x2c]
cmp byte [rbx], 0x2a
mov dword [rsp + 0x2c], 0xffffffff
sete al
xor r8d, r8d
xor edx, edx
add rbx, rax
mov rcx, rbx
call sym.__cxa_demangle
mov ecx, 2
mov rsi, qword [dbg.__acrt_iob_func]
mov rdi, rax
call rsi
mov edx, 1
lea rcx, str.terminate_called_after_throwing_an_instance_of_
mov r8d, 0x30
mov r9, rax
call sym.fwrite
mov edx, dword [rsp + 0x2c]
mov ecx, 2
test edx, edx
je 0x3859f97bd
call rsi
mov rcx, rbx
mov rdx, rax
call sym.fputs
mov ecx, 2
call rsi
mov r8d, 2
mov edx, 1
lea rcx, [0x385aab891]
mov r9, rax
call sym.fwrite
mov eax, dword [rsp + 0x2c]
test eax, eax
jne 0x3859f97b8
mov rcx, rdi
call sym.free
call sym.__cxa_rethrow
call rsi
mov rcx, rdi
mov rdx, rax
call sym.fputs
jmp 0x3859f9787
mov ecx, 2
call qword [dbg.__acrt_iob_func]
mov r8d, 0x2d
mov edx, 1
lea rcx, str.terminate_called_without_an_active_exception_n
mov r9, rax
call sym.fwrite
call sym.abort
mov ecx, 2
call qword [dbg.__acrt_iob_func]
mov r8d, 0x1d
mov edx, 1
lea rcx, str.terminate_called_recursively_n
mov r9, rax
call sym.fwrite
call sym.abort
sub rdx, 1
mov rcx, rax
jne 0x3859f988b
call sym.__cxa_begin_catch
mov rcx, rax
mov rax, qword [rax]
call qword [rax + 0x10]
mov ecx, 2
mov rbx, rax
call rsi
mov r9, rax
mov r8d, 0xb
mov edx, 1
lea rcx, str.__what__:
call sym.fwrite
mov ecx, 2
call rsi
mov rdx, rax
mov rcx, rbx
call sym.fputs
mov ecx, 2
call rsi
mov rdx, rax
mov ecx, 0xa
call sym.fputc
call sym.__cxa_end_catch
jmp 0x3859f97f1
call sym.__cxa_begin_catch
call sym.__cxa_end_catch
jmp 0x3859f97f1