joyce8/EMBER2024-capa huggingface dataset:
Function at 0x40bb90
Capabilities:
Allocate or change rwx memory

Disassembly:
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x50
movsxd rsi, dword [0x00506624]
test esi, esi
mov rbx, rcx
mov rbp, rdx
mov rdi, r8
jle 0x40bd18
mov rax, qword [0x00506628]
xor ecx, ecx
add rax, 0x18
nop
mov rdx, qword [rax]
cmp rbx, rdx
jb 0x40bbdc
mov r8, qword [rax + 8]
mov r8d, dword [r8 + 8]
add rdx, r8
cmp rbx, rdx
jb 0x40bc65
add ecx, 1
add rax, 0x28
cmp ecx, esi
jne 0x40bbc0
mov rcx, rbx
call sym.__mingw_GetSectionForAddress
test rax, rax
mov r12, rax
je 0x40bd4d
mov rax, qword [0x00506628]
lea rsi, [rsi + rsi*4]
shl rsi, 3
add rax, rsi
mov qword [rax + 0x20], r12
mov dword [rax], 0
call sym._GetPEImageBase
mov ecx, dword [r12 + 0xc]
lea rdx, [rsp + 0x20]
mov r8d, 0x30
add rcx, rax
mov rax, qword [0x00506628]
mov qword [rax + rsi + 0x18], rcx
call qword [sym.imp.KERNEL32.dll_VirtualQuery]
test rax, rax
je 0x40bd30
mov eax, dword [rsp + 0x44]
lea edx, [rax - 4]
and edx, 0xfffffffb
je 0x40bc5e
sub eax, 0x40
and eax, 0xffffffbf
jne 0x40bcc0
add dword [0x00506624], 1
cmp edi, 8
jae 0x40bc93
test dil, 4
jne 0x40bd04
test edi, edi
je 0x40bc88
movzx eax, byte [rbp]
test dil, 2
mov byte [rbx], al
jne 0x40bd1f
add rsp, 0x50
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
ret
mov eax, edi
sub edi, 1
mov rdx, qword [rbp + rax - 8]
cmp edi, 8
mov qword [rbx + rax - 8], rdx
jb 0x40bc88
and edi, 0xfffffff8
xor eax, eax
mov edx, eax
add eax, 8
mov rcx, qword [rbp + rdx]
cmp eax, edi
mov qword [rbx + rdx], rcx
jb 0x40bcac
jmp 0x40bc88
add rsi, qword [0x00506628]
mov r8d, 0x40
mov rcx, qword [rsp + 0x20]
mov rdx, qword [rsp + 0x38]
mov r9, rsi
mov qword [rsi + 8], rcx
mov qword [rsi + 0x10], rdx
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
jne 0x40bc5e
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.__VirtualProtect_failed_with_code_0x_x
mov edx, eax
call sym.__report_error
mov eax, dword [rbp]
mov edi, edi
mov dword [rbx], eax
mov eax, dword [rbp + rdi - 4]
mov dword [rbx + rdi - 4], eax
jmp 0x40bc88
xor esi, esi
jmp 0x40bbe7
mov edi, edi
movzx eax, word [rbp + rdi - 2]
mov word [rbx + rdi - 2], ax
jmp 0x40bc88
mov rax, qword [0x00506628]
lea rcx, str.__VirtualQuery_failed_for__d_bytes_at_address__p
mov edx, dword [r12 + 8]
mov r8, qword [rax + rsi + 0x18]
call sym.__report_error
lea rcx, str.Address__p_has_no_image_section
mov rdx, rbx
call sym.__report_error
nop
nop dword [rax]

Function at 0x40c4a0
Capabilities:
Get thread local storage value

