joyce8/EMBER2024-capa huggingface dataset:
Function at 0x4ff632
Capabilities:
Hash data with md5

Disassembly:
and dword [ecx + 0x10], 0
and dword [ecx + 0x14], 0
mov dword [ecx], 0x67452301
mov dword [ecx + 4], 0xefcdab89
mov dword [ecx + 8], 0x98badcfe
mov dword [ecx + 0xc], 0x10325476
ret

Function at 0x4ffd9f
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x110
mov eax, dword [0x5c31c8]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, dword [ebp + 0x14]
push esi
xor esi, esi
mov dword [ebp - 0x108], edx
push edi
mov dword [ebp - 0x110], ebx
mov eax, esi
mov dword [ebp - 0x10c], esi
mov byte [ebp + eax - 0x104], al
inc eax
cmp eax, 0x100
jl 0x4ffdce
mov ebx, dword [ebp - 0x108]
mov edi, esi
mov edx, esi
movzx ecx, byte [ebp + edx - 0x104]
mov eax, edx
and eax, reloc.WS2_32.dll_ntohs
jns 0x4ffdfd
dec eax
or eax, 0xfffffff0
inc eax
movzx eax, byte [eax + ebx]
add eax, ecx
add edi, eax
and edi, 0x800000ff
jns 0x4ffe15
dec edi
or edi, 0xffffff00
inc edi
mov al, byte [ebp + edi - 0x104]
mov byte [ebp + edx - 0x104], al
inc edx
mov byte [ebp + edi - 0x104], cl
cmp edx, 0x100
jl 0x4ffde7
mov edi, dword [ebp + 0xc]
mov ebx, dword [ebp - 0x110]
sub edi, ebx
mov dword [ebp - 0x108], 0x20
inc esi
and esi, 0x800000ff
jns 0x4ffe59
dec esi
or esi, 0xffffff00
inc esi
movzx edx, byte [ebp + esi - 0x104]
mov ecx, dword [ebp - 0x10c]
add ecx, edx
and ecx, 0x800000ff
jns 0x4ffe79
dec ecx
or ecx, 0xffffff00
inc ecx
mov al, byte [ebp + ecx - 0x104]
mov dword [ebp - 0x10c], ecx
mov byte [ebp + esi - 0x104], al
mov byte [ebp + ecx - 0x104], dl
movzx ecx, byte [ebp + esi - 0x104]
add ecx, edx
and ecx, 0x800000ff
jns 0x4ffeae
dec ecx
or ecx, 0xffffff00
inc ecx
mov al, byte [ebp + ecx - 0x104]
xor al, byte [edi + ebx]
mov byte [ebx], al
inc ebx
dec dword [ebp - 0x108]
jne 0x4ffe48
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0055daac
mov esp, ebp
pop ebp
ret
Function at 0x50011c
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0xc4
mov eax, dword [0x5c31c8]
xor eax, esp
mov dword [esp + 0xc0], eax
mov eax, dword [ebp + 0xc]
push ebx
push esi
mov dword [esp + 8], eax
lea eax, [esp + 0xa8]
push edi
push eax
push dword [ebp + 8]
call fcn.005000cc
lea eax, [esp + 0x84]
mov edx, 0x57f98c
push eax
push 0
call fcn.005000cc
lea ecx, [esp + 0x20]
call fcn.004ff632
push 0x20
lea edx, [esp + 0x90]
call fcn.004ff656
add esp, 0x14
lea edx, [esp + 0x10]
lea ecx, [esp + 0x6c]
call fcn.004ff59a
push 0x32
pop esi
lea ecx, [esp + 0x10]
call fcn.004ff632
push 0x10
lea edx, [esp + 0x70]
call fcn.004ff656
pop ecx
lea edx, [esp + 0x10]
lea ecx, [esp + 0x6c]
call fcn.004ff59a
dec esi
jne 0x50018e
push 8
pop ecx
lea esi, [esp + 0xac]
xor ebx, ebx
lea edi, [esp + 0x7c]
rep movsd dword es:[edi], dword [esi]
xor ecx, ecx
mov al, byte [esp + ecx + 0x6c]
xor al, bl
mov byte [esp + ecx + 0x9c], al
inc ecx
cmp ecx, 0x10
jl 0x5001c7
lea eax, [esp + 0x7c]
push eax
push ecx
push eax
push ecx
lea edx, [esp + 0xac]
call fcn.004ffd9f
add esp, 0x10
inc ebx
cmp ebx, 0x14
jl 0x5001c5
lea ecx, [esp + 0x10]
call fcn.004ff632
push 0x20
lea edx, [esp + 0xb0]
call fcn.004ff656
push 0x20
lea edx, [esp + 0x84]
lea ecx, [esp + 0x18]
call fcn.004ff656
pop ecx
pop ecx
lea edx, [esp + 0x10]
lea ecx, [esp + 0x6c]
call fcn.004ff59a
push 0x32
pop esi
lea ecx, [esp + 0x10]
call fcn.004ff632
push 0x10
lea edx, [esp + 0x70]
call fcn.004ff656
pop ecx
lea edx, [esp + 0x10]
lea ecx, [esp + 0x6c]
call fcn.004ff59a
dec esi
jne 0x500232
mov edi, dword [esp + 0xc]
lea esi, [esp + 0x6c]
mov ecx, dword [esp + 0xcc]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0055daac
mov esp, ebp
pop ebp
ret

