joyce8/EMBER2024-capa huggingface dataset:
Function at 0x417202
Capabilities:
Check for time delay via gettickcount

Disassembly:
mov eax, 0x428a83
call sub.MSVCRT.dll__EH_prolog
sub esp, 0x820
push esi
push dword [ebp + 8]
call sub.MSVCRT.dll_strlen
mov esi, 0xff
cmp eax, esi
pop ecx
jbe 0x41722c
xor eax, eax
jmp 0x4173a1
push ebx
push edi
xor edi, edi
push edi
lea ecx, [ebp - 0x82c]
call fcn.004076c2
push edi
push edi
push 0x50
push dword [ebp + 8]
lea ecx, [ebp - 0x82c]
mov dword [ebp - 4], edi
call fcn.00407794
test al, al
je 0x41738e
push 0x3e803
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
push esi
push 1
mov ebx, eax
call fcn.00411aba
push 0x3e801
push edi
push ebx
movsx esi, al
call sub.MSVCRT.dll_memset
push 0x3e800
push esi
push ebx
call sub.MSVCRT.dll_memset
push ebx
call sub.MSVCRT.dll_strlen
push 0x3ebea
mov dword [ebp - 0x10], eax
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
push dword [ebp - 0x10]
mov esi, eax
push dword [ebp + 8]
push str.POST___HTTP_1.0_r_nHost:__s_r_nContent_Length:__d_r_n_r_n
push esi
call dword [sym.imp.USER32.dll_wsprintfA]
push ebx
push esi
call sub.MSVCRT.dll_strcat
add esp, 0x44
push 0x430b84
push esi
call sub.MSVCRT.dll_strcat
push esi
call sub.MSVCRT.dll_strlen
add esp, 0xc
mov dword [ebp - 0x10], eax
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, dword [ebp - 0x10]
mov dword [ebp - 0x18], eax
xor eax, eax
cmp ecx, edi
mov dword [ebp + 8], eax
jbe 0x417329
mov dword [ebp - 0x14], ecx
mov edi, 0x400
jmp 0x4172f2
mov eax, dword [ebp + 8]
mov ecx, dword [ebp - 0x10]
sub ecx, eax
cmp ecx, edi
push 0
jae 0x417302
push dword [ebp - 0x14]
jmp 0x417303
push edi
add eax, esi
push eax
lea ecx, [ebp - 0x82c]
call fcn.00407bf4
test al, al
je 0x4173ae
add dword [ebp + 8], edi
mov eax, dword [ebp + 8]
sub dword [ebp - 0x14], edi
cmp eax, dword [ebp - 0x10]
jb 0x4172ef
xor edi, edi
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [ebp - 0x18]
mov dword [ebp - 0x18], edi
mov dword [ebp - 0x1c], eax
fild qword [ebp - 0x1c]
fmul dword [0x42a48c]
fcom dword [0x42a488]
fnstsw ax
sahf
jne 0x417350
fstp st(0)
fld1
mov eax, dword [ebp - 0x10]
mov dword [ebp - 0x1c], eax
mov dword [ebp - 0x18], edi
fidivr dword [ebp - 0x1c]
lea ecx, [ebp - 0x82c]
fmul dword [0x42a484]
fmul dword [0x42a480]
fstp dword [ebp + 8]
call fcn.004078e6
push ebx
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
push esi
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
fld dword [ebp + 8]
pop ecx
pop ecx
call sub.MSVCRT.dll__ftol
mov edi, eax
or dword [ebp - 4], 0xffffffff
lea ecx, [ebp - 0x82c]
call fcn.00407758
mov eax, edi
pop edi
pop ebx
mov ecx, dword [ebp - 0xc]
pop esi
mov dword fs:[0], ecx
leave
ret
lea ecx, [ebp - 0x82c]
call fcn.004078e6
push ebx
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
push esi
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
pop ecx
pop ecx
xor edi, edi
jmp 0x41738e
Function at 0x41de93
Capabilities:
Create udp socket
Resolve dns
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
mov eax, 0xfff0
call fcn.00425510
push ebx
push 0x11
push 2
push 2
call dword [sym.imp.WS2_32.dll_socket]
push 0x10
mov dword [ebp - 0x14], eax
xor ebx, ebx
lea eax, [ebp - 0x10]
push ebx
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
push dword [ebp + 8]
mov word [ebp - 0x10], 2
call dword [sym.imp.WS2_32.dll_inet_addr]
cmp eax, 0xffffffff
jne 0x41def0
push dword [ebp + 8]
call dword [sym.imp.WS2_32.dll_gethostbyname]
cmp eax, ebx
jne 0x41dee9
xor eax, eax
jmp 0x41dfe1
mov eax, dword [eax + 0xc]
mov eax, dword [eax]
mov eax, dword [eax]
cmp dword [ebp + 0x18], ebx
mov dword [ebp - 0xc], eax
jne 0x41df13
call sub.MSVCRT.dll_rand
cdq
mov ecx, 0xffdc
idiv ecx
inc edx
push edx
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0xe], ax
jmp 0x41df28
push dword [ebp + 0x18]
call dword [sym.imp.WS2_32.dll_htons]
push 1
pop ecx
cmp dword [ebp + 0x18], ecx
mov word [ebp - 0xe], ax
jge 0x41df2e
push 1
pop ecx
mov dword [ebp + 0x18], ecx
mov eax, 0xffff
cmp dword [ebp + 0x18], eax
jle 0x41df3b
mov dword [ebp + 0x18], eax
cmp dword [ebp + 0x14], ebx
jne 0x41df43
mov dword [ebp + 0x14], ecx
mov eax, dword [ebp + 0xc]
push esi
push edi
push 0xa
cdq
pop ecx
idiv ecx
xor esi, esi
cmp dword [ebp + 0x10], ebx
mov edi, eax
jle 0x41df71
call sub.MSVCRT.dll_rand
cdq
mov ecx, 0xff
idiv ecx
inc esi
cmp esi, dword [ebp + 0x10]
mov byte [ebp + esi - 0xfff1], dl
jl 0x41df57
mov eax, edi
dec edi
test eax, eax
jle 0x41dfdc
mov eax, dword [0x43e448]
cmp byte [eax + 0x5444], bl
je 0x41dfdc
push 0xb
pop esi
push 0x10
lea eax, [ebp - 0x10]
push eax
push ebx
call sub.MSVCRT.dll_rand
push 0xa
cdq
pop ecx
idiv ecx
mov eax, dword [ebp + 0x10]
sub eax, edx
push eax
lea eax, [ebp - 0xfff0]
push eax
push dword [ebp - 0x14]
call dword [sym.imp.WS2_32.dll_sendto]
push dword [ebp + 0x14]
call dword [sym.imp.KERNEL32.dll_Sleep]
dec esi
jne 0x41df88
cmp dword [ebp + 0x18], ebx
jne 0x41df71
call sub.MSVCRT.dll_rand
cdq
mov ecx, 0xffdc
idiv ecx
inc edx
push edx
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0xe], ax
jmp 0x41df71
push 1
pop eax
pop edi
pop esi
pop ebx
leave
ret
Function at 0x41dffa
Capabilities:
Connect socket
Get socket status
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x210
and dword [ebp - 4], 0
cmp dword [ebp + 0x14], 0
push ebx
push esi
push edi
push 1
pop edi
mov dword [ebp - 8], edi
jne 0x41e02a
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push dword [ebp + 8]
call dword [sym.imp.WS2_32.dll_connect]
jmp 0x41e101
mov esi, dword [ebp + 8]
lea eax, [ebp - 8]
push eax
push 0x8004667e
push esi
call dword [sym.imp.WS2_32.dll_ioctlsocket]
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push esi
call dword [sym.imp.WS2_32.dll_connect]
or ebx, 0xffffffff
cmp eax, ebx
jne 0x41e062
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
jne 0x41e0fb
push dword [ebp + 0x14]
lea eax, [ebp - 0x210]
push 0
push eax
lea eax, [ebp - 0x10c]
push eax
lea eax, [esi + 1]
push eax
mov dword [ebp - 0x108], esi
mov dword [ebp - 0x10c], edi
mov dword [ebp - 0x20c], esi
mov dword [ebp - 0x210], edi
call dword [sym.imp.WS2_32.dll_select]
test eax, eax
jne 0x41e0a2
push 0x274c
jmp 0x41e0f5
cmp eax, ebx
je 0x41e0fb
lea eax, [ebp - 0x10c]
push eax
push esi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
jne 0x41e0c8
lea eax, [ebp - 0x210]
push eax
push esi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x41e0fb
lea eax, [ebp + 8]
push eax
lea eax, [ebp - 4]
push eax
push 0x1007
push 0xffff
push esi
mov dword [ebp + 8], 4
call dword [sym.imp.WS2_32.dll_getsockopt]
cmp eax, ebx
je 0x41e0fb
cmp dword [ebp - 4], 0
je 0x41e0ff
push dword [ebp - 4]
call dword [sym.imp.WS2_32.dll_WSASetLastError]
mov eax, ebx
jmp 0x41e101
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret
Function at 0x4221ae
Capabilities:
Get socket status

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x110
push ebx
push esi
mov esi, dword [ebp + 8]
mov eax, dword [esi + 0x18]
xor ecx, ecx
xor ebx, ebx
cmp eax, ecx
mov dword [ebp - 4], ecx
je 0x4222a7
cmp dword [esi + 0x30], ecx
je 0x4222a7
cmp eax, 2
jne 0x4221e7
lea eax, [ebp - 0x110]
mov dword [ebp - 4], eax
jmp 0x4221ed
lea ebx, [ebp - 0x110]
push edi
mov dword [ebp - 0x110], ecx
xor ecx, ecx
cmp ecx, dword [ebp - 0x110]
jae 0x42221d
mov edx, dword [esi + 8]
lea eax, [ebp - 0x10c]
cmp dword [eax], edx
je 0x422217
inc ecx
add eax, 4
cmp ecx, dword [ebp - 0x110]
jb 0x422207
cmp ecx, dword [ebp - 0x110]
jne 0x422238
cmp dword [ebp - 0x110], 0x40
jae 0x422238
mov eax, dword [esi + 8]
mov dword [ebp + ecx*4 - 0x10c], eax
inc dword [ebp - 0x110]
mov eax, dword [esi + 0x28]
mov dword [ebp - 0xc], eax
mov eax, dword [esi + 0x2c]
mov dword [ebp - 8], eax
lea eax, [ebp - 0xc]
push eax
mov eax, dword [esi + 8]
xor edi, edi
push edi
push dword [ebp - 4]
inc eax
push ebx
push eax
call dword [sym.imp.WS2_32.dll_select]
cmp eax, 0xffffffff
je 0x42227b
cmp eax, edi
jg 0x42229f
push dword [esi + 0x34]
push dword [esi + 0x38]
push esi
call dword [esi + 0x30]
mov edi, eax
add esp, 0xc
test edi, edi
je 0x4222a2
jmp 0x4221f4
push 0x100
call sub.MSVCRT.dll__errno
push dword [eax]
call sub.MSVCRT.dll_strerror
pop ecx
push eax
mov eax, dword [esi + 0x1c]
add eax, 0x44
push eax
call sub.MSVCRT.dll_strncpy
add esp, 0xc
jmp 0x4222a2
push 1
pop edi
mov eax, edi
pop edi
jmp 0x4222aa
push 1
pop eax
pop esi
pop ebx
leave
ret
Function at 0x4222ae
Capabilities:
Receive data
Receive data on socket

