joyce8/EMBER2024-capa huggingface dataset:
Function at 0x501372
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 0x501adf
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x110
mov eax, dword [0x5ca1c8]
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 0x501b0e
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 0x501b3d
dec eax
or eax, 0xfffffff0
inc eax
movzx eax, byte [eax + ebx]
add eax, ecx
add edi, eax
and edi, 0x800000ff
jns 0x501b55
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 0x501b27
mov edi, dword [ebp + 0xc]
mov ebx, dword [ebp - 0x110]
sub edi, ebx
mov dword [ebp - 0x108], 0x20
inc esi
and esi, 0x800000ff
jns 0x501b99
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 0x501bb9
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 0x501bee
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 0x501b88
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0055fedc
mov esp, ebp
pop ebp
ret
Function at 0x501e5c
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0xc4
mov eax, dword [0x5ca1c8]
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.00501e0c
lea eax, [esp + 0x84]
mov edx, 0x583988
push eax
push 0
call fcn.00501e0c
lea ecx, [esp + 0x20]
call fcn.00501372
push 0x20
lea edx, [esp + 0x90]
call fcn.00501396
add esp, 0x14
lea edx, [esp + 0x10]
lea ecx, [esp + 0x6c]
call fcn.005012da
push 0x32
pop esi
lea ecx, [esp + 0x10]
call fcn.00501372
push 0x10
lea edx, [esp + 0x70]
call fcn.00501396
pop ecx
lea edx, [esp + 0x10]
lea ecx, [esp + 0x6c]
call fcn.005012da
dec esi
jne 0x501ece
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 0x501f07
lea eax, [esp + 0x7c]
push eax
push ecx
push eax
push ecx
lea edx, [esp + 0xac]
call fcn.00501adf
add esp, 0x10
inc ebx
cmp ebx, 0x14
jl 0x501f05
lea ecx, [esp + 0x10]
call fcn.00501372
push 0x20
lea edx, [esp + 0xb0]
call fcn.00501396
push 0x20
lea edx, [esp + 0x84]
lea ecx, [esp + 0x18]
call fcn.00501396
pop ecx
pop ecx
lea edx, [esp + 0x10]
lea ecx, [esp + 0x6c]
call fcn.005012da
push 0x32
pop esi
lea ecx, [esp + 0x10]
call fcn.00501372
push 0x10
lea edx, [esp + 0x70]
call fcn.00501396
pop ecx
lea edx, [esp + 0x10]
lea ecx, [esp + 0x6c]
call fcn.005012da
dec esi
jne 0x501f72
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.0055fedc
mov esp, ebp
pop ebp
ret

Function at 0x503ffb
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.0050411f
test al, al
je 0x50407a
xor edx, edx
mov ecx, edi
inc edx
call fcn.0050411f
test al, al
je 0x50407a
mov esi, dword [ebp + 8]
xor edx, edx
inc edx
mov ecx, esi
call fcn.0050411f
mov ecx, dword [ebp + 0xc]
test al, al
je 0x504080
mov edx, ecx
xor eax, eax
shr edx, 2
test edx, edx
je 0x50406b
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 0x504051
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 0x504094
add ebx, eax
add edi, eax
add esi, eax
jmp 0x504080
mov ecx, dword [ebp + 0xc]
mov esi, dword [ebp + 8]
test ecx, ecx
je 0x504094
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 0x504088
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
Function at 0x505707
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 + 0x58e700]
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 + 0x5d2b30], eax
or ecx, ebx
mov dword [edi*8 + 0x5d2b34], ecx
inc edi
cmp edi, 0x100
jl 0x50570e
pop edi
mov dword [0x5d3338], ebx
mov dword [0x5d333c], ebx
mov dword [0x5d3330], ebx
mov dword [0x5d3334], ebx
pop esi
mov byte [0x5d29d2], 1
pop ebx
ret