Function at 0x5022bb
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc
push ebx
push esi
push edi
mov edi, edx
mov ebx, ecx
xor edx, edx
mov dword [ebp - 8], edi
inc edx
call fcn.005023df
test al, al
je 0x50233a
xor edx, edx
mov ecx, edi
inc edx
call fcn.005023df
test al, al
je 0x50233a
mov esi, dword [ebp + 8]
xor edx, edx
inc edx
mov ecx, esi
call fcn.005023df
mov ecx, dword [ebp + 0xc]
test al, al
je 0x502340
mov edx, ecx
xor eax, eax
shr edx, 2
test edx, edx
je 0x50232b
sub edi, esi
mov dword [ebp - 0xc], edx
mov eax, ebx
mov ecx, esi
sub eax, esi
mov esi, eax
mov eax, dword [edi + ecx]
xor eax, dword [ecx]
mov dword [esi + ecx], eax
lea ecx, [ecx + 4]
dec edx
jne 0x502311
mov esi, dword [ebp + 8]
mov ecx, dword [ebp + 0xc]
mov edi, dword [ebp - 8]
mov eax, dword [ebp - 0xc]
shl eax, 2
sub ecx, eax
je 0x502354
add ebx, eax
add edi, eax
add esi, eax
jmp 0x502340
mov ecx, dword [ebp + 0xc]
mov esi, dword [ebp + 8]
test ecx, ecx
je 0x502354
sub edi, esi
sub ebx, esi
mov al, byte [esi + edi]
xor al, byte [esi]
mov byte [esi + ebx], al
inc esi
dec ecx
jne 0x502348
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
Function at 0x5039c7
Capabilities:
Encode data using xor
Encrypt data using aes
Reference aes constants

Disassembly:
push ebx
push esi
xor ebx, ebx
push edi
mov edi, ebx
movzx edx, byte [edi + str.cw]
mov ecx, edx
mov eax, edx
shr ecx, 7
imul esi, ecx, 0x1b000000
shl eax, 0x19
imul ecx, ecx, 0x11b
xor esi, eax
mov eax, edx
shl eax, 8
or eax, edx
shl eax, 8
or esi, eax
lea eax, [edx + edx]
xor ecx, eax
xor eax, eax
xor ecx, edx
or eax, esi
or ecx, esi
mov dword [edi*8 + 0x5cbb70], eax
or ecx, ebx
mov dword [edi*8 + 0x5cbb74], ecx
inc edi
cmp edi, 0x100
jl 0x5039ce
pop edi
mov dword [0x5cc378], ebx
mov dword [0x5cc37c], ebx
mov dword [0x5cc370], ebx
mov dword [0x5cc374], ebx
pop esi
mov byte [0x5cba11], 1
pop ebx
ret

