joyce8/EMBER2024-capa huggingface dataset:
Function at 0x477974
Capabilities:
Access peb ldr_data
Get ntdll base address

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0xcf24ca
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x14
mov dword [ebp - 0x10], esp
mov dword [ebp - 0x20], edi
mov dword [ebp - 0x1c], esi
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x14], ecx
push 0xffffffffffffffff
lea ecx, [ecx + 4]
call fcn.0047862c
mov edx, dword [ebp - 0x14]
mov dword [edx], 0xf448b4
xor eax, eax
mov dword [edx + 8], eax
mov dword [edx + 0xc], eax
mov dword [edx + 0x10], eax
mov dword [ebp - 4], 0
xor eax, eax
mov dword [edx + 0x14], eax
mov dword [edx + 0x18], eax
mov dword [edx + 0x1c], eax
mov dword [ebp - 4], 1
xor eax, eax
mov dword [edx + 0x20], eax
mov dword [edx + 0x24], eax
mov dword [edx + 0x28], eax
mov dword [ebp - 4], 2
xor eax, eax
mov dword [edx + 0x2c], eax
mov dword [edx + 0x30], eax
mov dword [edx + 0x34], eax
mov dword [ebp - 4], 3
xor eax, eax
mov dword [edx + 0x38], eax
mov dword [edx + 0x3c], eax
mov dword [edx + 0x40], eax
mov dword [ebp - 4], 4
xor eax, eax
mov dword [edx + 0x44], eax
mov dword [edx + 0x48], eax
mov dword [edx + 0x4c], eax
mov dword [ebp - 4], 5
xor eax, eax
mov dword [edx + 0x50], eax
mov dword [edx + 0x54], eax
mov dword [edx + 0x58], eax
mov dword [ebp - 4], 6
mov ecx, edx
mov dword [ecx + 0x5c], 0
call fcn.00477ad4
mov ebx, eax
mov eax, dword [ebp + 8]
test eax, eax
je 0x477abe
test ebx, ebx
jl 0x477a62
mov eax, dword [ebp - 0x14]
mov edx, dword [ebp + 8]
push 0x104
lea ecx, [eax + 0x60]
push edx
push ecx
call 0xd2ddd8
add esp, 0xc
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x477a83
mov eax, dword [ebp - 0x14]
mov edi, dword [ebp + 0x10]
lea esi, [eax + 0x164]
mov dl, byte [edi]
add edi, 1
mov byte [esi], dl
add esi, 1
test dl, dl
jne 0x477a75
push ebx
push 0x92
push 0xd272dc
push 0xd26b80
push 6
call fcn.00479444
add esp, 0x14
mov edx, dword [ebp + 0xc]
mov eax, dword [ebp - 0x14]
mov edi, dword [ebp - 0x20]
mov esi, dword [ebp - 0x1c]
mov dword [edx], ebx
mov ebx, dword [ebp - 0x18]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 0xc
push 0xd272ec
push 1
call fcn.00479444
add esp, 8
mov ebx, 0x80070057
jmp 0x477a62
Function at 0x48f584
Capabilities:
Access peb ldr_data
Get ntdll base address

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0xcf24ca
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x14
mov dword [ebp - 0x10], esp
mov dword [ebp - 0x20], edi
mov dword [ebp - 0x1c], esi
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x14], ecx
push 0xffffffffffffffff
lea ecx, [ecx + 4]
call fcn.0049023c
mov edx, dword [ebp - 0x14]
mov dword [edx], 0xf448b4
xor eax, eax
mov dword [edx + 8], eax
mov dword [edx + 0xc], eax
mov dword [edx + 0x10], eax
mov dword [ebp - 4], 0
xor eax, eax
mov dword [edx + 0x14], eax
mov dword [edx + 0x18], eax
mov dword [edx + 0x1c], eax
mov dword [ebp - 4], 1
xor eax, eax
mov dword [edx + 0x20], eax
mov dword [edx + 0x24], eax
mov dword [edx + 0x28], eax
mov dword [ebp - 4], 2
xor eax, eax
mov dword [edx + 0x2c], eax
mov dword [edx + 0x30], eax
mov dword [edx + 0x34], eax
mov dword [ebp - 4], 3
xor eax, eax
mov dword [edx + 0x38], eax
mov dword [edx + 0x3c], eax
mov dword [edx + 0x40], eax
mov dword [ebp - 4], 4
xor eax, eax
mov dword [edx + 0x44], eax
mov dword [edx + 0x48], eax
mov dword [edx + 0x4c], eax
mov dword [ebp - 4], 5
xor eax, eax
mov dword [edx + 0x50], eax
mov dword [edx + 0x54], eax
mov dword [edx + 0x58], eax
mov dword [ebp - 4], 6
mov ecx, edx
mov dword [ecx + 0x5c], 0
call fcn.0048f6e4
mov ebx, eax
mov eax, dword [ebp + 8]
test eax, eax
je 0x48f6ce
test ebx, ebx
jl 0x48f672
mov eax, dword [ebp - 0x14]
mov edx, dword [ebp + 8]
push 0x104
lea ecx, [eax + 0x60]
push edx
push ecx
call 0xd459e8
add esp, 0xc
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x48f693
mov eax, dword [ebp - 0x14]
mov edi, dword [ebp + 0x10]
lea esi, [eax + 0x164]
mov dl, byte [edi]
add edi, 1
mov byte [esi], dl
add esi, 1
test dl, dl
jne 0x48f685
push ebx
push 0x92
push 0xd272dc
push 0xd26b80
push 6
call fcn.00491054
add esp, 0x14
mov edx, dword [ebp + 0xc]
mov eax, dword [ebp - 0x14]
mov edi, dword [ebp - 0x20]
mov esi, dword [ebp - 0x1c]
mov dword [edx], ebx
mov ebx, dword [ebp - 0x18]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 0xc
push 0xd272ec
push 1
call fcn.00491054
add esp, 8
mov ebx, 0x80070057
jmp 0x48f672
Function at 0x4a6644
Capabilities:
Access peb ldr_data
Get ntdll base address

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0xcf24ca
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x14
mov dword [ebp - 0x10], esp
mov dword [ebp - 0x20], edi
mov dword [ebp - 0x1c], esi
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x14], ecx
push 0xffffffffffffffff
lea ecx, [ecx + 4]
call fcn.004a72fc
mov edx, dword [ebp - 0x14]
mov dword [edx], 0xf448b4
xor eax, eax
mov dword [edx + 8], eax
mov dword [edx + 0xc], eax
mov dword [edx + 0x10], eax
mov dword [ebp - 4], 0
xor eax, eax
mov dword [edx + 0x14], eax
mov dword [edx + 0x18], eax
mov dword [edx + 0x1c], eax
mov dword [ebp - 4], 1
xor eax, eax
mov dword [edx + 0x20], eax
mov dword [edx + 0x24], eax
mov dword [edx + 0x28], eax
mov dword [ebp - 4], 2
xor eax, eax
mov dword [edx + 0x2c], eax
mov dword [edx + 0x30], eax
mov dword [edx + 0x34], eax
mov dword [ebp - 4], 3
xor eax, eax
mov dword [edx + 0x38], eax
mov dword [edx + 0x3c], eax
mov dword [edx + 0x40], eax
mov dword [ebp - 4], 4
xor eax, eax
mov dword [edx + 0x44], eax
mov dword [edx + 0x48], eax
mov dword [edx + 0x4c], eax
mov dword [ebp - 4], 5
xor eax, eax
mov dword [edx + 0x50], eax
mov dword [edx + 0x54], eax
mov dword [edx + 0x58], eax
mov dword [ebp - 4], 6
mov ecx, edx
mov dword [ecx + 0x5c], 0
call fcn.004a67a4
mov ebx, eax
mov eax, dword [ebp + 8]
test eax, eax
je 0x4a678e
test ebx, ebx
jl 0x4a6732
mov eax, dword [ebp - 0x14]
mov edx, dword [ebp + 8]
push 0x104
lea ecx, [eax + 0x60]
push edx
push ecx
call 0xd5caa8
add esp, 0xc
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x4a6753
mov eax, dword [ebp - 0x14]
mov edi, dword [ebp + 0x10]
lea esi, [eax + 0x164]
mov dl, byte [edi]
add edi, 1
mov byte [esi], dl
add esi, 1
test dl, dl
jne 0x4a6745
push ebx
push 0x92
push 0xd272dc
push 0xd26b80
push 6
call fcn.004a8114
add esp, 0x14
mov edx, dword [ebp + 0xc]
mov eax, dword [ebp - 0x14]
mov edi, dword [ebp - 0x20]
mov esi, dword [ebp - 0x1c]
mov dword [edx], ebx
mov ebx, dword [ebp - 0x18]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
mov esp, ebp
pop ebp
ret 0xc
push 0xd272ec
push 1
call fcn.004a8114
add esp, 8
mov ebx, 0x80070057
jmp 0x4a6732
Function at 0x401690
Capabilities:
Create process on windows