Disassembly:
push ebp
mov ebp, esp
push ecx
push ecx
push ebx
mov ebx, dword [ebp + 8]
push esi
mov esi, dword [ebp + 0x10]
mov eax, dword [esi + 0x18]
xor ecx, ecx
cmp eax, ecx
push edi
mov dword [ebp - 4], ecx
mov dword [ebp - 8], ecx
je 0x4222d8
cmp eax, 1
je 0x4222d8
or eax, 0xffffffff
jmp 0x4223c0
cmp dword [ebp + 0xc], ecx
jne 0x4222e4
xor eax, eax
jmp 0x4223c0
mov edi, dword [esi + 0xc]
test edi, edi
jle 0x422322
mov eax, dword [ebp + 0xc]
cmp eax, edi
jge 0x4222f5
lea edi, [eax - 1]
push edi
push 0xa
push dword [esi + 4]
push ebx
call sub.MSVCRT.dll__memccpy
add esp, 0x10
test eax, eax
je 0x42230c
mov edi, eax
sub edi, ebx
and byte [ebx + edi], 0
add dword [ebp - 4], edi
sub dword [ebp + 0xc], edi
add dword [esi + 4], edi
sub dword [esi + 0xc], edi
add ebx, edi
test eax, eax
jne 0x422380
cmp dword [ebp + 0xc], 1
je 0x42239e
mov eax, dword [esi]
cmp eax, dword [esi + 4]
jne 0x422342
mov eax, dword [esi + 0x14]
and dword [esi + 0xc], 0
mov dword [esi + 4], eax
mov dword [esi], eax
mov dword [esi + 0x10], 0x2000
cmp dword [ebp - 8], 0
jne 0x4223a6
push esi
call fcn.004221ae
test eax, eax
pop ecx
je 0x4223bd
push 0
push dword [esi + 0x10]
push dword [esi]
push dword [esi + 8]
call dword [sym.imp.WS2_32.dll_recv]
cmp eax, 0xffffffff
je 0x4223ae
test eax, eax
jne 0x422373
mov dword [ebp - 8], 1
sub dword [esi + 0x10], eax
add dword [esi + 0xc], eax
add dword [esi], eax
jmp 0x4222e4
dec ebx
dec ebx
push 0x430b84
push ebx
call sub.MSVCRT.dll_strcmp
test eax, eax
pop ecx
pop ecx
jne 0x4223bd
mov byte [ebx], 0xa
and byte [ebx + 1], al
dec dword [ebp - 4]
jmp 0x4223bd
mov eax, dword [ebp + 8]
and byte [eax], 0
jmp 0x4223bd
cmp dword [ebp - 4], 0
jne 0x4223bd
jmp 0x4223b9
push str.read
call sub.MSVCRT.dll_perror
pop ecx
or dword [ebp - 4], 0xffffffff
mov eax, dword [ebp - 4]
pop edi
pop esi
pop ebx
leave
ret
Function at 0x4223c5
Capabilities:
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
push ecx
push ecx
push ebx
push esi
push edi
mov edi, dword [ebp + 0x10]
xor ecx, ecx
xor ebx, ebx
xor al, al
cmp dword [edi + 0x18], 2
jne 0x4224d0
cmp dword [ebp + 0xc], ecx
mov edx, dword [edi + 0x14]
mov dword [ebp - 4], edx
mov dword [ebp + 0x10], ecx
jle 0x4224d5
mov esi, 0x2000
mov edx, dword [ebp + 8]
add ecx, edx
cmp byte [ecx], 0xa
mov dword [ebp - 8], ecx
jne 0x422436
cmp al, 0xd
je 0x422436
cmp ebx, esi
jne 0x42242e
push edi
call fcn.004221ae
test eax, eax
pop ecx
je 0x422483
push 0
push esi
push dword [ebp - 4]
push dword [edi + 8]
call dword [sym.imp.WS2_32.dll_send]
mov ebx, eax
cmp ebx, esi
jne 0x422488
xor ebx, ebx
mov eax, dword [ebp - 4]
mov byte [eax + ebx], 0xd
inc ebx
cmp ebx, esi
jne 0x42245c
push edi
call fcn.004221ae
test eax, eax
pop ecx
je 0x422483
push 0
push esi
push dword [ebp - 4]
push dword [edi + 8]
call dword [sym.imp.WS2_32.dll_send]
mov ebx, eax
cmp ebx, esi
jne 0x422497
xor ebx, ebx
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 4]
mov al, byte [eax]
mov byte [ecx + ebx], al
mov ecx, dword [ebp + 0x10]
inc ebx
inc ecx
cmp ecx, dword [ebp + 0xc]
mov dword [ebp + 0x10], ecx
jl 0x4223f7
test ebx, ebx
je 0x4224d5
push edi
call fcn.004221ae
test eax, eax
pop ecx
jne 0x4224a6
mov eax, dword [ebp + 0x10]
jmp 0x4224d8
call sub.MSVCRT.dll__errno
push dword [eax]
push ebx
push str.net_write_1__returned__d__errno___d_n
jmp 0x4224c8
call sub.MSVCRT.dll__errno
push dword [eax]
push ebx
push str.net_write_2__returned__d__errno___d_n
jmp 0x4224c8
push 0
push ebx
push dword [ebp - 4]
push dword [edi + 8]
call dword [sym.imp.WS2_32.dll_send]
mov esi, eax
cmp esi, ebx
je 0x4224d5
call sub.MSVCRT.dll__errno
push dword [eax]
push esi
push str.net_write_3__returned__d__errno___d_n
call sub.MSVCRT.dll_printf
add esp, 0xc
or eax, 0xffffffff
jmp 0x4224d8
mov eax, dword [ebp + 0xc]
pop edi
pop esi
pop ebx
leave
ret