Function at 0x503a42
Capabilities:
Encode data using xor
Encrypt data using aes
Reference aes constants

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
push ebx
xor edx, edx
push esi
mov dword [ebp - 0x14], edx
push edi
movzx edi, byte [edx + 0x58af50]
mov eax, edi
mov dword [ebp - 8], edi
shr eax, 5
mov esi, edi
mov edx, eax
shr esi, 6
mov ebx, eax
lea ecx, [edi + edi]
xor ecx, edi
and eax, 1
mov dword [ebp - 0x10], eax
and ebx, 2
shr edi, 7
and edx, 4
mov dword [ebp - 0xc], edx
mov edx, esi
lea eax, [ecx + ecx]
and esi, 1
xor eax, dword [ebp - 8]
and edx, 2
shl eax, 0x19
mov dword [ebp - 4], eax
imul eax, edi, 0x1b000000
shl ecx, 2
xor ecx, dword [ebp - 8]
shl ecx, 8
xor dword [ebp - 4], eax
imul eax, dword [ebp - 0x10], 0x1b000000
xor dword [ebp - 4], eax
imul eax, ebx, 0x1b000000
xor dword [ebp - 4], eax
imul eax, esi, 0x1b000000
xor dword [ebp - 4], eax
imul eax, edx, 0x1b000000
xor dword [ebp - 4], eax
imul eax, dword [ebp - 0xc], 0x1b000000
xor dword [ebp - 4], eax
imul eax, dword [ebp - 0x10], 0x11b00
xor ecx, eax
imul eax, ebx, 0x11b00
xor ecx, eax
imul eax, esi, 0x11b00
xor ecx, eax
imul eax, edx, 0x11b00
mov edx, dword [ebp - 4]
xor ecx, eax
imul eax, dword [ebp - 0xc], 0x11b00
xor ecx, eax
imul eax, dword [ebp - 0x10], 0x11b0000
or edx, ecx
mov ecx, dword [ebp - 8]
shl ecx, 3
xor ecx, dword [ebp - 8]
shl ecx, 0x10
xor ecx, eax
imul eax, ebx, 0x11b0000
xor ecx, eax
imul eax, dword [ebp - 0xc], 0x11b0000
xor ecx, eax
imul eax, edi, 0x11b
or edx, ecx
mov ecx, dword [ebp - 8]
shl ecx, 2
xor ecx, dword [ebp - 8]
add ecx, ecx
xor ecx, eax
imul eax, dword [ebp - 0x10], 0x11b
xor ecx, eax
imul eax, ebx, 0x11b
mov ebx, dword [ebp - 8]
xor ecx, eax
imul eax, dword [ebp - 0xc], 0x11b
xor ecx, eax
xor eax, eax
xor ecx, ebx
or ebx, edx
or ecx, edx
mov edx, dword [ebp - 0x14]
or eax, ebx
mov dword [edx*8 + 0x5cc9e0], eax
mov dword [edx*8 + 0x5cc9e4], ecx
inc edx
mov dword [ebp - 0x14], edx
cmp edx, 0x100
jl 0x503a50
pop edi
pop esi
mov byte [0x5cba12], 1
pop ebx
mov esp, ebp
pop ebp
ret
Function at 0x508607
Capabilities:
Initialize winsock library

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x19c
mov eax, dword [0x5c31c8]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [0x5cc824]
mov edx, eax
inc eax
mov dword [0x5cc824], eax
push ebx
mov ebx, ecx
test edx, edx
jne 0x5086eb
mov eax, dword [sym.imp.MSVCR120.dll_malloc]
mov dword [0x5c5b5c], eax
mov eax, dword [sym.imp.MSVCR120.dll_free]
mov dword [0x5c6c40], eax
mov eax, dword [sym.imp.MSVCR120.dll_realloc]
mov dword [0x5c6c44], eax
mov eax, dword [sym.imp.MSVCR120.dll__strdup]
mov dword [0x5c643c], eax
mov eax, dword [sym.imp.MSVCR120.dll_calloc]
mov dword [0x5c6c48], eax
test bl, 1
je 0x508691
cmp dword [0x5cc38c], edx
jne 0x508691
mov dword [0x5cc38c], 1
call dword [sym.imp.SSLEAY32.dll_Ordinal_74]
call dword [sym.imp.SSLEAY32.dll_Ordinal_183]
test eax, eax
je 0x5086c3
call dword [sym.imp.LIBEAY32.dll_Ordinal_3212]
test bl, 2
je 0x5086c8
lea eax, [ebp - 0x198]
push eax
push 0x202
call dword [sym.imp.WS2_32.dll_WSAStartup]
test eax, eax
jne 0x5086c3
mov eax, dword [ebp - 0x198]
cmp al, 2
jne 0x5086bd
shr eax, 8
cmp al, 2
je 0x5086c8
call dword [sym.imp.WS2_32.dll_WSACleanup]
push 2
pop eax
jmp 0x5086ed
push 0
mov dword [0x5cc7dc], ebx
call dword [sym.imp.MSVCR120.dll__time64]
pop ecx
mov dword [0x5cc888], eax
call fcn.00510c36
call fcn.00510c36
call fcn.00510c36
xor eax, eax
mov ecx, dword [ebp - 4]
xor ecx, ebp
pop ebx
call fcn.0055daac
mov esp, ebp
pop ebp
ret
Function at 0x50f717
Capabilities:
Get local ipv4 addresses
Get socket information

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10c
mov eax, dword [0x5c31c8]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov edi, ecx
mov esi, edx
cmp dword [edi + 0x1c8], 0
mov ebx, dword [edi]
jne 0x50f83a
lea eax, [ebp - 0x10c]
mov dword [ebp - 0x10c], 0x80
push eax
lea eax, [ebp - 0x88]
push eax
push esi
call dword [sym.imp.WS2_32.dll_getpeername]
test eax, eax
je 0x50f789
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov esi, eax
mov ecx, edi
mov edx, esi
call fcn.0052922c
push eax
push esi
push str.getpeername___failed_with_errno__d:__s
push ebx
call fcn.00510cc2
add esp, 0x10
jmp 0x50f841
lea eax, [ebp - 0x10c]
mov dword [ebp - 0x10c], 0x80
push eax
lea eax, [ebp - 0x108]
push eax
push esi
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
je 0x50f7c6
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov esi, eax
mov ecx, edi
mov edx, esi
call fcn.0052922c
push eax
push esi
push str.getsockname___failed_with_errno__d:__s
jmp 0x50f77b
lea eax, [edi + 0xcc]
push eax
lea edx, [edi + 0x9e]
lea ecx, [ebp - 0x88]
call fcn.0050f6ca
pop ecx
test eax, eax
jne 0x50f800
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov ecx, edi
mov edx, esi
call fcn.0052922c
push eax
push esi
push str.ssrem_inet_ntop___failed_with_errno__d:__s
jmp 0x50f77b
lea eax, [edi + 0x100]
push eax
lea edx, [edi + 0xd0]
lea ecx, [ebp - 0x108]
call fcn.0050f6ca
pop ecx
test eax, eax
jne 0x50f83a
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov ecx, edi
mov edx, esi
call fcn.0052922c
push eax
push esi
push str.ssloc_inet_ntop___failed_with_errno__d:__s
jmp 0x50f77b
mov ecx, edi
call fcn.0050f67d
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0055daac
mov esp, ebp
pop ebp
ret