Disassembly:
lea ecx, [esp + 4]
and esp, 0xfffffff0
push dword [ecx - 4]
push ebp
mov ebp, esp
push ebx
push ecx
lea ebx, [ebp - 0x10c]
sub esp, 0x190
mov dword [esp + 4], ebx
mov dword [esp + 8], 0x104
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea eax, [ebp - 0x164]
mov dword [ebp - 0x164], 0
sub esp, 0xc
mov dword [esp + 4], ebx
mov dword [esp], eax
call fcn.00401590
mov eax, dword [ebp - 0x164]
mov ebx, dword [sym.imp.msvcrt.dll__chdir]
mov dword [esp], eax
call ebx
mov dword [esp], str.bin_bbcpanel
call ebx
pxor xmm0, xmm0
lea eax, [ebp - 0x160]
mov dword [ebp - 0x150], 0x44
movups xmmword [ebp - 0x14c], xmm0
movups xmmword [ebp - 0x13c], xmm0
movups xmmword [ebp - 0x12c], xmm0
movups xmmword [ebp - 0x11c], xmm0
mov dword [esp + 0x24], eax
lea eax, [ebp - 0x150]
mov dword [esp + 0x20], eax
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 1
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], 0x42c083
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
sub esp, 0x28
test eax, eax
je 0x401798
lea esp, [ebp - 8]
xor eax, eax
pop ecx
pop ebx
pop ebp
lea esp, [ecx - 4]
ret 0x10
mov dword [esp + 0xc], 0x10
mov dword [esp + 8], str.Startup_Failure
mov dword [esp + 4], str.Unable_to_launch_application
mov dword [esp], 0
call dword [sym.imp.USER32.dll_MessageBoxA]
xor eax, eax
sub esp, 0x10
lea esp, [ebp - 8]
pop ecx
pop ebx
pop ebp
lea esp, [ecx - 4]
ret 0x10

