joyce8/EMBER2024-capa huggingface dataset:
Function at 0x40eaf0
Capabilities:
Inspect section memory permissions

Disassembly:
push ebp
mov ebp, esp
lea esp, [esp - 0x7c]
push ebx
push esi
push edi
mov dword [ebp - 0x24], 1
mov dword [ebp - 0x20], 8
mov dword [ebp - 0x1c], 2
mov dword [ebp - 0x18], 4
mov dword [ebp - 0x14], 0x10
mov dword [ebp - 0x10], pe_nt_image_headers32
mov dword [ebp - 0xc], 0x20
mov dword [ebp - 8], 0x40
mov ecx, dword [eax + 0x30]
mov dword [ebp - 0x7c], 0
mov dword [ebp - 0x78], eax
mov edx, dword [eax + 0x30]
mov eax, dword [ecx + 0x3c]
lea eax, [edx + eax]
movzx edx, word [eax + 6]
add eax, 0xf8
mov dword [ebp - 0x74], eax
lea eax, [edx - 1]
mov dword [ebp - 0x70], eax
mov dword [ebp - 0x6c], 0
mov eax, dword [ebp - 0x70]
cmp eax, dword [ebp - 0x6c]
jb 0x40ec75
sub dword [ebp - 0x6c], 1
lea esi, [esi]
add dword [ebp - 0x6c], 1
imul eax, dword [ebp - 0x6c], 0x28
mov edx, dword [ebp - 0x74]
lea esi, [eax + edx]
lea edi, [ebp - 0x4c]
mov ecx, 0xa
rep movsd dword es:[edi], dword [esi]
mov eax, dword [ebp - 0x44]
mov edx, dword [ebp - 0x7c]
or edx, eax
mov dword [ebp - 0x58], edx
mov eax, dword [ebp - 0x3c]
mov dword [ebp - 0x50], eax
test dword [ebp - 0x50], 0xffffffff
je 0x40ec69
mov ebx, dword [ebp - 0x28]
mov eax, ebx
and eax, 0x2000000
je 0x40ebcc
push 0x4000
push dword [ebp - 0x50]
push dword [ebp - 0x58]
mov esi, dword [ebp - 0x78]
call dword [esi + 8]
jmp 0x40ec69
mov eax, ebx
and eax, 0x20000000
je 0x40ebde
mov dword [ebp - 0x68], 1
jmp 0x40ebe5
mov dword [ebp - 0x68], 0
mov eax, ebx
and eax, 0x40000000
je 0x40ebf7
mov dword [ebp - 0x64], 1
jmp 0x40ebfe
mov dword [ebp - 0x64], 0
mov eax, ebx
and eax, 0x80000000
je 0x40ec10
mov dword [ebp - 0x60], 1
jmp 0x40ec17
mov dword [ebp - 0x60], 0
mov eax, ebx
and eax, 0x4000000
je 0x40ec29
mov dword [ebp - 0x5c], 1
jmp 0x40ec30
mov dword [ebp - 0x5c], 0
mov eax, dword [ebp - 0x68]
shl eax, 4
lea eax, [ebp + eax - 0x24]
mov edx, dword [ebp - 0x64]
lea ecx, [eax + edx*8]
mov eax, dword [ebp - 0x60]
mov eax, dword [ecx + eax*4]
mov dword [ebp - 0x54], eax
cmp dword [ebp - 0x5c], 1
jne 0x40ec56
or dword [ebp - 0x54], 0x200
lea eax, [ebp - 4]
push eax
push dword [ebp - 0x54]
push dword [ebp - 0x50]
push dword [ebp - 0x58]
mov esi, dword [ebp - 0x78]
call dword [esi + 4]
mov eax, dword [ebp - 0x70]
cmp eax, dword [ebp - 0x6c]
ja 0x40eb74
pop edi
pop esi
pop ebx
leave
ret
Function at 0x403afb
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
push ecx
and dword [ebp - 4], 0
push esi
mov esi, ecx
cmp dword [esi + 4], 0
je 0x403b33
lea eax, [ebp - 4]
push eax
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_GetExitCodeThread]
cmp dword [ebp - 4], 0x103
jne 0x403b26
xor al, al
jmp 0x403b57
push dword [esi + 4]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
and dword [esi + 4], 0
lea eax, [ebp - 4]
push eax
push 0x10000
push dword [ebp + 0xc]
push dword [ebp + 8]
push dword [ebp + 0x10]
push 0
call fcn.0042a96c
add esp, 0x18
mov dword [esi + 4], eax
test eax, eax
setne al
pop esi
leave
ret 0xc