Function at 0x50fa2b
Capabilities:
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
push ecx
push ecx
push esi
push edi
mov edi, ecx
push 4
mov esi, dword [edi]
mov eax, dword [esi + 0x314]
mov dword [ebp - 4], eax
lea eax, [ebp - 4]
push eax
push 1
push 6
push edx
call dword [sym.imp.WS2_32.dll_setsockopt]
test eax, eax
jns 0x50fa74
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edx, eax
mov ecx, edi
call fcn.0052922c
push eax
push str.Could_not_set_TCP_NODELAY:__s_n
push esi
call fcn.00510c4e
add esp, 0xc
jmp 0x50fa81
push str.TCP_NODELAY_set_n
push esi
call fcn.00510c4e
pop ecx
pop ecx
pop edi
pop esi
mov esp, ebp
pop ebp
ret
Function at 0x50ff6e
Capabilities:
Receive data
Receive data on socket

Disassembly:
push ebp
mov ebp, esp
push ecx
push esi
mov esi, dword [ecx + 0x550]
cmp esi, 0xffffffff
je 0x50ffbb
mov eax, dword [ecx + 0x544]
mov eax, dword [eax]
mov eax, dword [eax + esi*4]
test eax, eax
je 0x50ffbb
test edx, edx
je 0x50ff93
mov dword [edx], eax
cmp dword [eax + 0x150], 0
mov esi, dword [eax + 0x130]
je 0x50ffc3
push 1
lea ecx, [ebp - 1]
push ecx
push dword [eax + 0x15c]
call dword [sym.imp.SSLEAY32.dll_Ordinal_76]
add esp, 0xc
test eax, eax
jne 0x50ffd4
or eax, 0xffffffff
pop esi
mov esp, ebp
pop ebp
ret
push 2
push 1
lea eax, [ebp - 1]
push eax
push esi
call dword [sym.imp.WS2_32.dll_recv]
jmp 0x50ffb7
mov eax, esi
jmp 0x50ffbe