Function at 0x505782
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 + 0x58e600]
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 + 0x5d39a0], eax
mov dword [edx*8 + 0x5d39a4], ecx
inc edx
mov dword [ebp - 0x14], edx
cmp edx, 0x100
jl 0x505790
pop edi
pop esi
mov byte [0x5d29d1], 1
pop ebx
mov esp, ebp
pop ebp
ret
Function at 0x50a347
Capabilities:
Initialize winsock library

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x19c
mov eax, dword [0x5ca1c8]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [0x5d37e4]
mov edx, eax
inc eax
mov dword [0x5d37e4], eax
push ebx
mov ebx, ecx
test edx, edx
jne 0x50a42b
mov eax, dword [sym.imp.MSVCR120.dll_malloc]
mov dword [0x5ccf5c], eax
mov eax, dword [sym.imp.MSVCR120.dll_free]
mov dword [0x5cdc40], eax
mov eax, dword [sym.imp.MSVCR120.dll_realloc]
mov dword [0x5cdc44], eax
mov eax, dword [sym.imp.MSVCR120.dll__strdup]
mov dword [0x5cd43c], eax
mov eax, dword [sym.imp.MSVCR120.dll_calloc]
mov dword [0x5cdc48], eax
test bl, 1
je 0x50a3d1
cmp dword [0x5d334c], edx
jne 0x50a3d1
mov dword [0x5d334c], 1
call dword [sym.imp.SSLEAY32.dll_Ordinal_74]
call dword [sym.imp.SSLEAY32.dll_Ordinal_183]
test eax, eax
je 0x50a403
call dword [sym.imp.LIBEAY32.dll_Ordinal_3212]
test bl, 2
je 0x50a408
lea eax, [ebp - 0x198]
push eax
push 0x202
call dword [sym.imp.WS2_32.dll_WSAStartup]
test eax, eax
jne 0x50a403
mov eax, dword [ebp - 0x198]
cmp al, 2
jne 0x50a3fd
shr eax, 8
cmp al, 2
je 0x50a408
call dword [sym.imp.WS2_32.dll_WSACleanup]
push 2
pop eax
jmp 0x50a42d
push 0
mov dword [0x5d379c], ebx
call dword [sym.imp.MSVCR120.dll__time64]
pop ecx
mov dword [0x5d3848], eax
call fcn.00512930
call fcn.00512930
call fcn.00512930
xor eax, eax
mov ecx, dword [ebp - 4]
xor ecx, ebp
pop ebx
call fcn.0055fedc
mov esp, ebp
pop ebp
ret
Function at 0x511411
Capabilities:
Get local ipv4 addresses
Get socket information

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10c
mov eax, dword [0x5ca1c8]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov edi, ecx
mov esi, edx
cmp dword [edi + 0x1c4], 0
mov ebx, dword [edi]
jne 0x511534
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 0x511483
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov esi, eax
mov ecx, edi
mov edx, esi
call fcn.0052af26
push eax
push esi
push str.getpeername___failed_with_errno__d:__s
push ebx
call fcn.005129bc
add esp, 0x10
jmp 0x51153b
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 0x5114c0
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov esi, eax
mov ecx, edi
mov edx, esi
call fcn.0052af26
push eax
push esi
push str.getsockname___failed_with_errno__d:__s
jmp 0x511475
lea eax, [edi + 0xcc]
push eax
lea edx, [edi + 0x9e]
lea ecx, [ebp - 0x88]
call fcn.005113c4
pop ecx
test eax, eax
jne 0x5114fa
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov ecx, edi
mov edx, esi
call fcn.0052af26
push eax
push esi
push str.ssrem_inet_ntop___failed_with_errno__d:__s
jmp 0x511475
lea eax, [edi + 0x100]
push eax
lea edx, [edi + 0xd0]
lea ecx, [ebp - 0x108]
call fcn.005113c4
pop ecx
test eax, eax
jne 0x511534
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov ecx, edi
mov edx, esi
call fcn.0052af26
push eax
push esi
push str.ssloc_inet_ntop___failed_with_errno__d:__s
jmp 0x511475
mov ecx, edi
call fcn.00511377
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0055fedc
mov esp, ebp
pop ebp
ret