Function at 0x403c53
Capabilities:
Set registry value

Disassembly:
push ebp
mov ebp, esp
push ecx
test ecx, ecx
je 0x403cbc
test edx, edx
je 0x403cbc
cmp dword [ebp + 8], 0
je 0x403cbc
cmp dword [ebp + 0x10], 0
je 0x403cbc
cmp dword [ebp + 0x14], 0
je 0x403cbc
push ebx
lea eax, [ebp - 4]
xor ebx, ebx
push eax
push 0x20106
push ebx
push edx
push ecx
mov dword [ebp - 4], ebx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x403cb7
push esi
push dword [ebp + 0x14]
xor esi, esi
push dword [ebp + 0x10]
inc esi
push esi
push ebx
push dword [ebp + 8]
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
push dword [ebp - 4]
test eax, eax
movzx ebx, bl
cmove ebx, esi
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop esi
mov al, bl
pop ebx
leave
ret
xor al, al
leave
ret

Function at 0x403d81
Capabilities:
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
push ecx
push ebx
push esi
mov esi, dword [ebp + 0xc]
test esi, esi
je 0x403df3
cmp dword [ebp + 0x10], 4
jb 0x403df3
xor ebx, ebx
mov dword [esi], ebx
test ecx, ecx
je 0x403df3
test edx, edx
je 0x403df3
cmp dword [ebp + 8], ebx
je 0x403df3
lea eax, [ebp + 0xc]
mov dword [ebp + 0xc], ebx
push eax
mov eax, dword [ebp + 0x14]
or eax, 0x20019
mov dword [ebp - 4], ebx
push eax
push ebx
push edx
push ecx
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x403def
lea eax, [ebp + 0x10]
push eax
push esi
lea eax, [ebp - 4]
push eax
push ebx
push dword [ebp + 8]
push dword [ebp + 0xc]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
push dword [ebp + 0xc]
xor edx, edx
movzx ebx, bl
inc edx
test eax, eax
cmove ebx, edx
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov al, bl
jmp 0x403df5
xor al, al
pop esi
pop ebx
leave
ret
Function at 0x4045b7
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
mov eax, ecx
push esi
push edi
mov dword [ebp - 0x10], eax
cmp dword [eax + 4], 0xffffffff
je 0x404659
cmp dword [ebp + 8], 0
je 0x404659
cmp dword [ebp + 0x10], 0
ja 0x4045e4
cmp dword [ebp + 0xc], 1
jb 0x404659
xorps xmm0, xmm0
movlpd qword [ebp - 0xc], xmm0
mov edi, dword [ebp - 8]
mov esi, dword [ebp - 0xc]
and dword [ebp - 8], 0
mov ecx, dword [ebp + 0xc]
mov eax, dword [ebp + 0x10]
sub ecx, esi
sbb eax, edi
test eax, eax
jb 0x404617
ja 0x40460e
cmp ecx, 0xfffffff
jbe 0x404617
mov eax, 0xfffffff
mov ecx, esi
jmp 0x40461e
mov eax, dword [ebp + 0xc]
mov ecx, esi
sub eax, ecx
push 0
lea edx, [ebp - 8]
push edx
push eax
mov eax, dword [ebp + 8]
add eax, ecx
push eax
mov eax, dword [ebp - 0x10]
push dword [eax + 4]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x404653
cmp dword [ebp - 8], 0
je 0x404653
add esi, dword [ebp - 8]
adc edi, 0
cmp edi, dword [ebp + 0x10]
jb 0x4045f2
ja 0x404653
cmp esi, dword [ebp + 0xc]
jb 0x4045f2
mov eax, esi
mov edx, edi
jmp 0x40465d
xor eax, eax
xor edx, edx
pop edi
pop esi
leave
ret 0xc