Function at 0x40b3a0
Capabilities:
Write file on windows

Disassembly:
push ebx
sub esp, 0x18
mov dword [esp], 2
lea ebx, [esp + 0x24]
call fcn.00416260
mov dword [esp + 8], 0x1b
mov dword [esp + 0xc], eax
mov dword [esp + 4], 1
mov dword [esp], str.Mingw_w64_runtime_failure:_n
call sub.msvcrt.dll_fwrite
mov dword [esp], 2
call fcn.00416260
mov edx, dword [esp + 0x20]
mov dword [esp + 8], ebx
mov dword [esp], eax
mov dword [esp + 4], edx
call sub.msvcrt.dll_vfprintf
call sub.msvcrt.dll_abort
lea esi, [esi]
Function at 0x40b400
Capabilities:
Allocate or change rwx memory

Disassembly:
push edi
push esi
push ebx
mov ebx, eax
sub esp, 0x30
mov esi, dword [0x440068]
test esi, esi
jle 0x40b520
mov eax, dword [0x44006c]
xor ecx, ecx
add eax, 0xc
mov edx, dword [eax]
cmp ebx, edx
jb 0x40b434
mov edi, dword [eax + 4]
add edx, dword [edi + 8]
cmp ebx, edx
jb 0x40b4b7
add ecx, 1
add eax, 0x14
cmp ecx, esi
jne 0x40b420
mov dword [esp], ebx
call fcn.0040bde0
mov edi, eax
test eax, eax
je 0x40b547
mov eax, dword [0x44006c]
lea ebx, [esi + esi*4]
shl ebx, 2
add eax, ebx
mov dword [eax + 0x10], edi
mov dword [eax], 0
call fcn.0040bf20
mov edx, dword [0x44006c]
add eax, dword [edi + 0xc]
mov dword [edx + ebx + 0xc], eax
lea edx, [esp + 0x14]
mov dword [esp + 8], 0x1c
mov dword [esp + 4], edx
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_VirtualQuery]
sub esp, 0xc
test eax, eax
je 0x40b527
mov eax, dword [esp + 0x28]
lea edx, [eax - 0x40]
and edx, 0xffffffbf
je 0x40b4b0
lea edx, [eax - 4]
and edx, 0xfffffffb
jne 0x40b4c0
add dword [0x440068], 1
add esp, 0x30
pop ebx
pop esi
pop edi
ret
cmp eax, 2
mov edx, 4
mov eax, 0x40
mov ecx, dword [esp + 0x20]
cmove eax, edx
mov edx, dword [esp + 0x14]
add ebx, dword [0x44006c]
mov dword [ebx + 8], ecx
mov dword [ebx + 4], edx
mov dword [esp + 0xc], ebx
mov dword [esp + 8], eax
mov dword [esp + 4], ecx
mov dword [esp], edx
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
sub esp, 0x10
test eax, eax
jne 0x40b4b0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp], str.__VirtualProtect_failed_with_code_0x_x
mov dword [esp + 4], eax
call fcn.0040b3a0
lea esi, [esi]
lea esi, [esi]
xor esi, esi
jmp 0x40b43e
mov eax, dword [0x44006c]
mov eax, dword [eax + ebx + 0xc]
mov dword [esp + 8], eax
mov eax, dword [edi + 8]
mov dword [esp], str.__VirtualQuery_failed_for__d_bytes_at_address__p
mov dword [esp + 4], eax
call fcn.0040b3a0
mov dword [esp + 4], ebx
mov dword [esp], str.Address__p_has_no_image_section
call fcn.0040b3a0
lea esi, [esi]
nop