Disassembly:
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x28
lea rcx, [0x00506900]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov rbx, qword [0x005068e0]
test rbx, rbx
je 0x40c4f4
mov rbp, qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov rdi, qword [sym.imp.KERNEL32.dll_GetLastError]
nop
mov ecx, dword [rbx]
call rbp
mov rsi, rax
call rdi
test eax, eax
jne 0x40c4eb
test rsi, rsi
je 0x40c4eb
mov rax, qword [rbx + 8]
mov rcx, rsi
call rax
mov rbx, qword [rbx + 0x10]
test rbx, rbx
jne 0x40c4d0
lea rcx, [0x00506900]
add rsp, 0x28
pop rbx
pop rsi
pop rdi
pop rbp
jmp qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
Function at 0x40c730
Capabilities:
Parse pe header

Disassembly:
cmp word [rcx], 0x5a4d
je 0x40c740
xor eax, eax
ret
jmp sym._ValidateImageBase.part.0

Function at 0x40c750
Capabilities:
Enumerate pe sections

Disassembly:
movsxd rax, dword [rcx + 0x3c]
add rcx, rax
movzx eax, word [rcx + 0x14]
lea rax, [rcx + rax + 0x18]
movzx ecx, word [rcx + 6]
test ecx, ecx
je 0x40c791
sub ecx, 1
lea rcx, [rcx + rcx*4]
lea r9, [rax + rcx*8 + 0x28]
mov r8d, dword [rax + 0xc]
cmp r8, rdx
mov rcx, r8
ja 0x40c788
add ecx, dword [rax + 8]
cmp rcx, rdx
ja 0x40c793
add rax, 0x28
cmp rax, r9
jne 0x40c774
xor eax, eax
ret

Function at 0x40c830
Capabilities:
Enumerate pe sections

Disassembly:
sub rsp, 0x28
mov r8, qword [0x004e4670]
cmp word [r8], 0x5a4d
mov rdx, rcx
jne 0x40c89d
mov rcx, r8
call sym._ValidateImageBase.part.0
test eax, eax
je 0x40c89d
movsxd rax, dword [r8 + 0x3c]
mov rcx, rdx
sub rcx, r8
add r8, rax
movzx edx, word [r8 + 6]
movzx eax, word [r8 + 0x14]
test edx, edx
lea rax, [r8 + rax + 0x18]
je 0x40c89d
sub edx, 1
lea rdx, [rdx + rdx*4]
lea r9, [rax + rdx*8 + 0x28]
nop
mov r8d, dword [rax + 0xc]
cmp rcx, r8
mov rdx, r8
jb 0x40c894
add edx, dword [rax + 8]
cmp rcx, rdx
jb 0x40c89f
add rax, 0x28
cmp rax, r9
jne 0x40c880
xor eax, eax
add rsp, 0x28
ret

Function at 0x40c9a0
Capabilities:
Enumerate pe sections

Disassembly:
sub rsp, 0x28
mov r8, qword [0x004e4670]
xor eax, eax
cmp word [r8], 0x5a4d
mov rdx, rcx
je 0x40c9c0
add rsp, 0x28
ret
mov rcx, r8
call sym._ValidateImageBase.part.0
test eax, eax
je 0x40c9b8
movsxd rax, dword [r8 + 0x3c]
mov rcx, rdx
sub rcx, r8
add r8, rax
movzx edx, word [r8 + 6]
movzx eax, word [r8 + 0x14]
test edx, edx
lea rax, [r8 + rax + 0x18]
je 0x40ca1d
sub edx, 1
lea rdx, [rdx + rdx*4]
lea r9, [rax + rdx*8 + 0x28]
nop dword [rax + rax]
mov r8d, dword [rax + 0xc]
cmp rcx, r8
mov rdx, r8
jb 0x40ca14
add edx, dword [rax + 8]
cmp rcx, rdx
jb 0x40ca24
add rax, 0x28
cmp rax, r9
jne 0x40ca00
xor eax, eax
add rsp, 0x28
ret
mov eax, dword [rax + 0x24]
not eax
shr eax, 0x1f
add rsp, 0x28
ret

Function at 0x40ca40
Capabilities:
Enumerate pe sections