Function at 0x511725
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 0x51176e
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov edx, eax
mov ecx, edi
call fcn.0052af26
push eax
push str.Could_not_set_TCP_NODELAY:__s_n
push esi
call fcn.00512948
add esp, 0xc
jmp 0x51177b
push str.TCP_NODELAY_set_n
push esi
call fcn.00512948
pop ecx
pop ecx
pop edi
pop esi
mov esp, ebp
pop ebp
ret
Function at 0x511c68
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 0x511cb5
mov eax, dword [ecx + 0x544]
mov eax, dword [eax]
mov eax, dword [eax + esi*4]
test eax, eax
je 0x511cb5
test edx, edx
je 0x511c8d
mov dword [edx], eax
cmp dword [eax + 0x150], 0
mov esi, dword [eax + 0x130]
je 0x511cbd
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 0x511cce
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 0x511cb1
mov eax, esi
jmp 0x511cb8

Function at 0x5125c7
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 [0x5cdc48]
pop ecx
pop ecx
mov edi, eax
mov dword [esi + 0x3e0], edi
push 8
pop ebx
test edi, edi
je 0x512682
mov eax, dword [ebp + 8]
xor ecx, ecx
mov edx, dword [ebp - 4]
mov dword [esi + 0x3d8], ecx
mov dword [esi + 0x3dc], ecx
mov dword [esi + 0x3d4], ecx
mov dword [esi + 0x3d0], eax
mov dword [edi], ecx
lea ecx, [edi + 0xc]
push ecx
push eax
call fcn.0051246d
pop ecx
pop ecx
test eax, eax
je 0x512682
mov eax, dword [esi + 0x3cc]
test eax, eax
je 0x51263d
push eax
call dword [0x5cdc40]
and dword [esi + 0x3cc], 0
pop ecx
push dword [ebp - 4]
call dword [0x5cd43c]
mov dword [esi + 0x3cc], eax
pop ecx
test eax, eax
je 0x512682
xor ebx, ebx
lea eax, [edi + 0xc]
push ebx
push ebx
push eax
push 0x5124fa
push ebx
push ebx
call dword [sym.imp.MSVCR120.dll__beginthreadex]
add esp, 0x18
test eax, eax
je 0x512672
cmp eax, 0xffffffff
jne 0x512674
mov eax, ebx
mov dword [edi], eax
test eax, eax
jne 0x51269d
call dword [sym.imp.MSVCR120.dll__errno]
mov ebx, dword [eax]
lea ecx, [esi + 0x3cc]
call fcn.00512586
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 0x512696