Function at 0x4225a3
Capabilities:
Initialize winsock library

Disassembly:
sub esp, 0x190
lea eax, [esp]
push eax
push 0x101
call dword [sym.imp.WS2_32.dll_WSAStartup]
test eax, eax
je 0x4225d0
push eax
push str.Network_failed_to_start:__d_n
push sym.imp.MSVCRT.dll_sscanf
call sub.MSVCRT.dll_fprintf
add esp, 0xc
add esp, 0x190
ret
Function at 0x4225d7
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Resolve dns
Set socket configuration

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
push ebx
push esi
push edi
push 0x10
xor ebx, ebx
lea eax, [ebp - 0x14]
push ebx
push eax
mov dword [ebp - 4], 1
call sub.MSVCRT.dll_memset
push dword [ebp + 8]
mov word [ebp - 0x14], 2
call sub.MSVCRT.dll__strdup
mov edi, eax
push 0x3a
push edi
call sub.MSVCRT.dll_strchr
mov esi, eax
add esp, 0x18
cmp esi, ebx
jne 0x422639
push 0x43c4c0
push 0x436110
call dword [sym.imp.WS2_32.dll_getservbyname]
cmp eax, ebx
jne 0x422667
push str.getservbyname
call sub.MSVCRT.dll_perror
jmp 0x4227a2
mov byte [esi], bl
movsx eax, byte [esi + 1]
inc esi
push eax
call sub.MSVCRT.dll_isdigit
test eax, eax
pop ecx
je 0x42265b
push esi
call sub.MSVCRT.dll_atoi
pop ecx
push eax
call dword [sym.imp.WS2_32.dll_htons]
jmp 0x42266b
push 0x43c4c0
push esi
call dword [sym.imp.WS2_32.dll_getservbyname]
mov ax, word [eax + 8]
push edi
mov word [ebp - 0x12], ax
call dword [sym.imp.WS2_32.dll_inet_addr]
or esi, 0xffffffff
cmp eax, esi
mov dword [ebp - 0x10], eax
jne 0x4226a8
push edi
call dword [sym.imp.WS2_32.dll_gethostbyname]
cmp eax, ebx
jne 0x422692
push str.gethostbyname
jmp 0x42262f
movsx ecx, word [eax + 0xa]
mov eax, dword [eax + 0xc]
push ecx
push dword [eax]
lea eax, [ebp - 0x10]
push eax
call sub.MSVCRT.dll_memcpy
add esp, 0xc
push edi
call sub.MSVCRT.dll_free
pop ecx
push 6
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov edi, eax
cmp edi, esi
jne 0x4226cb
push str.socket
jmp 0x42262f
push 4
lea eax, [ebp - 4]
push eax
push 4
push 0xffff
push edi
call dword [sym.imp.WS2_32.dll_setsockopt]
cmp eax, esi
jne 0x4226fa
push str.setsockopt
call sub.MSVCRT.dll_perror
pop ecx
push edi
call dword [sym.imp.WS2_32.dll_closesocket]
jmp 0x4227a3
push 0x10
lea eax, [ebp - 0x14]
push eax
push edi
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, esi
jne 0x422712
push str.connect
jmp 0x4226e8
push 0x144
push 1
call sub.MSVCRT.dll_calloc
mov esi, eax
cmp esi, ebx
pop ecx
pop ecx
jne 0x42272d
push str.calloc
jmp 0x4226e8
push 0x2000
call sub.MSVCRT.dll_malloc
cmp eax, ebx
pop ecx
mov dword [esi + 0x14], eax
jne 0x422759
push str.calloc
call sub.MSVCRT.dll_perror
pop ecx
push edi
call dword [sym.imp.WS2_32.dll_closesocket]
push esi
call sub.MSVCRT.dll_free
jmp 0x4227a2
push esi
push 0x32
mov dword [esi + 8], edi
mov dword [esi + 0x18], ebx
mov dword [esi + 0x1c], ebx
mov dword [esi + 0x24], 1
mov dword [esi + 0x30], ebx
mov dword [esi + 0x2c], ebx
mov dword [esi + 0x28], ebx
mov dword [esi + 0x34], ebx
mov dword [esi + 0x38], ebx
mov dword [esi + 0x40], ebx
mov dword [esi + 0x3c], ebx
call fcn.004224dd
test eax, eax
pop ecx
pop ecx
jne 0x4227a7
push edi
call dword [sym.imp.WS2_32.dll_closesocket]
push dword [esi + 0x14]
call sub.MSVCRT.dll_free
push esi
call sub.MSVCRT.dll_free
pop ecx
pop ecx
xor eax, eax
jmp 0x4227af
mov eax, dword [ebp + 0xc]
push 1
mov dword [eax], esi
pop eax
pop edi
pop esi
pop ebx
leave
ret
Function at 0x4227b4
Capabilities:
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x100
push esi
mov esi, dword [ebp + 0x10]
cmp dword [esi + 0x18], 0
jne 0x42283e
cmp dword [0x43ef70], 2
jle 0x4227e5
push dword [ebp + 8]
push 0x431908
push sym.imp.MSVCRT.dll_sscanf
call sub.MSVCRT.dll_fprintf
add esp, 0xc
push dword [ebp + 8]
call sub.MSVCRT.dll_strlen
add eax, 3
cmp eax, 0x100
pop ecx
ja 0x42283e
push dword [ebp + 8]
lea eax, [ebp - 0x100]
push str._s_r_n
push eax
call sub.MSVCRT.dll_sprintf
add esp, 0xc
lea eax, [ebp - 0x100]
push 0
push eax
call sub.MSVCRT.dll_strlen
pop ecx
push eax
lea eax, [ebp - 0x100]
push eax
push dword [esi + 8]
call dword [sym.imp.WS2_32.dll_send]
test eax, eax
jg 0x422842
push str.write
call sub.MSVCRT.dll_perror
pop ecx
xor eax, eax
jmp 0x42284d
push esi
push dword [ebp + 0xc]
call fcn.004224dd
pop ecx
pop ecx
pop esi
leave
ret
Function at 0x422be3
Capabilities:
Get socket status

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x11c
push ebx
push esi
mov esi, dword [ebp + 8]
mov ecx, dword [esi + 8]
push edi
mov edi, dword [ebp + 0xc]
mov eax, dword [edi + 8]
mov dword [ebp - 0x118], eax
mov dword [ebp - 0x11c], 1
xor ebx, ebx
lea edx, [ebp - 0x118]
cmp dword [edx], ecx
je 0x422c20
inc ebx
add edx, 4
cmp ebx, 1
jb 0x422c13
cmp ebx, 1
jne 0x422c35
mov dword [ebp - 0x114], ecx
mov dword [ebp - 0x11c], 2
xor ebx, ebx
cmp eax, ecx
mov dword [ebp - 4], ebx
mov dword [ebp - 8], 0x1e
jae 0x422c47
mov eax, ecx
lea ecx, [ebp - 8]
push ecx
push ebx
push ebx
lea ecx, [ebp - 0x11c]
push ecx
inc eax
push eax
call dword [sym.imp.WS2_32.dll_select]
cmp eax, 0xffffffff
jne 0x422c82
push 0x100
call sub.MSVCRT.dll__errno
push dword [eax]
call sub.MSVCRT.dll_strerror
pop ecx
push eax
add edi, 0x44
push edi
call sub.MSVCRT.dll_strncpy
add esp, 0xc
jmp 0x422c96
cmp eax, ebx
jne 0x422ca7
add edi, 0x44
push str.timed_out_waiting_for_connection
push edi
call sub.MSVCRT.dll_strcpy
pop ecx
pop ecx
push dword [esi + 8]
call dword [sym.imp.WS2_32.dll_closesocket]
mov dword [esi + 8], ebx
jmp 0x422d3e
lea eax, [ebp - 0x11c]
push eax
push dword [esi + 8]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x422d15
lea eax, [ebp + 0xc]
push eax
lea eax, [ebp - 0x18]
push eax
push dword [esi + 8]
mov dword [ebp + 0xc], 0x10
call dword [sym.imp.WS2_32.dll_accept]
mov ebx, eax
call sub.MSVCRT.dll__errno
mov eax, dword [eax]
push dword [esi + 8]
mov dword [ebp + 8], eax
call dword [sym.imp.WS2_32.dll_closesocket]
test ebx, ebx
jle 0x422cf3
push 1
pop eax
mov dword [esi + 8], ebx
jmp 0x422d45
push 0x100
push dword [ebp + 8]
call sub.MSVCRT.dll_strerror
pop ecx
push eax
add edi, 0x44
push edi
call sub.MSVCRT.dll_strncpy
add esp, 0xc
xor eax, eax
mov dword [esi + 8], eax
jmp 0x422d45
lea eax, [ebp - 0x11c]
push eax
push dword [edi + 8]
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x422d42
push dword [esi + 8]
call dword [sym.imp.WS2_32.dll_closesocket]
push edi
push 0x32
mov dword [esi + 8], ebx
call fcn.004224dd
pop ecx
pop ecx
xor eax, eax
jmp 0x422d45
mov eax, dword [ebp + 0xc]
pop edi
pop esi
pop ebx
leave
ret