Disassembly:
sub rsp, 0x28
mov r11, qword [0x004e4670]
cmp word [r11], 0x5a4d
mov r9d, ecx
jne 0x40caae
mov rcx, r11
call sym._ValidateImageBase.part.0
test eax, eax
je 0x40caae
movsxd rax, dword [r11 + 0x3c]
add rax, r11
mov edx, dword [rax + 0x90]
test edx, edx
je 0x40caae
movzx ecx, word [rax + 0x14]
lea rcx, [rax + rcx + 0x18]
movzx eax, word [rax + 6]
test eax, eax
je 0x40caae
sub eax, 1
lea rax, [rax + rax*4]
lea rax, [rcx + rax*8 + 0x28]
mov r10d, dword [rcx + 0xc]
cmp rdx, r10
mov r8, r10
jb 0x40caa5
add r8d, dword [rcx + 8]
cmp rdx, r8
jb 0x40cab5
add rcx, 0x28
cmp rcx, rax
jne 0x40ca90
xor eax, eax
add rsp, 0x28
ret
add rdx, r11
jne 0x40cac8
jmp 0x40caae
sub r9d, 1
add rdx, 0x14
mov ecx, dword [rdx + 4]
test ecx, ecx
jne 0x40cad6
mov eax, dword [rdx + 0xc]
test eax, eax
je 0x40caae
test r9d, r9d
jg 0x40cac0
mov eax, dword [rdx + 0xc]
add rax, r11
add rsp, 0x28
ret
Function at 0x40cbb0
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 0x40cbe0
mov rdx, rbx
mov ecx, eax
mov dword [rsi], eax
add rsp, 0x28
pop rbx
pop rsi
jmp sym.__mingwthr_key_dtor
add rsp, 0x28
pop rbx
pop rsi
jmp qword [sym.imp.KERNEL32.dll_GetLastError]

Function at 0x40cc10
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 0x40cc40
Capabilities:
Set thread local storage value

Disassembly:
sub rsp, 0x28
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
je 0x40cc55
xor eax, eax
add rsp, 0x28
ret
add rsp, 0x28
jmp qword [sym.imp.KERNEL32.dll_GetLastError]

Function at 0x40cf90
Capabilities:
Allocate thread local storage

Disassembly:
sub rsp, 0x28
call qword [sym.imp.KERNEL32.dll_TlsAlloc]
cmp eax, 0xffffffff
je 0x40cfc1
xor edx, edx
mov ecx, eax
mov dword [0x00506950], eax
call sym.__mingwthr_key_dtor
test eax, eax
sete al
movzx eax, al
mov dword [0x004dc068], eax
add rsp, 0x28
ret
call qword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x40cfae

Function at 0x40d0d0
Capabilities:
Set thread local storage value

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x38
mov edi, 1
mov rax, qword [rdx]
mov rbp, qword [rcx + 0x10]
mov r12, qword [rcx + 0x18]
test rax, rax
mov rsi, rcx
mov rbx, rdx
mov r15, r8
je 0x40d1d0
mov r13, qword [sym.imp.KERNEL32.dll_TlsSetValue]
jmp 0x40d12c
mov qword [0x00506958], r14
mov rax, qword [rbx]
add edi, 1
mov rax, qword [rax]
test rax, rax
mov qword [rbx], rax
je 0x40d1d0
mov r9, rsi
mov r8, qword [rsi]
mov edx, 0xa
mov ecx, 1
mov r14, qword [rax + 0x30]
mov qword [rsp + 0x28], r12
mov qword [rsp + 0x20], rbx
call rbp
test eax, eax
jne 0x40d1f0
test r14, r14
je 0x40d17f
mov qword [rsp + 0x20], rbx
mov r9, rsi
mov r8, qword [rsi]
mov edx, 0xa
mov ecx, 1
call r14
cmp eax, 7
je 0x40d215
cmp eax, 8
jne 0x40d1f0
mov rax, qword [rbx]
mov r14, qword [rax]
mov eax, dword [0x004dc068]
test eax, eax
js 0x40d1c0
test eax, eax
je 0x40d110
mov rdx, r14
mov ecx, dword [0x00506950]
call r13
test eax, eax
jne 0x40d117
call qword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x40d117
call dbg.fc_key_init_once
mov eax, dword [0x004dc068]
jmp 0x40d18f
mov qword [rsp + 0x28], r12
mov r9, rsi
mov r8, qword [rsi]
mov edx, 0x1a
mov qword [rsp + 0x20], rbx
mov ecx, 1
call rbp
test eax, eax
je 0x40d210
mov eax, 2
add rsp, 0x38
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov eax, 5
mov dword [r15], edi
jmp 0x40d1f5
Function at 0x40d220
Capabilities:
Get thread local storage value
Set thread local storage value