Function at 0x5108cd
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
push ecx
push ebx
push esi
push edi
push 0x44
push 1
mov dword [ebp - 4], edx
mov esi, ecx
call dword [0x5c6c48]
pop ecx
pop ecx
mov edi, eax
mov dword [esi + 0x3e4], edi
push 8
pop ebx
test edi, edi
je 0x510988
mov eax, dword [ebp + 8]
xor ecx, ecx
mov edx, dword [ebp - 4]
mov dword [esi + 0x3dc], ecx
mov dword [esi + 0x3e0], ecx
mov dword [esi + 0x3d8], ecx
mov dword [esi + 0x3d4], eax
mov dword [edi], ecx
lea ecx, [edi + 0xc]
push ecx
push eax
call fcn.00510773
pop ecx
pop ecx
test eax, eax
je 0x510988
mov eax, dword [esi + 0x3d0]
test eax, eax
je 0x510943
push eax
call dword [0x5c6c40]
and dword [esi + 0x3d0], 0
pop ecx
push dword [ebp - 4]
call dword [0x5c643c]
mov dword [esi + 0x3d0], eax
pop ecx
test eax, eax
je 0x510988
xor ebx, ebx
lea eax, [edi + 0xc]
push ebx
push ebx
push eax
push 0x510800
push ebx
push ebx
call dword [sym.imp.MSVCR120.dll__beginthreadex]
add esp, 0x18
test eax, eax
je 0x510978
cmp eax, 0xffffffff
jne 0x51097a
mov eax, ebx
mov dword [edi], eax
test eax, eax
jne 0x5109a3
call dword [sym.imp.MSVCR120.dll__errno]
mov ebx, dword [eax]
lea ecx, [esi + 0x3d0]
call fcn.0051088c
push ebx
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
xor eax, eax
inc eax
jmp 0x51099c