Function at 0x512b60
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 0x512bd2
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
mov dword [ebp + 8], eax
cmp eax, 0x2733
jne 0x512ba8
xor esi, esi
mov dword [edi], 0x51
jmp 0x512bd2
mov edx, eax
mov ecx, ebx
call fcn.0052af26
push eax
push str.Send_failure:__s
push dword [ebx]
call fcn.005129bc
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 0x512f08
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 0x512f2d
push dword [edi + 0xf4]
push dword [ebp + 0xc]
push dword [ebp + 8]
push edx
push edi
call eax
add esp, 0x14
jmp 0x512f64
cmp edx, 2
ja 0x512f62
push dword [edi + 0xf0]
imul eax, edx, 3
push 1
push 2
add eax, 0x58e850
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 0x51a36b
Capabilities:
Get socket status

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x320
mov eax, dword [0x5ca1c8]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, ecx
or ebx, 0xffffffff
push edi
test esi, esi
je 0x51a39b
xor edi, edi
xor ecx, ecx
mov eax, edi
inc ecx
cmp dword [esi + eax*8], ebx
jne 0x51a3b3
inc eax
cmp eax, ecx
jb 0x51a391
mov ecx, ebx
call fcn.0051a045
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0055fedc
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 0x51a416
movzx ecx, word [esi + 4]
test cl, 7
je 0x51a416
cmp eax, ebx
cmova edx, eax
xor ebx, ebx
inc ebx
test bl, cl
je 0x51a3f4
mov dword [ebp - 0x214], eax
mov dword [ebp - 0x218], ebx
test cl, 4
je 0x51a405
mov dword [ebp - 0x10c], eax
mov dword [ebp - 0x110], ebx
test cl, 2
je 0x51a416
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 0x51a44e
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
test eax, eax
je 0x51a419
cmp eax, 0x2714
je 0x51a419
jmp 0x51a452
test eax, eax
jns 0x51a45a
or eax, 0xffffffff
jmp 0x51a3a2
jne 0x51a463
xor eax, eax
jmp 0x51a3a2
xor eax, eax
cmp dword [esi], 0xffffffff
mov word [esi + 6], ax
je 0x51a4bc
mov ebx, dword [sym.imp.WS2_32.dll___WSAFDIsSet]
lea eax, [ebp - 0x218]
push eax
push dword [esi]
call ebx
test eax, eax
je 0x51a48a
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 0x51a49e
or word [esi + 6], 4
lea eax, [ebp - 0x320]
push eax
push dword [esi]
call ebx
test eax, eax
je 0x51a4b2
or word [esi + 6], 2
cmp word [esi + 6], di
push 1
pop eax
cmovne edi, eax
mov eax, edi
jmp 0x51a3a2
Function at 0x51df76
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.00510e54
pop ecx
test eax, eax
js 0x51dff9
mov edi, dword [ebp + 0xc]
or esi, 0xffffffff
mov ecx, dword [ebp - 4]
mov edx, esi
push eax
push esi
call fcn.0051a064
pop ecx
pop ecx
test eax, eax
jle 0x51dffc
push 0
push edi
push dword [ebp + 8]
push dword [ebp - 4]
call dword [sym.imp.WS2_32.dll_recv]
cmp eax, esi
jne 0x51dfd7
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
je 0x51dfe6
push 0x38
jmp 0x51dffb
cmp edi, eax
je 0x51e005
test eax, eax
je 0x51dffc
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.00510e54
pop ecx
test eax, eax
jns 0x51dfa1
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 0x51dffc
Function at 0x522ccb
Capabilities:
Receive data
Receive data on socket

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x94
mov eax, dword [0x5ca1c8]
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 + 0x3f0]
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 0x522d5b
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 0x522d8d
push str.Received_too_short_packet
push edi
call fcn.005129bc
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.0055fedc
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 0x522e0d
dec edx
je 0x522e82
dec edx
je 0x522de3
dec edx
je 0x522dca
push str.Internal_error:_Unexpected_packet
push 0x59813c
push edi
call fcn.005129bc
jmp 0x522e08
lea eax, [ebx - 2]
lea edx, [ecx + 2]
mov ecx, esi
push eax
call fcn.00521f79
pop ecx
test eax, eax
je 0x522e82
jmp 0x522d7c
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 0x59dd0c
push edi
mov dword [esi + 8], ecx
call fcn.00512948
add esp, 0xc
jmp 0x522e82
cmp ebx, 4
jle 0x522e82
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 0x522e82
lea eax, [ebx - 4]
add ecx, 4
push eax
xor edx, edx
push ecx
mov ecx, dword [ebp - 0x90]
inc edx
call fcn.00512cd2
mov ebx, eax
pop ecx
pop ecx
test ebx, ebx
je 0x522e60
push 5
pop edx
mov ecx, esi
call fcn.00522a93
mov eax, ebx
jmp 0x522d7c
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.0051a948
test eax, eax
je 0x522d7a
push 5
pop edx
mov ecx, esi
call fcn.00522a93
push 0x2a
pop eax
jmp 0x522d7c
Function at 0x524281
Capabilities:
Get local ipv4 addresses
Get socket information
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
mov eax, dword [0x5ca1c8]
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 0x5242d8
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.00511cd2
cmp edi, 0xffffffff
jne 0x5242f9
push str.Error_accept__ing_server_connect
push ebx
call fcn.005129bc
pop ecx
pop ecx
push 0x1e
pop eax
jmp 0x52435d
push str.Connection_accepted_from_server_n
push ebx
call fcn.00512948
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 0x52435b
push ecx
push edi
push dword [ebx + 0x170]
call eax
add esp, 0xc
test eax, eax
je 0x52435b
mov edx, edi
mov ecx, esi
call fcn.00511cd2
or dword [esi + 0x134], 0xffffffff
push 0x2a
jmp 0x5242f6
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0055fedc
mov esp, ebp
pop ebp
ret