Disassembly:
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x28
mov eax, dword [0x004dc068]
test eax, eax
mov rbx, rcx
js 0x40d2a0
test eax, eax
jne 0x40d253
mov rax, qword [0x00506958]
mov qword [0x00506958], rbx
mov qword [rbx], rax
add rsp, 0x28
pop rbx
pop rsi
pop rdi
pop rbp
ret
mov edi, dword [0x00506950]
mov rsi, qword [sym.imp.KERNEL32.dll_GetLastError]
call rsi
mov ebp, eax
mov ecx, edi
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ecx, ebp
mov rdi, rax
call qword [sym.imp.KERNEL32.dll_SetLastError]
mov qword [rbx], rdi
mov rdx, rbx
mov ecx, dword [0x00506950]
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x40d24a
mov rax, rsi
add rsp, 0x28
pop rbx
pop rsi
pop rdi
pop rbp
jmp rax
call dbg.fc_key_init_once
mov eax, dword [0x004dc068]
jmp 0x40d235

Function at 0x40d2b0
Capabilities:
Set thread local storage value

Disassembly:
push rbx
sub rsp, 0x20
mov eax, dword [0x004dc068]
mov rbx, qword [rcx]
test eax, eax
js 0x40d2f2
test eax, eax
jne 0x40d2d3
mov qword [0x00506958], rbx
add rsp, 0x20
pop rbx
ret
mov rdx, rbx
mov ecx, dword [0x00506950]
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x40d2cd
add rsp, 0x20
pop rbx
jmp qword [sym.imp.KERNEL32.dll_GetLastError]
call dbg.fc_key_init_once
mov eax, dword [0x004dc068]
jmp 0x40d2c2

Function at 0x40d3c0
Capabilities:
Get thread local storage value

Disassembly:
push rdi
push rsi
push rbx
sub rsp, 0x40
mov eax, dword [0x004dc068]
test eax, eax
mov rbx, rcx
js 0x40d440
test eax, eax
mov rsi, qword [0x00506958]
jne 0x40d456
test rsi, rsi
mov qword [rsp + 0x38], rsi
je 0x40d431
lea rdi, [rsp + 0x38]
mov rax, rsi
mov rax, qword [rax + 0x30]
test rax, rax
je 0x40d41f
mov qword [rsp + 0x20], rdi
mov r9, rbx
mov r8, qword [rbx]
mov edx, 1
mov ecx, 1
call rax
cmp eax, 6
je 0x40d480
cmp eax, 8
jne 0x40d4b3
mov rax, qword [rsp + 0x38]
mov rax, qword [rax]
test rax, rax
mov qword [rsp + 0x38], rax
jne 0x40d3f1
mov eax, 5
add rsp, 0x40
pop rbx
pop rsi
pop rdi
ret
call dbg.fc_key_init_once
mov eax, dword [0x004dc068]
mov rsi, qword [0x00506958]
test eax, eax
je 0x40d3df
mov esi, dword [0x00506950]
call qword [sym.imp.KERNEL32.dll_GetLastError]
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]
jmp 0x40d3df
mov rax, qword [rsp + 0x38]
lea r8, [rsp + 0x34]
mov rdx, rdi
mov rcx, rbx
mov qword [rbx + 0x10], 0
mov qword [rsp + 0x38], rsi
mov qword [rbx + 0x18], rax
call dbg._Unwind_RaiseException_Phase2
cmp eax, 7
jne 0x40d436
mov rcx, rdi
call sym.uw_install_context.isra.5
mov eax, 3
jmp 0x40d436
Function at 0x40d4c0
Capabilities:
Get thread local storage value