Function at 0x510e66
Capabilities:
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
mov eax, dword [ebp + 0xc]
push ebx
mov ebx, dword [ebp + 8]
push esi
push edi
push 0
push dword [ebp + 0x14]
push dword [ebp + 0x10]
push dword [ebx + eax*4 + 0x130]
call dword [sym.imp.WS2_32.dll_send]
mov edi, dword [ebp + 0x18]
mov esi, eax
and dword [edi], 0
cmp esi, 0xffffffff
jne 0x510ed8
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [ebp + 8], eax
cmp eax, 0x2733
jne 0x510eae
xor esi, esi
mov dword [edi], 0x51
jmp 0x510ed8
mov edx, eax
mov ecx, ebx
call fcn.0052922c
push eax
push str.Send_failure:__s
push dword [ebx]
call fcn.00510cc2
mov eax, dword [ebx]
add esp, 0xc
mov ecx, dword [ebp + 8]
mov dword [eax + 0x858c], ecx
mov dword [edi], 0x37
pop edi
mov eax, esi
pop esi
pop ebx
pop ebp
ret
Function at 0x51120e
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
mov edi, ecx
mov eax, dword [edi + 0x164]
test eax, eax
je 0x511233
push dword [edi + 0xf4]
push dword [ebp + 0xc]
push dword [ebp + 8]
push edx
push edi
call eax
add esp, 0x14
jmp 0x51126a
cmp edx, 2
ja 0x511268
push dword [edi + 0xf0]
imul eax, edx, 3
push 1
push 2
add eax, 0x58b09c
push eax
call dword [sym.imp.MSVCR120.dll_fwrite]
push dword [edi + 0xf0]
push 1
push dword [ebp + 0xc]
push dword [ebp + 8]
call dword [sym.imp.MSVCR120.dll_fwrite]
add esp, 0x20
xor eax, eax
pop edi
pop ebp
ret
Function at 0x518671
Capabilities:
Get socket status

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x320
mov eax, dword [0x5c31c8]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, ecx
or ebx, 0xffffffff
push edi
test esi, esi
je 0x5186a1
xor edi, edi
xor ecx, ecx
mov eax, edi
inc ecx
cmp dword [esi + eax*8], ebx
jne 0x5186b9
inc eax
cmp eax, ecx
jb 0x518697
mov ecx, ebx
call fcn.0051834b
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0055daac
mov esp, ebp
pop ebp
ret
xor eax, eax
mov dword [ebp - 0x218], edi
mov word [esi + 6], ax
mov edx, ebx
mov eax, dword [esi]
mov dword [ebp - 0x110], edi
mov dword [ebp - 0x320], edi
cmp eax, ebx
je 0x51871c
movzx ecx, word [esi + 4]
test cl, 7
je 0x51871c
cmp eax, ebx
cmova edx, eax
xor ebx, ebx
inc ebx
test bl, cl
je 0x5186fa
mov dword [ebp - 0x214], eax
mov dword [ebp - 0x218], ebx
test cl, 4
je 0x51870b
mov dword [ebp - 0x10c], eax
mov dword [ebp - 0x110], ebx
test cl, 2
je 0x51871c
mov dword [ebp - 0x31c], eax
mov dword [ebp - 0x320], ebx
lea ebx, [edx + 1]
push edi
lea eax, [ebp - 0x320]
push eax
lea eax, [ebp - 0x110]
push eax
lea eax, [ebp - 0x218]
push eax
push ebx
call dword [sym.imp.WS2_32.dll_select]
cmp eax, 0xffffffff
jne 0x518754
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test eax, eax
je 0x51871f
cmp eax, 0x2714
je 0x51871f
jmp 0x518758
test eax, eax
jns 0x518760
or eax, 0xffffffff
jmp 0x5186a8
jne 0x518769
xor eax, eax
jmp 0x5186a8
xor eax, eax
cmp dword [esi], 0xffffffff
mov word [esi + 6], ax
je 0x5187c2
mov ebx, dword [sym.imp.WS2_32.dll___WSAFDIsSet]
lea eax, [ebp - 0x218]
push eax
push dword [esi]
call ebx
test eax, eax
je 0x518790
xor eax, eax
inc eax
or word [esi + 6], ax
lea eax, [ebp - 0x110]
push eax
push dword [esi]
call ebx
test eax, eax
je 0x5187a4
or word [esi + 6], 4
lea eax, [ebp - 0x320]
push eax
push dword [esi]
call ebx
test eax, eax
je 0x5187b8
or word [esi + 6], 2
cmp word [esi + 6], di
push 1
pop eax
cmovne edi, eax
mov eax, edi
jmp 0x5186a8
Function at 0x51c27c
Capabilities:
Receive data
Receive data on socket