Function at 0x40ba50
Capabilities:
Get thread local storage value

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x1c
mov dword [esp], 0x440084
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ebx, dword [0x44007c]
sub esp, 4
test ebx, ebx
je 0x40baa5
mov ebp, dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
lea esi, [esi]
mov eax, dword [ebx]
mov dword [esp], eax
call ebp
sub esp, 4
mov esi, eax
call edi
test eax, eax
jne 0x40ba9e
test esi, esi
je 0x40ba9e
mov eax, dword [ebx + 4]
mov dword [esp], esi
call eax
mov ebx, dword [ebx + 8]
test ebx, ebx
jne 0x40ba80
mov dword [esp], 0x440084
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
sub esp, 4
add esp, 0x1c
pop ebx
pop esi
pop edi
pop ebp
ret
Function at 0x40bde0
Capabilities:
Parse pe header

Disassembly:
xor eax, eax
cmp word [0x400000], 0x5a4d
jne 0x40be05
mov ecx, dword [0x40003c]
cmp dword [ecx + 0x400000], 0x4550
lea edx, [ecx + 0x400000]
je 0x40be10
ret
cmp word [ecx + 0x400018], 0x10b
jne 0x40be05
push esi
movzx eax, word [ecx + 0x400014]
push ebx
movzx esi, word [ecx + 0x400006]
mov ebx, dword [esp + 0xc]
lea eax, [edx + eax + 0x18]
sub ebx, 0x400000
test si, si
je 0x40be58
xor ecx, ecx
mov edx, dword [eax + 0xc]
cmp ebx, edx
jb 0x40be4e
add edx, dword [eax + 8]
cmp ebx, edx
jb 0x40be5a
add ecx, 1
add eax, 0x28
cmp ecx, esi
jne 0x40be40
xor eax, eax
pop ebx
pop esi
ret
Function at 0x410dc0
Capabilities:
Terminate process

Disassembly:
sub esp, 0x1c
mov dword [esp + 8], 0x2d
mov dword [esp + 4], str._buffer_overflow_detected_:_terminated_n
mov dword [esp], 2
call sub.msvcrt.dll__write
mov dword [esp], 0x17
call sub.KERNEL32.dll_IsProcessorFeaturePresent
sub esp, 4
test eax, eax
je 0x410df9
mov ecx, 8
int 0x29
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov dword [esp + 4], 0xc0000409
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
push eax
push eax
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
nop
Function at 0x417400
Capabilities:
Print debug messages