Disassembly:
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x30
mov rbx, rcx
mov ecx, dword [0x004dc068]
mov rbp, rdx
mov rdi, r8
test ecx, ecx
js 0x40d520
test ecx, ecx
mov rsi, qword [0x00506958]
jne 0x40d536
mov qword [rsp + 0x28], rsi
lea rsi, [rsp + 0x28]
mov rcx, rbx
mov qword [rbx + 0x10], rbp
lea r8, [rsp + 0x24]
mov rdx, rsi
mov qword [rbx + 0x18], rdi
call dbg._Unwind_ForcedUnwind_Phase2
cmp eax, 7
je 0x40d55b
add rsp, 0x30
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
ret
call dbg.fc_key_init_once
mov ecx, dword [0x004dc068]
mov rsi, qword [0x00506958]
test ecx, ecx
je 0x40d4e8
mov esi, dword [0x00506950]
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r12d, eax
mov ecx, esi
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ecx, r12d
mov rsi, rax
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x40d4e8
mov rcx, rsi
call sym.uw_install_context.isra.5
nop
nop
nop word cs:[rax + rax]

Function at 0x40d600
Capabilities:
Get thread local storage value

Disassembly:
push rdi
push rsi
push rbx
sub rsp, 0x30
cmp qword [rcx + 0x10], 0
mov rbx, rcx
je 0x40d650
mov edx, dword [0x004dc068]
test edx, edx
js 0x40d660
test edx, edx
mov rsi, qword [0x00506958]
jne 0x40d676
mov qword [rsp + 0x28], rsi
lea rsi, [rsp + 0x28]
mov rcx, rbx
lea r8, [rsp + 0x24]
mov rdx, rsi
call dbg._Unwind_ForcedUnwind_Phase2
cmp eax, 7
jne 0x40d699
mov rcx, rsi
call sym.uw_install_context.isra.5
nop dword [rax]
call dbg._Unwind_SjLj_RaiseException
add rsp, 0x30
pop rbx
pop rsi
pop rdi
ret
call dbg.fc_key_init_once
mov edx, dword [0x004dc068]
mov rsi, qword [0x00506958]
test edx, edx
je 0x40d626
mov esi, dword [0x00506950]
call qword [sym.imp.KERNEL32.dll_GetLastError]
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]
jmp 0x40d626
call sym.abort
nop
nop

Function at 0x40d6c0
Capabilities:
Get thread local storage value

Disassembly:
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x38
mov eax, dword [0x004dc068]
test eax, eax
mov rsi, rcx
mov rbp, rdx
js 0x40d740
test eax, eax
mov rbx, qword [0x00506958]
jne 0x40d756
mov qword [rsp + 0x28], rbx
lea rdi, [rsp + 0x28]
jmp 0x40d709
mov rdx, rbp
mov rcx, rdi
call rsi
test eax, eax
jne 0x40d730
mov rax, qword [rsp + 0x28]
mov rbx, qword [rax]
mov qword [rsp + 0x28], rbx
test rbx, rbx
jne 0x40d6f0
mov rdx, rbp
mov rcx, rdi
call rsi
test eax, eax
jne 0x40d730
mov eax, 5
add rsp, 0x38
pop rbx
pop rsi
pop rdi
pop rbp
ret
mov eax, 3
add rsp, 0x38
pop rbx
pop rsi
pop rdi
pop rbp
ret
call dbg.fc_key_init_once
mov eax, dword [0x004dc068]
mov rbx, qword [0x00506958]
test eax, eax
je 0x40d6e3
mov ebx, dword [0x00506950]
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ecx, edi
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x40d6e3
Function at 0x40d860
Capabilities:
Allocate thread local storage