Disassembly:
push ebp
mov ebp, esp
push ecx
push ecx
mov eax, dword [ebp + 0x10]
push ebx
push esi
push edi
mov dword [ebp - 4], edx
xor ebx, ebx
and dword [eax], ebx
xor edx, edx
mov dword [ebp - 8], ecx
mov ecx, dword [ecx]
push 1
call fcn.0050f15a
pop ecx
test eax, eax
js 0x51c2ff
mov edi, dword [ebp + 0xc]
or esi, 0xffffffff
mov ecx, dword [ebp - 4]
mov edx, esi
push eax
push esi
call fcn.0051836a
pop ecx
pop ecx
test eax, eax
jle 0x51c302
push 0
push edi
push dword [ebp + 8]
push dword [ebp - 4]
call dword [sym.imp.WS2_32.dll_recv]
cmp eax, esi
jne 0x51c2dd
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
je 0x51c2ec
push 0x38
jmp 0x51c301
cmp edi, eax
je 0x51c30b
test eax, eax
je 0x51c302
add dword [ebp + 8], eax
sub edi, eax
add ebx, eax
mov eax, dword [ebp - 8]
xor edx, edx
push 1
mov ecx, dword [eax]
call fcn.0050f15a
pop ecx
test eax, eax
jns 0x51c2a7
push 0x1c
pop esi
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp + 0x10]
add eax, ebx
xor esi, esi
mov dword [ecx], eax
jmp 0x51c302
Function at 0x520fd1
Capabilities:
Receive data
Receive data on socket

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x94
mov eax, dword [0x5c31c8]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov eax, ecx
mov dword [ebp - 0x8c], 0x80
push edi
mov dword [ebp - 0x90], eax
mov esi, dword [eax + 0x3f8]
mov edi, dword [eax]
lea eax, [ebp - 0x8c]
push eax
lea eax, [ebp - 0x88]
push eax
mov eax, dword [esi + 0x154]
push 0
add eax, 4
push eax
push dword [esi + 0x15c]
push dword [esi + 0x14]
call dword [sym.imp.WS2_32.dll_recvfrom]
cmp dword [esi + 0x148], 0
mov dword [esi + 0x14c], eax
jne 0x521061
push dword [ebp - 0x8c]
lea eax, [ebp - 0x88]
push eax
lea eax, [esi + 0xc8]
push eax
call sub.MSVCR120.dll_memcpy
mov eax, dword [ebp - 0x8c]
add esp, 0xc
mov dword [esi + 0x148], eax
mov ebx, dword [esi + 0x14c]
cmp ebx, 4
jge 0x521093
push str.Received_too_short_packet
push edi
call fcn.00510cc2
pop ecx
pop ecx
mov dword [esi + 0xc], 7
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0055daac
mov esp, ebp
pop ebp
ret
mov ecx, dword [esi + 0x15c]
movzx eax, byte [ecx]
shl ax, 8
movzx edx, ax
movzx eax, byte [ecx + 1]
or edx, eax
mov dword [esi + 0xc], edx
sub edx, 3
je 0x521113
dec edx
je 0x521188
dec edx
je 0x5210e9
dec edx
je 0x5210d0
push str.Internal_error:_Unexpected_packet
push 0x5949b0
push edi
call fcn.00510cc2
jmp 0x52110e
lea eax, [ebx - 2]
lea edx, [ecx + 2]
mov ecx, esi
push eax
call fcn.0052027f
pop ecx
test eax, eax
je 0x521188
jmp 0x521082
mov edx, ecx
movzx eax, byte [edx + 2]
shl ax, 8
movzx ecx, ax
movzx eax, byte [edx + 3]
or ecx, eax
lea eax, [edx + 4]
push eax
push 0x59a4fc
push edi
mov dword [esi + 8], ecx
call fcn.00510c4e
add esp, 0xc
jmp 0x521188
cmp ebx, 4
jle 0x521188
movzx eax, byte [ecx + 2]
shl ax, 8
movzx edx, ax
movzx eax, byte [ecx + 3]
or edx, eax
movzx eax, word [esi + 0x40]
inc eax
and eax, 0xffff
cmp eax, edx
jne 0x521188
lea eax, [ebx - 4]
add ecx, 4
push eax
xor edx, edx
push ecx
mov ecx, dword [ebp - 0x90]
inc edx
call fcn.00510fd8
mov ebx, eax
pop ecx
pop ecx
test ebx, ebx
je 0x521166
push 5
pop edx
mov ecx, esi
call fcn.00520d99
mov eax, ebx
jmp 0x521082
mov eax, dword [esi + 0x14c]
sub eax, 4
cdq
add dword [edi + 0x38], eax
mov eax, dword [edi + 0x38]
adc dword [edi + 0x3c], edx
mov dword [edi + 0x450], eax
mov eax, dword [edi + 0x3c]
mov dword [edi + 0x454], eax
mov ecx, dword [ebp - 0x90]
call fcn.00518c4e
test eax, eax
je 0x521080
push 5
pop edx
mov ecx, esi
call fcn.00520d99
push 0x2a
pop eax
jmp 0x521082
Function at 0x522587
Capabilities:
Get local ipv4 addresses
Get socket information
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
mov eax, dword [0x5c31c8]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, ecx
mov dword [ebp - 0x1c], 0x10
push edi
lea ecx, [ebp - 0x1c]
or edi, 0xffffffff
push ecx
mov eax, dword [esi + 0x134]
lea ecx, [ebp - 0x14]
mov ebx, dword [esi]
push ecx
push eax
mov dword [ebp - 0x18], eax
call dword [sym.imp.WS2_32.dll_getsockname]
test eax, eax
jne 0x5225de
lea eax, [ebp - 0x1c]
mov dword [ebp - 0x1c], 0x10
push eax
lea eax, [ebp - 0x14]
push eax
push dword [ebp - 0x18]
call dword [sym.imp.WS2_32.dll_accept]
mov edi, eax
mov edx, dword [ebp - 0x18]
mov ecx, esi
call fcn.0050ffd8
cmp edi, 0xffffffff
jne 0x5225ff
push str.Error_accept__ing_server_connect
push ebx
call fcn.00510cc2
pop ecx
pop ecx
push 0x1e
pop eax
jmp 0x522663
push str.Connection_accepted_from_server_n
push ebx
call fcn.00510c4e
pop ecx
pop ecx
lea eax, [ebp - 0x18]
mov dword [esi + 0x134], edi
push eax
push 0x8004667e
push edi
mov dword [ebp - 0x18], 1
call dword [sym.imp.WS2_32.dll_ioctlsocket]
xor ecx, ecx
inc ecx
mov dword [esi + 0x13c], ecx
mov eax, dword [ebx + 0x16c]
test eax, eax
je 0x522661
push ecx
push edi
push dword [ebx + 0x170]
call eax
add esp, 0xc
test eax, eax
je 0x522661
mov edx, edi
mov ecx, esi
call fcn.0050ffd8
or dword [esi + 0x134], 0xffffffff
push 0x2a
jmp 0x5225fc
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0055daac
mov esp, ebp
pop ebp
ret