Disassembly:
push edi
pxor xmm0, xmm0
lea edi, [esp + 8]
and esp, 0xfffffff0
push dword [edi - 4]
push ebp
mov ebp, esp
push edi
sub esp, 0x84
movups xmmword [ebp - 0x27], xmm0
movdqu xmm1, xmmword [str.Error_cleaning_up_spin_keys_for_thread]
movdqu xmm2, xmmword [0x42ec30]
movdqu xmm3, xmmword [0x42ec40]
movups xmmword [ebp - 0x47], xmm0
mov eax, dword [0x440b04]
mov dword [ebp - 0xc], eax
xor eax, eax
movups xmmword [ebp - 0x77], xmm1
movups xmmword [ebp - 0x67], xmm2
movups xmmword [ebp - 0x57], xmm3
movups xmmword [ebp - 0x37], xmm0
movups xmmword [ebp - 0x1c], xmm0
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
lea edx, [ebp - 0x50]
mov dword [esp + 8], 0xa
mov dword [esp + 4], edx
mov dword [esp], eax
call dword [sym.imp.msvcrt.dll__ultoa]
cmp byte [ebp - 0x50], 0
je 0x4174bb
mov eax, 0x27
lea edx, [ebp - 0x77]
jmp 0x41748d
cmp eax, 0x6a
je 0x4174aa
mov ecx, eax
add eax, 1
cmp byte [edx + eax], 0
jne 0x417488
cmp eax, 0x6a
je 0x4174aa
add ecx, 2
mov byte [ebp + eax - 0x77], 0xa
mov byte [ebp + ecx - 0x77], 0
mov dword [esp], edx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
sub esp, 4
call sub.msvcrt.dll_abort
mov ecx, 0x28
mov eax, 0x27
lea edx, [ebp - 0x77]
jmp 0x4174a0

Function at 0x417840
Capabilities:
Allocate thread local storage

Disassembly:
cmp dword [0x440aec], 1
je 0x4178f8
push edi
mov eax, 0x440aec
push esi
push ebx
sub esp, 0x10
call fcn.004171e0
lea esi, [eax + 4]
mov ebx, eax
mov dword [esp], esi
call fcn.00416ae0
mov edi, dword [0x440aec]
test edi, edi
jne 0x4178b0
call dword [sym.imp.KERNEL32.dll_TlsAlloc]
mov dword [0x42b060], eax
cmp eax, 0xffffffff
je 0x42aa41
mov dword [0x440aec], 1
mov dword [esp], esi
call fcn.00416e20
test ebx, ebx
je 0x4178ea
add esp, 0x10
mov eax, ebx
pop ebx
pop esi
pop edi
jmp fcn.004174d0
cmp edi, 1
je 0x417892
mov dword [esp], 2
call dword [0x42b048]
mov dword [esp + 0xc], edi
mov dword [esp + 8], 0x440aec
mov dword [esp + 4], str._once__p_is__d_n
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov dword [esp], esi
call fcn.00416e20
test ebx, ebx
jne 0x41789e
add esp, 0x10
pop ebx
pop esi
pop edi
ret
ret
Function at 0x417900
Capabilities:
Set thread local storage value

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x2c
call fcn.004175c0
mov edx, dword [entry3]
test edx, edx
je 0x417a30
mov ebx, eax
test eax, eax
je 0x417a30
mov dword [eax + 0x24], 1
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov dword [ebx + 0x3c], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 1
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov dword [ebx + 0x1c], 0xffffffff
mov dword [ebx + 0x18], eax
sub esp, 0x10
lea eax, [ebx + 0x38]
mov dword [esp], eax
call fcn.0041af20
cmp eax, 1
je 0x417a3c
mov ebp, dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov dword [ebx + 0x38], 0xffffffff
mov dword [ebx + 0x64], 0
mov dword [ebx + 0x14], 0
call ebp
mov edi, eax
call dword [sym.imp.KERNEL32.dll_GetCurrentThread]
mov esi, eax
call ebp
lea edx, [ebx + 0x14]
mov dword [esp + 8], edi
mov dword [esp + 0x18], 2
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], edx
mov dword [esp + 4], esi
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_DuplicateHandle]
sub esp, 0x1c
test eax, eax
je fcn.0042aa46
mov eax, dword [ebx + 0x14]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_GetThreadPriority]
mov dword [ebx + 0x68], 0
mov dword [ebx + 0x6c], eax
movzx eax, byte [ebx + 0x20]
sub esp, 4
and eax, 0xffffffcf
or eax, 0x10
mov byte [ebx + 0x20], al
mov eax, dword [0x42b060]
mov dword [esp + 4], ebx
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
sub esp, 8
test eax, eax
je 0x417a41
add esp, 0x2c
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
add esp, 0x2c
xor ebx, ebx
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
call fcn.00417400
jmp fcn.0042aa46