Disassembly:
sub rsp, 0x28
xor r9d, r9d
xor edx, edx
xor ecx, ecx
mov dword [0x00506970], 0xffffffff
mov r8d, 0xffff
call qword [sym.imp.KERNEL32.dll_CreateSemaphoreW]
mov qword [0x00506978], rax
call qword [sym.imp.KERNEL32.dll_TlsAlloc]
cmp eax, 0xffffffff
je 0x40d8b0
lea rdx, [dbg.emutls_destroy]
mov ecx, eax
mov dword [0x00506968], eax
call sym.__mingwthr_key_dtor
test eax, eax
jne 0x40d8ba
add rsp, 0x28
ret
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x40d8ab
call sym.abort
nop
Function at 0x40d8c0
Capabilities:
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 rbx, qword [0x004e3ae0]
mov r11d, dword [rbx]
mov rdi, rcx
test r11d, r11d
jne 0x40d8f4
mov rax, qword [rcx + 0x10]
test rax, rax
je 0x40d950
add rsp, 0x28
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
ret
mov rsi, qword [rcx + 0x10]
test rsi, rsi
je 0x40d960
mov ebx, dword [0x00506968]
mov r12, qword [sym.imp.KERNEL32.dll_GetLastError]
call r12
mov ebp, eax
mov ecx, ebx
call qword [sym.imp.KERNEL32.dll_TlsGetValue]
mov ecx, ebp
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_SetLastError]
test rbx, rbx
je 0x40d9d1
mov rbp, qword [rbx]
cmp rbp, rsi
jb 0x40da11
lea rbx, [rbx + rsi*8]
mov rax, qword [rbx]
test rax, rax
jne 0x40d8e7
mov rcx, rdi
call dbg.emutls_alloc
mov qword [rbx], rax
jmp 0x40d8e7
call dbg.emutls_alloc
mov qword [rdi + 0x10], rax
jmp 0x40d8e7
mov r10d, dword [rbx]
test r10d, r10d
je 0x40da72
mov r9d, dword [global_once]
test r9d, r9d
je 0x40daa0
lock add dword [0x00506970], 1
jne 0x40dad0
mov rsi, qword [rdi + 0x10]
test rsi, rsi
je 0x40da7f
mov eax, dword [rbx]
test eax, eax
je 0x40d8fd
mov eax, 0xffffffff
lock xadd dword [0x00506970], eax
sub eax, 1
js 0x40d8fd
xor r8d, r8d
mov edx, 1
mov rcx, qword [0x00506978]
call qword [sym.imp.KERNEL32.dll_ReleaseSemaphore]
jmp 0x40d8fd
lea rcx, [rsi + 0x21]
mov edx, 8
call sym.calloc
lea rbp, [rsi + 0x20]
test rax, rax
mov rbx, rax
je 0x40daf7
mov qword [rax], rbp
mov rdx, rbx
mov ecx, dword [0x00506968]
call qword [sym.imp.KERNEL32.dll_TlsSetValue]
test eax, eax
jne 0x40d937
call r12
jmp 0x40d937
lea r13, [rbp + rbp]
mov rcx, rbx
lea rax, [rsi + 0x20]
cmp rsi, r13
cmova r13, rax
lea rdx, [r13*8 + 8]
call sym.realloc
test rax, rax
mov rbx, rax
je 0x40daf7
mov qword [rax], r13
lea rcx, [rax + rbp*8 + 8]
sub r13, rbp
xor edx, edx
lea r8, [r13*8]
call sym.memset
jmp 0x40d9f2
call dbg.emutls_init
mov dword [global_once], 1
mov edx, dword [rbx]
test edx, edx
jne 0x40d97c
mov rsi, qword [rdi + 0x10]
test rsi, rsi
jne 0x40d8fd
mov rax, qword [0x00506960]
lea rsi, [rax + 1]
mov qword [0x00506960], rsi
mov qword [rdi + 0x10], rsi
jmp 0x40d997
lock add dword [0x004dc074], 1
je 0x40da59
mov r8d, dword [global_once]
lea rsi, [0x004dc070]
mov rbp, qword [sym.imp.KERNEL32.dll_Sleep]
test r8d, r8d
jne 0x40da68
xor ecx, ecx
call rbp
mov ecx, dword [rsi]
test ecx, ecx
je 0x40dac4
jmp 0x40da68
mov edx, 0xffffffff
mov rcx, qword [0x00506978]
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x40d98a
lock sub dword [0x00506970], 1
jmp 0x40d98a
call sym.abort
nop
nop dword [rax]
Function at 0x40dd20
Capabilities:
Check if file exists
Get file attributes