Function at 0x40478e
Capabilities:
Encode data using base64

Disassembly:
sub esp, 0xc
push ebx
push ebp
push esi
xor esi, esi
mov ebp, ecx
and dword [esp + 0x10], esi
mov ebx, edx
push edi
xor edi, edi
test ebp, ebp
je 0x4048b5
mov edx, dword [esp + 0x20]
test edx, edx
je 0x4048b5
mov byte [edx], 0
test ebx, ebx
je 0x4048ac
mov eax, dword [esp + 0x24]
add eax, 0xfffffff8
mov dword [esp + 0x18], eax
cmp esi, eax
jae 0x4048ac
mov ch, byte [edi + ebp]
inc edi
cmp edi, ebx
jb 0x4047ed
xor al, al
mov dword [esp + 0x14], 2
xor cl, cl
mov byte [esp + 0x11], cl
jmp 0x40480b
mov al, byte [edi + ebp]
inc edi
mov byte [esp + 0x11], al
mov cl, al
cmp edi, ebx
jae 0x404801
mov al, byte [edi + ebp]
inc edi
jmp 0x40480b
xor al, al
mov dword [esp + 0x14], 1
mov byte [esp + 0x12], al
and cl, 0xf
shr al, 6
shl cl, 2
or cl, al
movzx eax, ch
shr eax, 2
and ch, 3
shl ch, 4
mov byte [esp + 0x13], cl
movzx ecx, ch
mov al, byte [eax + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
mov byte [esi + edx], al
movzx eax, byte [esp + 0x11]
shr eax, 4
or ecx, eax
mov al, byte [ecx + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
mov byte [esi + edx + 1], al
add esi, 2
mov eax, dword [esp + 0x14]
sub eax, 0
je 0x40487d
sub eax, 1
je 0x404868
sub eax, 1
jne 0x4048a0
mov word [esi + edx], 0x3d3d
jmp 0x40489d
movzx eax, byte [esp + 0x13]
mov al, byte [eax + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
mov byte [esi + edx], al
mov byte [esi + edx + 1], 0x3d
jmp 0x40489d
movzx eax, byte [esp + 0x13]
mov al, byte [eax + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
mov byte [esi + edx], al
movzx eax, byte [esp + 0x12]
and eax, 0x3f
mov al, byte [eax + str.ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_]
mov byte [esi + edx + 1], al
add esi, 2
mov eax, dword [esp + 0x18]
cmp edi, ebx
jb 0x4047cb
mov byte [esi + edx], 0
lea eax, [esi + 1]
jmp 0x4048b7
xor eax, eax
pop edi
pop esi
pop ebp
pop ebx
add esp, 0xc
ret
Function at 0x404b2c
Capabilities:
Decrypt data via sspi

Disassembly:
sub esp, 0x40
push ebx
push ebp
push esi
mov esi, ecx
push edi
mov ecx, dword [esi + 0xfac]
test ecx, ecx
je 0x404d24
mov edi, dword [esi + 0xfb0]
test edi, edi
je 0x404d24
mov eax, dword [esi + 0xfb8]
xorps xmm0, xmm0
sub edi, eax
movlpd qword [esp + 0x34], xmm0
xor ebx, ebx
movlpd qword [esp + 0x40], xmm0
inc ebx
mov dword [esp + 0x20], edi
lea ebp, [eax + ecx]
mov dword [esp + 0x24], ebx
xor eax, eax
mov dword [esp + 0x28], ebp
mov dword [esp + 0x2c], eax
mov dword [esp + 0x4c], eax
mov dword [esp + 0x30], eax
mov dword [esp + 0x3c], eax
mov dword [esp + 0x48], eax
mov dword [esp + 0x14], eax
lea eax, [esp + 0x20]
mov dword [esp + 0x1c], eax
lea eax, [esi + 0xf84]
push eax
mov dword [esp + 0x1c], 4
mov dword [esp + 0x14], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push 0
push 0
lea eax, [esp + 0x1c]
push eax
lea eax, [esi + 0xf9c]
push eax
call dword [sym.imp.Secur32.dll_DecryptMessage]
cmp eax, 0x80090318
je 0x404cec
cmp eax, 0x90317
jne 0x404c21
cmp dword [esi + 8], 0xffffffff
mov eax, dword [esi + 0xfb8]
mov dword [esi + 0xfb0], eax
je 0x404c5f
push str.tls___socket_closed_in_decrypt_message
lea ecx, [esi + 0x228]
mov edx, 0xff
call fcn.00403df9
push 2
push dword [esi + 8]
call dword [sym.imp.WS2_32.dll_shutdown]
push dword [esi + 8]
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [esi + 8], 0xffffffff
jmp 0x404c5f
cmp eax, 0x80090308
jne 0x404c3f
push str.tls___invalid_token_in_decrypt_message
lea ecx, [esi + 0x228]
mov edx, 0xff
call fcn.00403df9
jmp 0x404c5d
test eax, eax
je 0x404c71
push eax
push str.tls___decrypt_message_failed___d_status
lea eax, [esi + 0x228]
push 0xff
push eax
call fcn.00403c17
add esp, 0x10
xor bl, bl
mov eax, dword [esp + 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov al, bl
jmp 0x404d26
push 4
lea edi, [esp + 0x24]
pop ebp
cmp dword [edi + 4], ebx
jne 0x404c9f
push dword [edi]
mov eax, dword [esi + 0xfac]
push dword [edi + 8]
add eax, dword [esi + 0xfb8]
push eax
call fcn.0041c6f0
mov eax, dword [edi]
add esp, 0xc
add dword [esi + 0xfb8], eax
add edi, 0xc
sub ebp, 1
jne 0x404c78
push 5
pop eax
cmp dword [esp + 0x24], eax
jne 0x404cba
lea edi, [esp + 0x20]
lea eax, [esp + 0x28]
jmp 0x404ce8
cmp dword [esp + 0x30], eax
jne 0x404cca
lea edi, [esp + 0x2c]
lea eax, [esp + 0x34]
jmp 0x404ce8
cmp dword [esp + 0x3c], eax
jne 0x404cda
lea edi, [esp + 0x38]
lea eax, [esp + 0x40]
jmp 0x404ce8
cmp dword [esp + 0x48], eax
jne 0x404d20
lea edi, [esp + 0x44]
lea eax, [esp + 0x4c]
mov ebp, dword [eax]
mov edi, dword [edi]
test edi, edi
je 0x404d07
mov eax, dword [esi + 0xfac]
add eax, dword [esi + 0xfb8]
push edi
push ebp
push eax
call fcn.0041c6f0
add esp, 0xc
mov ecx, dword [esi + 0xfb8]
lea eax, [esi + 0xf84]
add ecx, edi
mov dword [esi + 0xfb0], ecx
jmp 0x404c63
xor edi, edi
jmp 0x404d07
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x40
ret
Function at 0x404fe4
Capabilities:
Encrypt data via sspi

Disassembly:
sub esp, 0x3c
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x50]
mov esi, ecx
test edi, edi
je 0x4050c1
mov ecx, dword [esi + 0xfc4]
mov edx, dword [esi + 0xfc0]
lea eax, [edx + ecx]
cmp dword [esp + 0x54], eax
jb 0x4050c1
mov ebp, dword [esp + 0x58]
lea eax, [edx + edi]
mov dword [esp + 0x30], eax
xor ebx, ebx
mov eax, dword [esp + 0x54]
sub eax, edx
mov dword [esp + 0x40], ebx
sub eax, ecx
mov dword [ebp], ebx
mov dword [esp + 0x28], eax
mov eax, edi
sub eax, ecx
mov dword [esp + 0x48], ebx
add eax, dword [esp + 0x54]
mov dword [esp + 0x44], ebx
mov dword [esp + 0x10], ebx
lea ebx, [esi + 0xf84]
mov dword [esp + 0x3c], eax
lea eax, [esp + 0x1c]
push ebx
mov dword [esp + 0x28], edi
mov dword [esp + 0x20], edx
mov dword [esp + 0x24], 7
mov dword [esp + 0x30], 1
mov dword [esp + 0x38], ecx
mov dword [esp + 0x3c], 6
mov dword [esp + 0x18], 4
mov dword [esp + 0x1c], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
push 0
lea eax, [esp + 0x14]
push eax
push 0
lea eax, [esi + 0xf9c]
push eax
call dword [sym.imp.Secur32.dll_EncryptMessage]
test eax, eax
je 0x4050cd
push str.tls___encrypt_message_failed
lea ecx, [esi + 0x228]
mov edx, 0xff
call fcn.00403df9
push ebx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3c
ret 0xc
mov eax, dword [esp + 0x1c]
cmp eax, dword [esi + 0xfc0]
jae 0x405108
push dword [esp + 0x28]
add eax, edi
push dword [esp + 0x34]
push eax
call fcn.0041c6f0
push dword [esp + 0x40]
mov eax, dword [esp + 0x38]
add eax, dword [esp + 0x2c]
push dword [esp + 0x4c]
add eax, edi
push eax
call fcn.0041c6f0
mov eax, dword [esp + 0x34]
add esp, 0x18
mov ecx, dword [esp + 0x34]
add ecx, dword [esp + 0x28]
add ecx, eax
push ebx
mov dword [ebp], ecx
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov al, 1
jmp 0x4050c3
Function at 0x405256
Capabilities:
Receive data
Receive data on socket

Disassembly:
sub esp, 0x18
push ebx
mov ebx, ecx
push ebp
push esi
push edi
cmp dword [ebx + 8], 0xffffffff
je 0x4053ca
mov eax, dword [esp + 0x2c]
test eax, eax
je 0x4053ca
mov ebp, dword [esp + 0x34]
xor ecx, ecx
test ebp, ebp
je 0x405282
mov dword [ebp], ecx
mov esi, dword [ebx + 0x448]
mov edi, dword [ebx + 0x44c]
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x18], ecx
mov dword [esp + 0x14], ecx
mov dword [esp + 0x20], 1
mov dword [esp + 0x24], eax
call dword [sym.imp.KERNEL32.dll_GetTickCount64]
add eax, esi
mov dword [ebx + 0x450], eax
adc edx, edi
mov dword [ebx + 0x454], edx
jmp 0x40538f
mov ecx, ebx
call fcn.00406244
test eax, eax
jne 0x4052e2
mov ecx, ebx
call fcn.004062bf
test al, al
jne 0x4053d6
push 1
jmp 0x405389
xor eax, eax
push eax
push eax
mov dword [esp + 0x3c], eax
lea eax, [esp + 0x24]
push eax
lea eax, [esp + 0x40]
push eax
push 1
lea eax, [esp + 0x34]
push eax
push dword [ebx + 8]
call dword [sym.imp.WS2_32.dll_WSARecv]
test eax, eax
jne 0x405366
cmp dword [esp + 0x34], 1
jne 0x405366
mov esi, dword [ebx + 0x448]
xor ecx, ecx
mov edi, dword [ebx + 0x44c]
mov dword [esp + 0x14], ecx
call dword [sym.imp.KERNEL32.dll_GetTickCount64]
add eax, esi
mov dword [ebx + 0x450], eax
mov eax, dword [esp + 0x24]
adc edx, edi
mov dword [ebx + 0x454], edx
mov cl, byte [eax]
cmp cl, 0xd
je 0x40538f
cmp cl, 0xa
je 0x4053ed
mov ecx, dword [esp + 0x30]
cmp ecx, 1
jbe 0x40538f
add eax, dword [esp + 0x34]
sub ecx, dword [esp + 0x34]
mov dword [esp + 0x24], eax
mov dword [esp + 0x30], ecx
jmp 0x40538f
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [esp + 0x18], eax
cmp eax, 0x2733
jne 0x40539c
mov eax, dword [esp + 0x14]
inc eax
mov dword [esp + 0x14], eax
cmp eax, 0x7d0
je 0x40539c
push 5
call dword [sym.imp.KERNEL32.dll_Sleep]
cmp byte [ebx + 0x435], 0
je 0x4052c1
push str.raw___read_string_failed
lea ecx, [ebx + 0x228]
mov edx, 0xff
call fcn.00403df9
test ebp, ebp
je 0x4053bc
mov eax, dword [esp + 0x18]
mov dword [ebp], eax
mov eax, dword [esp + 0x2c]
mov ecx, ebx
mov byte [eax], 0
call fcn.00403acb
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x18
ret 0xc
push str.raw___read_string_timeout
lea ecx, [ebx + 0x228]
mov edx, 0xff
call fcn.00403df9
jmp 0x4053ca
mov byte [eax], 0
mov esi, dword [ebx + 0x448]
mov edi, dword [ebx + 0x44c]
call dword [sym.imp.KERNEL32.dll_GetTickCount64]
add eax, esi
mov dword [ebx + 0x450], eax
mov al, 1
adc edx, edi
mov dword [ebx + 0x454], edx
jmp 0x4053cc
Function at 0x405bff
Capabilities:
Connect socket
Get socket status
Set socket configuration

Disassembly:
sub esp, 0x120
xor eax, eax
push ebx
push ebp
push esi
mov esi, ecx
push edi
lea edi, [esi + 0x228]
mov word [edi], ax
cmp byte [esi + 0x435], al
je 0x405c25
xor al, al
jmp 0x405de4
call fcn.00403acb
mov ebp, dword [esp + 0x134]
xor ebx, ebx
push 1
push ebx
push ebx
movzx eax, word [ebp]
push 6
push 1
push eax
call dword [sym.imp.WS2_32.dll_WSASocketW]
mov dword [esi + 8], eax
cmp eax, 0xffffffff
jne 0x405c61
push str.socket_create_failed
mov edx, 0xff
mov ecx, edi
call fcn.00403df9
jmp 0x405c1e
lea eax, [esi + 0x43c]
cmp dword [eax], ebx
mov ebx, dword [sym.imp.WS2_32.dll_setsockopt]
jbe 0x405c83
push 4
push eax
push 0x1005
push 0xffff
push dword [esi + 8]
call ebx
lea eax, [esi + 0x440]
cmp dword [eax], 0
jbe 0x405ca0
push 4
push eax
push 0x1006
push 0xffff
push dword [esi + 8]
call ebx
push 4
lea eax, [esp + 0x18]
mov dword [esp + 0x18], 0x100000
push eax
push 0x1002
push 0xffff
push dword [esi + 8]
mov dword [esp + 0x2c], 0x40000
call ebx
push 4
lea eax, [esp + 0x1c]
push eax
push 0x1001
push 0xffff
push dword [esi + 8]
call ebx
push 4
lea eax, [esp + 0x20]
mov dword [esp + 0x20], 1
push eax
push 8
push 0xffff
push dword [esi + 8]
call ebx
mov eax, dword [esi]
xor ebx, ebx
inc ebx
mov ecx, esi
push ebx
call dword [eax + 0x1c]
lea eax, [esp + 0x10]
mov dword [esp + 0x10], ebx
mov ebx, dword [sym.imp.WS2_32.dll_ioctlsocket]
push eax
push 0x8004667e
push dword [esi + 8]
call ebx
xor eax, eax
cmp word [ebp], 0x17
push eax
push eax
push eax
push eax
push 0x10
pop eax
push 0x1c
pop ecx
cmove eax, ecx
push eax
push ebp
push dword [esi + 8]
call dword [sym.imp.WS2_32.dll_WSAConnect]
cmp eax, 0xffffffff
jne 0x405dce
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
jne 0x405d96
mov ecx, dword [esi + 8]
xor edx, edx
mov eax, dword [esp + 0x138]
mov dword [esp + 0x2c], ecx
mov ecx, 0x3e8
div ecx
xor ecx, ecx
mov dword [esp + 0x28], 1
mov dword [esp + 0x20], eax
imul eax, edx, 0x3e8
mov dword [esp + 0x24], eax
lea eax, [esp + 0x20]
push eax
push ecx
lea eax, [esp + 0x30]
push eax
push ecx
push ecx
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jg 0x405dce
mov ecx, esi
call fcn.00403acb
push str.connect_failed
mov edx, 0xff
mov ecx, edi
call fcn.00403df9
lea eax, [esi + 0x28]
push eax
push str._s_direct_connect_failed
push str.Socket
push 0x4b9590
call fcn.00445800
add esp, 0x10
jmp 0x405c1e
and dword [esp + 0x10], 0
lea ecx, [esp + 0x10]
push ecx
push 0x8004667e
push dword [esi + 8]
call ebx
mov al, 1
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x120
ret 0xc
Function at 0x406244
Capabilities:
Get socket status
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x110
push esi
push edi
mov esi, ecx
xor edi, edi
inc edi
mov dword [ebp - 4], edi
cmp dword [esi + 8], 0xffffffff
je 0x4062b8
lea ecx, [ebp - 4]
push ecx
push 0x4004667f
push dword [esi + 8]
call dword [sym.imp.WS2_32.dll_ioctlsocket]
test eax, eax
je 0x40627e
mov ecx, esi
call fcn.00403acb
mov eax, edi
jmp 0x4062bb
mov eax, dword [ebp - 4]
test eax, eax
jne 0x4062bb
mov eax, dword [esi + 8]
xor ecx, ecx
mov dword [ebp - 0x10c], eax
lea eax, [ebp - 0xc]
push eax
push ecx
push ecx
lea eax, [ebp - 0x110]
mov dword [ebp - 0x110], edi
push eax
push ecx
mov dword [ebp - 0xc], ecx
mov dword [ebp - 8], 0x3e8
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jg 0x40627a
mov eax, dword [ebp - 4]
pop edi
pop esi
leave
ret
Function at 0x4062f5
Capabilities:
Receive data
Receive data on socket

Disassembly:
sub esp, 0x14
xor edx, edx
push ebx
push ebp
push esi
push edi
mov edi, dword [esp + 0x34]
mov ebx, ecx
test edi, edi
je 0x40630a
mov dword [edi], edx
mov eax, dword [esp + 0x30]
mov dword [eax], edx
mov eax, dword [esp + 0x28]
test eax, eax
je 0x40646e
cmp dword [ebx + 8], 0xffffffff
je 0x40646e
push dword [esp + 0x38]
mov dword [esp + 0x18], edx
mov ebp, edx
mov dword [esp + 0x2c], edx
mov dword [esp + 0x1c], edx
mov dword [esp + 0x20], eax
call fcn.004064c9
mov esi, dword [esp + 0x2c]
jmp 0x40642b
cmp byte [ebx + 0x435], 0
jne 0x40649f
mov ecx, ebx
call fcn.00406244
mov ecx, eax
test ecx, ecx
jne 0x40637a
mov ecx, ebx
call fcn.004062bf
test al, al
jne 0x406459
push 1
jmp 0x406425
mov edx, 0x400000
mov eax, esi
cmp esi, edx
cmova eax, edx
cmp eax, ecx
cmova eax, ecx
mov dword [esp + 0x18], eax
xor eax, eax
push eax
push eax
mov dword [esp + 0x3c], eax
lea eax, [esp + 0x1c]
push eax
lea eax, [esp + 0x40]
push eax
push 1
lea eax, [esp + 0x2c]
push eax
push dword [ebx + 8]
call dword [sym.imp.WS2_32.dll_WSARecv]
test eax, eax
jne 0x406403
cmp dword [esp + 0x34], eax
je 0x406403
push dword [esp + 0x38]
xor ecx, ecx
mov dword [esp + 0x2c], ecx
mov ecx, ebx
call fcn.004064c9
mov ecx, dword [esp + 0x30]
mov eax, dword [esp + 0x34]
sub esi, eax
add dword [esp + 0x1c], eax
add dword [ecx], eax
cmp byte [esp + 0x3c], 0
je 0x40642b
mov ecx, dword [ebx + 0x428]
test ecx, ecx
je 0x40642b
push eax
push dword [ebx + 0x430]
push dword [ebx + 0x42c]
push ecx
call dword [sym.imp.USER32.dll_PostMessageW]
jmp 0x40642b
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov ebp, eax
cmp ebp, 0x2733
jne 0x40647a
mov eax, dword [esp + 0x28]
inc eax
mov dword [esp + 0x28], eax
cmp eax, 0x7d0
je 0x40649b
push 5
call dword [sym.imp.KERNEL32.dll_Sleep]
test esi, esi
jne 0x40634a
mov esi, dword [ebx + 0x448]
mov edi, dword [ebx + 0x44c]
call dword [sym.imp.KERNEL32.dll_GetTickCount64]
add eax, esi
mov dword [ebx + 0x450], eax
mov al, 1
adc edx, edi
mov dword [ebx + 0x454], edx
jmp 0x406470
push str.raw___read_timeout
lea ecx, [ebx + 0x228]
mov edx, 0xff
call fcn.00403df9
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret 0x18
mov eax, dword [ebx + 8]
push dword [esp + 0x18]
lea eax, [ebx + 0x228]
push ebp
push str.raw___receive_failed___u_error___u_bytes_requested
push 0xff
push eax
call fcn.00403c17
add esp, 0x14
test esi, esi
je 0x406433
push esi
push ebp
push str.raw___read_failed___u_error___zu_bytes_needed
lea eax, [ebx + 0x228]
push 0xff
push eax
call fcn.00403c17
add esp, 0x14
test edi, edi
je 0x4064c0
mov dword [edi], ebp
mov ecx, ebx
call fcn.00403acb
jmp 0x40646e
Function at 0x406502
Capabilities:
Send data
Send data on socket

Disassembly:
sub esp, 0x10
push ebx
push ebp
push esi
mov esi, dword [esp + 0x28]
mov ebx, ecx
push edi
xor edi, edi
test esi, esi
je 0x406517
mov dword [esi], edi
mov eax, dword [esp + 0x24]
test eax, eax
je 0x40664e
cmp dword [ebx + 8], 0xffffffff
je 0x40664e
mov ebp, dword [esp + 0x28]
mov dword [esp + 0x24], edi
mov dword [esp + 0x14], edi
mov dword [esp + 0x18], edi
mov dword [esp + 0x1c], eax
test ebp, ebp
je 0x4065f9
cmp byte [ebx + 0x435], 0
jne 0x40661f
mov esi, dword [ebx + 0x448]
mov dword [esp + 0x28], edi
mov edi, dword [ebx + 0x44c]
call dword [sym.imp.KERNEL32.dll_GetTickCount64]
add eax, esi
mov esi, 0x200000
mov dword [ebx + 0x450], eax
mov eax, ebp
adc edx, edi
cmp ebp, esi
mov dword [ebx + 0x454], edx
cmova eax, esi
xor edi, edi
push edi
push edi
push edi
mov dword [esp + 0x24], eax
lea eax, [esp + 0x34]
push eax
push 1
lea eax, [esp + 0x2c]
push eax
push dword [ebx + 8]
call dword [sym.imp.WS2_32.dll_WSASend]
test eax, eax
je 0x4065db
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edi, eax
mov dword [esp + 0x24], edi
cmp edi, 0x2733
jne 0x4065f5
mov esi, dword [esp + 0x14]
inc esi
mov dword [esp + 0x14], esi
cmp esi, 0x7d0
je 0x4065f1
push 5
call dword [sym.imp.KERNEL32.dll_Sleep]
xor edi, edi
jmp 0x4065e9
mov eax, dword [esp + 0x28]
sub ebp, eax
add dword [esp + 0x1c], eax
mov dword [esp + 0x14], edi
test ebp, ebp
jne 0x406549
mov edi, dword [esp + 0x24]
test ebp, ebp
jne 0x406623
mov esi, dword [ebx + 0x448]
mov edi, dword [ebx + 0x44c]
call dword [sym.imp.KERNEL32.dll_GetTickCount64]
add eax, esi
mov dword [ebx + 0x450], eax
mov al, 1
adc edx, edi
mov dword [ebx + 0x454], edx
jmp 0x406650
mov edi, dword [esp + 0x24]
push ebp
push str.raw___send_failed___zu_bytes_needed
lea eax, [ebx + 0x228]
push 0xff
push eax
call fcn.00403c17
mov esi, dword [esp + 0x3c]
add esp, 0x10
test esi, esi
je 0x406647
mov dword [esi], edi
mov ecx, ebx
call fcn.00403acb
xor al, al
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x10
ret 0xc