Function at 0x422ec6
Capabilities:
Receive data
Receive data on socket

Disassembly:
push ebp
mov ebp, esp
push esi
mov esi, dword [ebp + 0x10]
cmp dword [esi + 0x18], 1
push edi
jne 0x422f38
cmp dword [esi + 0x14], 0
push esi
je 0x422eeb
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.004222ae
add esp, 0xc
jmp 0x422f07
call fcn.004221ae
cmp eax, 1
pop ecx
jne 0x422f38
push 0
push dword [ebp + 0xc]
push dword [ebp + 8]
push dword [esi + 8]
call dword [sym.imp.WS2_32.dll_recv]
mov edi, eax
cmp edi, 0xffffffff
je 0x422f38
add dword [esi + 0x38], edi
mov ecx, dword [esi + 0x30]
test ecx, ecx
mov edx, dword [esi + 0x38]
je 0x422f40
mov eax, dword [esi + 0x3c]
test eax, eax
je 0x422f40
add dword [esi + 0x40], edi
cmp dword [esi + 0x40], eax
jle 0x422f40
push dword [esi + 0x34]
push edx
push esi
call ecx
add esp, 0xc
test eax, eax
jne 0x422f3c
xor eax, eax
jmp 0x422f42
and dword [esi + 0x40], 0
mov eax, edi
pop edi
pop esi
pop ebp
ret
Function at 0x422f46
Capabilities:
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
push esi
mov esi, dword [ebp + 0x10]
cmp dword [esi + 0x18], 2
push edi
jne 0x422f89
cmp dword [esi + 0x14], 0
push esi
je 0x422f6b
push dword [ebp + 0xc]
push dword [ebp + 8]
call fcn.004223c5
add esp, 0xc
jmp 0x422f82
call fcn.004221ae
pop ecx
push 0
push dword [ebp + 0xc]
push dword [ebp + 8]
push dword [esi + 8]
call dword [sym.imp.WS2_32.dll_send]
mov edi, eax
cmp edi, 0xffffffff
jne 0x422f8d
xor eax, eax
jmp 0x422fb9
add dword [esi + 0x38], edi
mov eax, dword [esi + 0x30]
test eax, eax
mov edx, dword [esi + 0x38]
je 0x422fb7
mov ecx, dword [esi + 0x3c]
test ecx, ecx
je 0x422fb7
add dword [esi + 0x40], edi
cmp dword [esi + 0x40], ecx
jle 0x422fb7
push dword [esi + 0x34]
push edx
push esi
call eax
add esp, 0xc
and dword [esi + 0x40], 0
mov eax, edi
pop edi
pop esi
pop ebp
ret