Disassembly:
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x138
mov rbx, rcx
call sym._errno
test rbx, rbx
mov dword [rax], 0
je 0x40deb0
cmp byte [rbx], 0
je 0x40de71
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_GetFileAttributesA]
cmp eax, 0xffffffff
je 0x40dea0
test al, 0x10
je 0x40de71
lea rdi, [rsp + 0x20]
mov rdx, rbx
mov r8d, 0x104
mov rcx, rdi
mov rbx, rdi
call sym._fullpath
mov edx, dword [rbx]
add rbx, 4
lea eax, [rdx - 0x1010101]
not edx
and eax, edx
and eax, 0x80808080
je 0x40dd7e
mov edx, eax
shr edx, 0x10
test eax, 0x8080
cmove eax, edx
lea rdx, [rbx + 2]
mov ecx, eax
cmove rbx, rdx
add cl, al
sbb rbx, 3
sub rbx, rdi
lea rcx, [rbx + 0x24b]
call sym.malloc
test rax, rax
mov rsi, rax
je 0x40de90
lea r9, [rax + 0x244]
mov rdx, rdi
lea rbp, [rbx + 1]
mov rcx, r9
mov r8, rbp
call sym.memcpy
cmp byte [rsi + 0x244], 0
mov r9, rax
jne 0x40de50
add rbx, rax
mov eax, 0x2a
mov ecx, 0x20
lea rdx, [rsi + 0x130]
mov word [rbx], ax
xor eax, eax
mov qword [rsi + 0x238], 0xffffffffffffffff
mov rdi, rdx
mov dword [rsi + 0x240], 0
mov qword [rsi + 0x128], 0
rep stosq qword [rdi], rax
mov dword [rdi], 0
mov rax, rsi
add rsp, 0x138
pop rbx
pop rsi
pop rdi
pop rbp
ret
movzx eax, byte [rsi + rbx + 0x243]
add rbx, r9
cmp al, 0x5c
je 0x40ddf5
cmp al, 0x2f
je 0x40ddf5
mov edx, 0x5c
mov word [rbx], dx
lea rbx, [r9 + rbp]
jmp 0x40ddf5
call sym._errno
xor esi, esi
mov dword [rax], 0x14
mov rax, rsi
add rsp, 0x138
pop rbx
pop rsi
pop rdi
pop rbp
ret
call sym._errno
mov dword [rax], 0xc
jmp 0x40de37
call sym._errno
xor esi, esi
mov dword [rax], 2
jmp 0x40de37
call sym._errno
xor esi, esi
mov dword [rax], 0xe
jmp 0x40de37

Function at 0x41abc0
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 0x41abec
movzx edx, byte [rsi + rax - 1]
mov dword [rbx + 0x48], edx
add rsp, 0x28
pop rbx
pop rsi
ret
Function at 0x41b960
Capabilities:
Write file on windows