Function at 0x417a50
Capabilities:
Get thread local storage value
Set thread local storage value

Disassembly:
sub esp, 0x1c
call fcn.00417840
mov eax, dword [0x42b060]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
test eax, eax
je 0x417a78
add esp, 0x1c
ret
add esp, 0x1c
jmp fcn.00417900
Function at 0x417d40
Capabilities:
Get thread local storage value
Set thread local storage value

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x1c
mov eax, dword [esp + 0x34]
test eax, eax
jne 0x417d70
mov ecx, dword [esp + 0x38]
test ecx, ecx
je 0x417e40
add esp, 0x1c
mov eax, 1
pop ebx
pop esi
pop edi
pop ebp
ret 0xc
cmp eax, 1
je 0x417e70
cmp eax, 3
jne 0x417d5b
mov eax, dword [0x42b060]
cmp eax, 0xffffffff
je 0x417d5b
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
mov ebx, eax
test eax, eax
je 0x417d5b
lea esi, [eax + 0x1c]
lea edi, [eax + 0x38]
test byte [eax + 0x20], 0x30
je 0x417ea0
mov eax, dword [eax + 0xb4]
test eax, eax
je 0x417db9
call fcn.00417a80
mov eax, dword [ebx + 0x14]
test eax, eax
je 0x417deb
mov dword [esp], eax
mov ebp, dword [sym.imp.KERNEL32.dll_CloseHandle]
call ebp
mov eax, dword [ebx + 0x18]
sub esp, 4
test eax, eax
je 0x417ddd
mov dword [esp], eax
call ebp
sub esp, 4
mov dword [ebx + 0x14], 0
mov dword [ebx + 0x18], 0
mov dword [esp], esi
call fcn.00416fa0
mov dword [esp], edi
call fcn.0041af20
cmp eax, 1
je 0x417f66
mov eax, dword [ebx + 0xb0]
mov dword [ebx + 0x38], 0xffffffff
test eax, eax
je 0x417f5a
mov eax, dword [0x42b060]
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsSetValue]
sub esp, 8
jmp 0x417d5b
mov eax, dword [0x440ac8]
test eax, eax
je 0x417d5b
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_RemoveVectoredExceptionHandler]
mov dword [0x440ac8], 0
sub esp, 4
jmp 0x417d5b
mov dword [esp + 4], 0x417150
mov dword [esp], 1
call dword [sym.imp.KERNEL32.dll_AddVectoredExceptionHandler]
sub esp, 8
mov dword [0x440ac8], eax
mov eax, 1
add esp, 0x1c
pop ebx
pop esi
pop edi
pop ebp
ret 0xc
mov edx, dword [ebx + 0x68]
mov eax, dword [eax + 0x18]
test edx, edx
jne 0x417f10
test eax, eax
je 0x417eba
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
sub esp, 4
mov eax, dword [ebx + 0xb4]
mov dword [ebx + 0x18], 0
mov dword [ebx + 0x68], 1
test eax, eax
je 0x417ed7
call fcn.00417a80
test byte [ebx + 0x24], 4
je 0x417f50
mov eax, dword [ebx + 0x14]
mov dword [ebx], 0xdeadbeef
test eax, eax
je 0x417deb
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebx + 0x14], 0
sub esp, 4
mov dword [esp], esi
call fcn.00416fa0
jmp 0x417df3
test eax, eax
je 0x417f50
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [ebx + 0x18], 0
sub esp, 4
mov dword [esp], esi
call fcn.00416fa0
mov dword [esp], edi
call fcn.0041af20
cmp eax, 1
je 0x417f66
mov dword [ebx + 0x38], 0xffffffff
jmp 0x417d5b
mov dword [esp], esi
call fcn.00416fa0
jmp 0x417f2f
mov eax, ebx
call fcn.00417680
jmp 0x417e19
call fcn.00417400
lea esi, [esi]
nop
Function at 0x418240
Capabilities:
Get thread local storage value

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x3c
mov ebx, dword [esp + 0x50]
mov edi, dword [esp + 0x54]
mov eax, dword [0x440b04]
mov dword [esp + 0x2c], eax
mov eax, dword [ebx]
test edi, edi
je 0x418380
cmp eax, 1
je 0x4182a5
mov eax, ebx
call fcn.004171e0
mov esi, eax
lea eax, [eax + 4]
mov dword [esp], eax
mov dword [esp + 0x1c], eax
call fcn.00416ae0
mov ebp, dword [ebx]
test ebp, ebp
je 0x4182c0
cmp ebp, 1
jne 0x418350
mov eax, dword [esp + 0x1c]
mov dword [esp], eax
call fcn.00416e20
test esi, esi
je 0x4182a5
mov eax, esi
call fcn.004174d0
xor eax, eax
mov edx, dword [esp + 0x2c]
sub edx, dword [0x440b04]
jne 0x4183ca
add esp, 0x3c
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 0x20], 0x417590
mov dword [esp + 0x24], esi
call fcn.00417840
mov eax, dword [0x42b060]
mov ebp, dword [sym.imp.KERNEL32.dll_TlsGetValue]
mov dword [esp], eax
call ebp
sub esp, 4
test eax, eax
je 0x4183b8
mov eax, dword [eax + 0xc]
mov dword [esp + 0x28], eax
lock or dword [esp], 0
call fcn.00417840
mov eax, dword [0x42b060]
mov dword [esp], eax
call ebp
sub esp, 4
test eax, eax
je 0x4183a0
lea ecx, [esp + 0x20]
mov dword [eax + 0xc], ecx
lock or dword [esp], 0
call edi
call fcn.00417840
mov eax, dword [0x42b060]
mov dword [esp], eax
call ebp
sub esp, 4
test eax, eax
je 0x418390
mov edx, dword [esp + 0x28]
mov dword [eax + 0xc], edx
mov dword [ebx], 1
jmp 0x41828e
mov dword [esp], 2
call dword [0x42b048]
mov dword [esp + 0xc], ebp
mov dword [esp + 8], ebx
mov dword [esp + 4], str._once__p_is__d_n
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
jmp 0x41828e
mov eax, 0x16
jmp 0x4182a7
call fcn.00417900
test eax, eax
jne 0x418336
jmp 0x42aa6b
call fcn.00417900
test eax, eax
jne 0x418312
jmp 0x42aa60
call fcn.00417900
test eax, eax
jne 0x4182ec
jmp 0x42aa59
call fcn.0041c6f0
nop
mov eax, dword [pe_dos_header]
ud2
lea eax, [esp + 0x20]
mov dword [0], eax
ud2
mov eax, dword [esp + 0x28]
mov dword [0], eax
ud2

Function at 0x418610
Capabilities:
Get thread local storage value

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x1c
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
call fcn.00417840
mov eax, dword [0x42b060]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_TlsGetValue]
sub esp, 4
mov ebx, eax
test eax, eax
je 0x418688
lea ebp, [ebx + 0x38]
xor edi, edi
mov dword [esp], ebp
call fcn.0041af30
mov eax, dword [ebx + 0x28]
cmp dword [esp + 0x30], eax
jae 0x418664
mov eax, dword [ebx + 0x30]
mov edx, dword [esp + 0x30]
cmp byte [eax + edx], 0
je 0x418664
mov eax, dword [ebx + 0x2c]
mov edi, dword [eax + edx*4]
mov dword [esp], ebp
call fcn.0041af80
mov dword [esp], esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, edi
sub esp, 4
add esp, 0x1c
pop ebx
pop esi
pop edi
pop ebp
ret
call fcn.00417900
mov ebx, eax
jmp 0x41863b