Function at 0x42304c
Capabilities:
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
cmp dword [ebp + 8], 0
push edi
mov dword [ebp - 0x10], 1
je 0x4230be
mov ax, word [0x43c61c]
mov word [ebp - 8], ax
xor eax, eax
cmp dword [ebp + 0x14], 4
lea edi, [ebp - 6]
stosw word es:[edi], ax
jne 0x42307b
mov byte [ebp - 8], 0x72
cmp dword [ebp + 0x18], 0x49
jne 0x423085
mov byte [ebp - 7], 0x62
lea eax, [ebp - 8]
push eax
push dword [ebp + 8]
call sub.MSVCRT.dll_fopen
test eax, eax
pop ecx
pop ecx
mov dword [ebp - 4], eax
jne 0x4230d2
push 0x100
call sub.MSVCRT.dll__errno
push dword [eax]
call sub.MSVCRT.dll_strerror
pop ecx
push eax
mov eax, dword [ebp + 0x10]
add eax, 0x44
push eax
call sub.MSVCRT.dll_strncpy
add esp, 0xc
jmp 0x4230ee
cmp dword [ebp + 0x14], 4
mov dword [ebp - 4], sym.imp.MSVCRT.dll__iob
je 0x4230d2
mov dword [ebp - 4], sym.imp.MSVCRT.dll__except_handler3
lea eax, [ebp - 0xc]
push eax
push dword [ebp + 0x10]
push dword [ebp + 0x18]
push dword [ebp + 0x14]
push dword [ebp + 0xc]
call fcn.00422d4a
add esp, 0x14
test eax, eax
jne 0x4230f5
xor eax, eax
jmp 0x4231a2
push ebx
push esi
mov esi, 0x2000
push esi
call sub.MSVCRT.dll_malloc
cmp dword [ebp + 0x14], 4
pop ecx
mov ebx, eax
jne 0x423142
push dword [ebp - 4]
push esi
push 1
push ebx
call sub.MSVCRT.dll_fread
mov edi, eax
add esp, 0x10
test edi, edi
jle 0x423175
push dword [ebp - 0xc]
push edi
push ebx
call fcn.00422f46
add esp, 0xc
cmp eax, edi
jge 0x42310b
push eax
push edi
push str.short_write:_passed__d__wrote__d_n
call sub.MSVCRT.dll_printf
add esp, 0xc
jmp 0x423171
push dword [ebp - 0xc]
push esi
push ebx
call fcn.00422ec6
add esp, 0xc
test eax, eax
jle 0x423175
push dword [ebp - 4]
push eax
push 1
push ebx
call sub.MSVCRT.dll_fwrite
add esp, 0x10
test eax, eax
ja 0x423142
push str.localfile_write
call sub.MSVCRT.dll_perror
pop ecx
and dword [ebp - 0x10], 0
push ebx
call sub.MSVCRT.dll_free
push dword [ebp - 4]
call sub.MSVCRT.dll_fflush
cmp dword [ebp + 8], 0
pop ecx
pop ecx
pop esi
pop ebx
je 0x423196
push dword [ebp - 4]
call sub.MSVCRT.dll_fclose
pop ecx
push dword [ebp - 0xc]
call fcn.00422fbd
mov eax, dword [ebp - 0x10]
pop ecx
pop edi
leave
ret