Disassembly:
push rbp
sub rsp, 0xb0
lea rax, [sym.__gxx_personality_sj0]
mov qword [rsp + 0x60], rax
lea rax, [0x004f9398]
mov qword [rsp + 0x68], rax
lea rax, [rsp + 0xb0]
mov qword [rsp + 0x70], rax
lea rcx, [rsp + 0x30]
lea rax, [0x0041bb3f]
mov qword [rsp + 0x80], rsp
mov qword [rsp + 0x78], rax
call dbg._Unwind_SjLj_Register
cmp byte [0x004def20], 0
jne 0x41bb0d
mov byte [0x004def20], 1
call sym.__cxa_current_exception_type
test rax, rax
je 0x41bad3
mov rdx, qword [rax + 8]
lea r9, [rsp + 0xac]
xor eax, eax
cmp byte [rdx], 0x2a
mov dword [rsp + 0x38], 0xffffffff
mov dword [rsp + 0xac], 0xffffffff
sete al
xor r8d, r8d
add rdx, rax
mov rcx, rdx
mov qword [rsp + 0x98], rdx
xor edx, edx
call sym.__cxa_demangle
mov rdx, qword [sym.__acrt_iob_func]
mov ecx, 2
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], rdx
call rdx
mov edx, 1
mov r8d, 0x30
lea rcx, str.terminate_called_after_throwing_an_instance_of_
mov r9, rax
call sym.fwrite
mov edx, dword [rsp + 0xac]
mov ecx, 2
test edx, edx
je 0x41babd
mov dword [rsp + 0x38], 0xffffffff
mov rax, qword [rsp + 0x20]
call rax
mov rcx, qword [rsp + 0x98]
mov rdx, rax
call sym.fputs
mov ecx, 2
mov dword [rsp + 0x38], 0xffffffff
mov rax, qword [rsp + 0x20]
call rax
mov r8d, 2
mov edx, 1
lea rcx, [0x004df201]
mov r9, rax
call sym.fwrite
mov eax, dword [rsp + 0xac]
test eax, eax
jne 0x41bab0
mov rcx, qword [rsp + 0x28]
call sym.free
mov dword [rsp + 0x38], 1
call sym.__cxa_rethrow
mov rdx, qword [rsp + 0x20]
call rdx
mov rcx, qword [rsp + 0x28]
mov rdx, rax
call sym.fputs
jmp 0x41ba6d
mov ecx, 2
mov dword [rsp + 0x38], 0xffffffff
call qword [sym.__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
mov dword [rsp + 0x38], 0xffffffff
call sym.abort
mov ecx, 2
mov dword [rsp + 0x38], 0xffffffff
call qword [sym.__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
mov rax, qword [rsp + 0x40]
mov rdx, qword [rsp + 0x48]
mov qword [rsp + 0x28], rax
mov eax, dword [rsp + 0x38]
test eax, eax
jne 0x41bbe6
sub rdx, 1
mov rcx, qword [rsp + 0x28]
jne 0x41bc02
call sym.__cxa_begin_catch
mov rdx, qword [rax]
mov rcx, rax
call qword [rdx + 0x10]
mov ecx, 2
mov dword [rsp + 0x38], 2
mov qword [rsp + 0x28], rax
mov rax, qword [rsp + 0x20]
call rax
mov r9, rax
mov r8d, 0xb
mov edx, 1
lea rcx, str.__what__:
call sym.fwrite
mov ecx, 2
mov rax, qword [rsp + 0x20]
call rax
mov rcx, qword [rsp + 0x28]
mov rdx, rax
call sym.fputs
mov ecx, 2
mov rax, qword [rsp + 0x20]
call rax
mov rdx, rax
mov ecx, 0xa
call sym.fputc
call sym.__cxa_end_catch
jmp 0x41bb00
sub eax, 1
jne 0x41bc19
call sym.__cxa_end_catch
mov rcx, qword [rsp + 0x28]
mov dword [rsp + 0x38], 0xffffffff
call dbg._Unwind_SjLj_Resume
call sym.__cxa_begin_catch
mov dword [rsp + 0x38], 0xffffffff
call sym.__cxa_end_catch
jmp 0x41bb00
ud2