joyce8/EMBER2024-capa huggingface dataset:
Function at 0x103fe05
Capabilities:
Access the windows event log
Persist via windows service
Set registry value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x2c
mov eax, dword [0x107342c]
push ebx
mov ebx, dword [ebp + 8]
push edi
xor edi, edi
cmp ebx, 0xc000000d
mov dword [ebp - 4], eax
je 0x103ff0b
cmp ebx, 0xc0000017
je 0x103ff02
cmp ebx, 0xc0000023
je 0x103fef9
cmp ebx, 0xc000009a
je 0x103ff02
cmp ebx, 0xc0000321
je 0x103fe60
mov dword [ebp - 0x20], 0x8010001f
jmp 0x103ff19
call dword [fcn.0100149c]
mov ecx, 0x8010002a
cmp eax, ecx
mov dword [ebp - 0x20], eax
ja 0x103feb3
je 0x103fee4
cmp eax, 0x8009000d
je 0x103feac
cmp eax, 0x80090016
je 0x103fea5
cmp eax, 0x80090019
je 0x103fea5
cmp eax, 0x8010000a
je 0x103fe9e
cmp eax, 0x8010000c
je 0x103feeb
cmp eax, 0x80100013
jne 0x103ff11
mov ebx, 0xc0000387
jmp 0x103ff11
mov ebx, 0xc0000384
jmp 0x103ff11
mov ebx, 0xc0000386
jmp 0x103ff19
cmp eax, 0x8010002c
jb 0x103ff11
cmp eax, 0x8010002d
jbe 0x103fef2
cmp eax, 0x8010002f
je 0x103fe9e
cmp eax, 0x80100069
je 0x103feeb
cmp eax, 0x8010006b
je 0x103fee4
cmp eax, 0x8010006c
jne 0x103ff11
mov ebx, 0xc0000381
jmp 0x103ff19
mov ebx, 0xc0000380
jmp 0x103ff11
mov ebx, 0xc0000383
jmp 0x103ff11
mov ebx, 0xc0000385
jmp 0x103ff11
mov dword [ebp - 0x20], 0x80090321
jmp 0x103ff19
mov dword [ebp - 0x20], 0xe
jmp 0x103ff19
push 0xd
pop eax
mov dword [ebp - 0x20], eax
cmp eax, edi
je 0x1040018
lea eax, [ebp - 0x28]
push eax
lea eax, [ebp - 0x2c]
push eax
push edi
push 0x20006
push edi
push 0x1010d74
push edi
push 0x1015a80
push 0x80000002
call dword [sym.imp.ADVAPI32.dll_RegCreateKeyExW]
test eax, eax
jne 0x1040018
cmp dword [ebp - 0x28], 1
push esi
jne 0x103ff8d
mov esi, 0x1015a38
push esi
call dword [0x1001514]
pop ecx
lea eax, [eax + eax + 2]
push eax
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
push 2
push edi
push 0x1015a10
push dword [ebp - 0x2c]
call esi
push 4
lea eax, [ebp - 0x28]
push eax
push 4
push edi
push 0x10159f0
push dword [ebp - 0x2c]
mov dword [ebp - 0x28], 7
call esi
push dword [ebp - 0x2c]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push 0x10159cc
push edi
call dword [sym.imp.ADVAPI32.dll_RegisterEventSourceW]
mov esi, eax
cmp esi, edi
je 0x1040017
push edi
push edi
lea eax, [ebp - 0x24]
push eax
push edi
push dword [ebp - 0x20]
mov dword [ebp - 0x24], edi
push edi
push 0x1100
call dword [0x100130c]
test eax, eax
jne 0x103ffe0
push dword [ebp - 0x20]
lea eax, [ebp - 0x1c]
push 0x10159bc
push eax
call dword [0x1001534]
lea eax, [ebp - 0x1c]
add esp, 0xc
mov dword [ebp - 0x24], eax
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 0x24]
push eax
push 4
push 1
push edi
push dword [ebp + 0xc]
push edi
push 1
push esi
call dword [sym.imp.ADVAPI32.dll_ReportEventW]
push esi
call dword [sym.imp.ADVAPI32.dll_DeregisterEventSource]
cmp dword [ebp - 0x24], edi
je 0x1040017
lea eax, [ebp - 0x1c]
cmp dword [ebp - 0x24], eax
je 0x1040017
push dword [ebp - 0x24]
call dword [fcn.010014a0]
pop esi
mov ecx, dword [ebp - 4]
pop edi
mov eax, ebx
pop ebx
call fcn.0103e4d8
leave
ret 8
Function at 0x10402ca
Capabilities:
Hash data using sha1 via wincrypt
Hash data via wincrypt
Initialize hashing via wincrypt

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x1c
push esi
lea eax, [ebp - 4]
push eax
xor esi, esi
push esi
push dword [ebp + 0xc]
mov dword [ebp - 8], esi
push 0x8009
push dword [ebp + 8]
mov dword [ebp - 4], esi
call dword [sym.imp.ADVAPI32.dll_CryptCreateHash]
test eax, eax
jne 0x1040301
mov dword [ebp - 8], 0xc0000321
jmp 0x1040392
push edi
xor eax, eax
lea edi, [ebp - 0x1c]
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
stosd dword es:[edi], eax
push esi
lea eax, [ebp - 0x1c]
push eax
push 5
push dword [ebp - 4]
mov dword [ebp - 0x1c], 0x8004
call dword [sym.imp.ADVAPI32.dll_CryptSetHashParam]
test eax, eax
jne 0x1040330
mov dword [ebp - 8], 0xc0000321
jmp 0x1040391
push esi
push dword [ebp + 0x14]
push dword [ebp + 0x10]
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_CryptHashData]
test eax, eax
je 0x1040327
mov edi, dword [ebp + 0x18]
push ebx
mov ebx, dword [ebp + 0x1c]
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CryptGetHashParam]
push ebx
push dword [edi]
push 2
push dword [ebp - 4]
call esi
mov eax, dword [ebx]
test eax, eax
jbe 0x1040389
push eax
push 0x40
call dword [fcn.01001418]
test eax, eax
mov dword [edi], eax
jne 0x104037a
mov dword [ebp - 8], 0xc000009a
jmp 0x1040390
push 0
push ebx
push eax
push 2
push dword [ebp - 4]
call esi
test eax, eax
jne 0x1040390
mov dword [ebp - 8], 0xc0000321
pop ebx
pop edi
cmp dword [ebp - 4], 0
pop esi
je 0x10403a2
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_CryptDestroyHash]
mov eax, dword [ebp - 8]
leave
ret 0x18

Function at 0x1040520
Capabilities:
Generate random numbers via winapi

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
push ecx
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 4]
and dword [ebp - 4], 0
push ebx
push esi
push eax
call fcn.01040420
test eax, eax
mov dword [ebp + 8], eax
je 0x104056e
mov ebx, dword [ebp + 0xc]
mov esi, dword [sym.imp.ADVAPI32.dll_CryptGenRandom]
push edi
push 0x10
pop ecx
push ebx
push 0x20
push dword [ebp + 8]
xor eax, eax
mov edi, ebx
rep stosd dword es:[edi], eax
call esi
test eax, eax
pop edi
je 0x104056e
add ebx, 0x20
push ebx
push 0x20
push dword [ebp + 8]
call esi
test eax, eax
jne 0x1040580
push 0x10013
push 0xc0000321
call fcn.0103fe05
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
pop esi
pop ebx
leave
ret 8
Function at 0x1040b10
Capabilities:
Hash data via wincrypt
Initialize hashing via wincrypt

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x1c
push ebx
push esi
push edi
push dword [ebp + 8]
xor ebx, ebx
lea ecx, [ebp - 0x1c]
mov dword [ebp - 8], ebx
mov dword [ebp - 4], ebx
call fcn.0104142c
mov esi, dword [ebp + 0x10]
cmp esi, ebx
je 0x1040bf8
mov edi, esi
lea eax, [ebp - 4]
push eax
push ebx
push ebx
push dword [ebp + 0x14]
push edi
call dword [sym.imp.ADVAPI32.dll_CryptCreateHash]
test eax, eax
je 0x1040c1f
push ebx
push dword [ebp + 0x1c]
push dword [ebp + 0x18]
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_CryptHashData]
test eax, eax
je 0x1040c1f
cmp esi, ebx
jne 0x1040b8f
cmp dword [ebp + 8], ebx
je 0x1040b8f
push ebx
lea ecx, [ebp - 0x1c]
call fcn.010413a7
push eax
push 0x20
push edi
call dword [sym.imp.ADVAPI32.dll_CryptSetProvParam]
test eax, eax
je 0x1040c1f
push dword [ebp + 0x24]
push dword [ebp + 0x20]
push ebx
push ebx
push 1
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_CryptSignHashW]
test eax, eax
jne 0x1040bd6
call dword [fcn.0100149c]
sub eax, 0xea
neg eax
sbb eax, eax
and eax, 0x2fe
add eax, 0xc0000023
neg esi
sbb esi, esi
and esi, 7
add esi, 0x10007
push esi
push eax
call fcn.0103fe05
mov dword [ebp - 8], eax
cmp dword [ebp - 4], ebx
je 0x1040be4
push dword [ebp - 4]
call dword [sym.imp.ADVAPI32.dll_CryptDestroyHash]
mov esi, dword [ebp - 8]
lea ecx, [ebp - 0x1c]
call fcn.010411db
pop edi
mov eax, esi
pop esi
pop ebx
leave
ret 0x20
cmp dword [ebp + 8], ebx
je 0x1040c09
cmp dword [ebp - 0xc], ebx
jne 0x1040c09
mov esi, 0xc000009a
jmp 0x1040be7
mov eax, dword [ebp + 0xc]
mov ecx, dword [eax + 4]
push eax
call fcn.01040420
mov edi, eax
cmp edi, ebx
jne 0x1040b3b
mov eax, 0xc0000321
jmp 0x1040bbf
Function at 0x10416b6
Capabilities:
Query or enumerate registry value

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x228
mov eax, dword [0x107342c]
push ebx
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
push edi
mov dword [ebp - 0x220], eax
lea eax, [ebp - 0x21c]
push eax
mov ebx, 0x20019
push ebx
push 0
push 0x1010ef0
mov edi, 0x80000002
push edi
mov dword [ebp - 0x218], 0x63
call esi
test eax, eax
jne 0x1041753
lea eax, [ebp - 0x214]
push eax
lea eax, [ebp - 0x228]
push eax
lea eax, [ebp - 0x224]
push eax
push 0
push 0x1015bec
push dword [ebp - 0x21c]
mov dword [ebp - 0x214], 4
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
push dword [ebp - 0x21c]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
cmp dword [ebp - 0x228], 1
jne 0x1041753
xor eax, eax
jmp 0x104184f
cmp dword [ebp - 0x220], 0
je 0x1041849
push 0x1015b30
lea eax, [ebp - 0x20c]
push eax
call dword [0x100140c]
lea eax, [ebp - 0x20c]
push eax
call fcn.010415c0
push dword [ebp - 0x220]
push eax
call dword [0x100140c]
lea eax, [ebp - 0x210]
push eax
push ebx
push 0
lea eax, [ebp - 0x20c]
push eax
push edi
call esi
test eax, eax
jne 0x10417e1
lea eax, [ebp - 0x214]
push eax
lea eax, [ebp - 0x218]
push eax
lea eax, [ebp - 0x224]
push eax
push 0
push 0x1015bcc
push dword [ebp - 0x210]
mov dword [ebp - 0x214], 4
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
push dword [ebp - 0x210]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
push 0x1015b24
lea eax, [ebp - 0x20c]
push eax
call dword [0x10012dc]
lea eax, [ebp - 0x210]
push eax
push ebx
push 0
lea eax, [ebp - 0x20c]
push eax
push edi
call esi
test eax, eax
jne 0x1041849
lea eax, [ebp - 0x214]
push eax
lea eax, [ebp - 0x218]
push eax
lea eax, [ebp - 0x224]
push eax
push 0
push 0x1015bcc
push dword [ebp - 0x210]
mov dword [ebp - 0x214], 4
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
push dword [ebp - 0x210]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [ebp - 0x218]
mov ecx, dword [ebp - 4]
pop edi
pop esi
pop ebx
call fcn.0103e4d8
leave
ret 4
Function at 0x1053b3b
Capabilities:
Encode data using xor
Encrypt or decrypt via wincrypt
Set registry value

Disassembly:
mov eax, 0x106bdc7
call fcn.01055bd8
sub esp, 0x20
push ebx
push dword [ebp + 0x14]
xor ebx, ebx
push ebx
mov dword [ebp - 0x20], ecx
mov dword [ebp - 0x1c], ebx
call dword [fcn.01001470]
push eax
call dword [0x100146c]
push eax
lea ecx, [ebp - 0x2c]
call fcn.01047224
mov eax, dword [ebp - 0x2c]
lea ecx, [ebp - 0x2c]
mov dword [ebp - 4], ebx
call dword [eax + 8]
test eax, eax
jne 0x1053b85
mov ebx, 0x8007000e
jmp 0x1053d08
mov eax, dword [ebp - 0x2c]
push esi
mov esi, dword [ebp + 0x10]
push edi
lea ecx, [ebp - 0x2c]
call dword [eax + 8]
mov ecx, dword [ebp + 0x14]
mov edi, eax
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov eax, dword [ebp - 0x2c]
lea ecx, [ebp - 0x2c]
call dword [eax + 8]
push 8
pop edx
cmp dword [ebp + 0x14], edx
jb 0x1053c3f
mov dword [ebp + 0x10], edx
sub dword [ebp + 0x10], eax
mov ecx, eax
mov edx, dword [ecx]
mov esi, dword [ecx + 4]
xor edi, edi
mov dword [ebp - 0x14], edi
mov eax, 0x60b920f7
add eax, 0x3d7e58c2
mov dword [ebp - 0x14], eax
mov dword [ebp - 0x18], 0x20
mov eax, esi
shr eax, 5
mov ebx, esi
shl ebx, 4
xor eax, ebx
add eax, esi
mov ebx, edi
and ebx, 3
mov ebx, dword [ebx*4 + 0x1016408]
add ebx, edi
add edi, dword [ebp - 0x14]
xor eax, ebx
add edx, eax
mov eax, edx
shr eax, 5
mov ebx, edx
shl ebx, 4
xor eax, ebx
mov ebx, edi
shr ebx, 0xb
and ebx, 3
mov ebx, dword [ebx*4 + 0x1016408]
add eax, edx
add ebx, edi
xor eax, ebx
add esi, eax
dec dword [ebp - 0x18]
jne 0x1053be1
mov eax, dword [ebp + 0x10]
mov dword [ecx], edx
mov dword [ecx + 4], esi
inc ecx
add eax, ecx
cmp eax, dword [ebp + 0x14]
jbe 0x1053bc3
mov ebx, dword [ebp - 0x1c]
mov eax, dword [ebp + 0x14]
push eax
mov dword [ebp - 0x10], eax
lea eax, [ebp - 0x10]
push eax
mov eax, dword [ebp - 0x2c]
lea ecx, [ebp - 0x2c]
call dword [eax + 8]
push eax
mov eax, dword [ebp - 0x20]
push 0
push 1
push 0
push dword [eax + 0xc]
call dword [sym.imp.ADVAPI32.dll_CryptEncrypt]
test eax, eax
mov esi, dword [fcn.0100149c]
mov edi, 0x80070000
jne 0x1053caf
call esi
test eax, eax
jg 0x1053c7f
call esi
jmp 0x1053c88
call esi
and eax, 0xffff
or eax, edi
test eax, eax
jge 0x1053ca6
call esi
test eax, eax
jg 0x1053c98
call esi
mov ebx, eax
jmp 0x1053cab
call esi
mov ebx, eax
and ebx, 0xffff
or ebx, edi
jmp 0x1053cab
mov ebx, 0x80004005
test ebx, ebx
jl 0x1053d06
push dword [ebp + 0x14]
mov eax, dword [ebp - 0x2c]
lea ecx, [ebp - 0x2c]
call dword [eax + 8]
push eax
push 3
push 0
push dword [ebp + 0xc]
push dword [ebp + 8]
call dword [sym.imp.ADVAPI32.dll_RegSetValueExW]
test eax, eax
je 0x1053d06
call esi
test eax, eax
jg 0x1053cda
call esi
jmp 0x1053ce3
call esi
and eax, 0xffff
or eax, edi
test eax, eax
jge 0x1053d01
call esi
test eax, eax
jg 0x1053cf3
call esi
mov ebx, eax
jmp 0x1053d06
call esi
mov ebx, eax
and ebx, 0xffff
or ebx, edi
jmp 0x1053d06
mov ebx, 0x80004005
pop edi
pop esi
lea ecx, [ebp - 0x2c]
call fcn.01047206
mov ecx, dword [ebp - 0xc]
mov eax, ebx
pop ebx
mov dword fs:[0], ecx
leave
ret 0x10
Function at 0x5d617a
Capabilities:
Decompress data using aplib

Disassembly:
push ebp
mov ebp, esp
mov esi, dword [ebp + 8]
mov edi, dword [ebp + 0xc]
cld
mov dl, 0x80
movsb byte es:[edi], byte [esi]
call fcn.005d61f9
jae 0x5d6186
xor ecx, ecx
call fcn.005d61f9
jae 0x5d61b0
xor eax, eax
call fcn.005d61f9
jae 0x5d61c1
mov al, 0x10
call fcn.005d61f9
adc al, al
jae 0x5d61a2
jne 0x5d61ee
stosb byte es:[edi], al
jmp 0x5d6187
call fcn.005d6205
dec ecx
loop 0x5d61cd
mov eax, ebp
call fcn.005d6203
jmp 0x5d61ef
lodsb al, byte [esi]
shr eax, 1
je 0x5d6215
adc ecx, 2
mov ebp, eax
jmp 0x5d61ef
xchg ecx, eax
dec eax
shl eax, 8
lodsb al, byte [esi]
mov ebp, eax
call fcn.005d6203
cmp eax, 0x7d00
jae 0x5d61ed
cmp eax, 0x500
jae 0x5d61ee
cmp eax, 0x7f
ja 0x5d61ef
inc ecx
inc ecx
push esi
mov esi, edi
sub esi, eax
rep movsb byte es:[edi], byte [esi]
pop esi
jmp 0x5d6187
pop ebp
ret 8
Function at 0x4011ae
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x860
push ebx
push esi
lea eax, [ebp - 0x4c]
push edi
mov esi, ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
push 6
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov dword [ebp - 4], eax
xor ebx, ebx
push 0x10
lea eax, [ebp - 0x14]
push ebx
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
mov word [ebp - 0x14], 2
push dword [esi + 4]
call dword [sym.imp.WS2_32.dll_inet_addr]
mov dword [ebp - 0x10], eax
mov ax, word [esi + 8]
push eax
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x12], ax
lea eax, [ebp - 0x14]
push 0x10
push eax
push dword [ebp - 4]
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
je 0x4012ce
mov edi, 0x814
lea eax, [ebp - 0x860]
push edi
push ebx
push eax
call sub.MSVCRT.dll_memset
push 0x26
lea eax, [ebp - 0x3c]
push ebx
push eax
call sub.MSVCRT.dll_memset
push dword [ebp + 8]
lea eax, [ebp - 0x34]
push eax
call sub.MSVCRT.dll_strcpy
lea eax, [ebp - 0x34]
push eax
call sub.MSVCRT.dll_strlen
add esp, 0x24
inc eax
mov dword [ebp - 0x38], eax
add eax, 8
cmp eax, ebx
mov dword [ebp - 0x3c], 0x701
mov dword [ebp + 8], eax
je 0x401286
push ebx
lea eax, [ebp - 0x3c]
push dword [ebp + 8]
push eax
push dword [ebp - 4]
call dword [sym.imp.WS2_32.dll_send]
cmp eax, 0xffffffff
je 0x4012ce
sub dword [ebp + 8], eax
jne 0x40126b
push ebx
lea eax, [ebp - 0x860]
push edi
push eax
push dword [ebp - 4]
call dword [sym.imp.WS2_32.dll_recv]
cmp eax, 0xffffffff
je 0x4012ce
cmp eax, ebx
je 0x4012ce
cmp dword [ebp - 0x860], 0x80000701
jne 0x4012ce
cmp dword [ebp - 0x858], 1
jne 0x4012ce
cmp byte [ebp - 0x84c], bl
je 0x4012ce
lea eax, [ebp - 0x860]
mov ecx, esi
push eax
call fcn.004012d7
jmp 0x4012d0
xor eax, eax
pop edi
pop esi
pop ebx
leave
ret 4
Function at 0x402065
Capabilities:
Check if file exists
Delete file
Get common file path

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x104
push ebx
push esi
mov esi, 0x104
push edi
push esi
lea eax, [ebp - 0x104]
push 0
mov ebx, ecx
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
lea eax, [ebp - 0x104]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
mov esi, eax
push str.gls_
lea eax, [ebp + esi - 0x104]
push eax
call sub.MSVCRT.dll_strcpy
mov edi, dword [ebp + 8]
lea eax, [ebp + esi - 0x100]
push dword [edi]
push eax
call sub.MSVCRT.dll_strcpy
mov esi, dword [sym.imp.SHLWAPI.dll_PathFileExistsA]
add esp, 0x10
lea eax, [ebp - 0x104]
push eax
call esi
test eax, eax
je 0x402124
lea eax, [ebp - 0x104]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
test eax, eax
jne 0x402124
lea eax, [ebp - 0x104]
push eax
call sub.MSVCRT.dll_strlen
and byte [ebp + eax - 0x103], 0
pop ecx
mov cl, byte [ebp + eax - 0x105]
mov byte [ebp + eax - 0x104], cl
dec eax
cmp byte [ebp + eax - 0x104], 0x2e
jne 0x4020fa
mov byte [ebp + eax - 0x104], 0x31
lea eax, [ebp - 0x104]
push eax
jmp 0x4020ce
mov eax, dword [ebx + 0x118]
lea ecx, [ebx + 0x118]
push 0
lea edx, [ebp - 0x104]
push 0x1002
push edx
call dword [eax + 0x28]
test eax, eax
je 0x402156
lea eax, [ebp - 0x104]
mov ecx, edi
push eax
call sub.MFC42.DLL_CString::operator_1
push 1
pop eax
pop edi
pop esi
pop ebx
leave
ret 4

Function at 0x402c76
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Receive data
Receive data on socket
Send data
Send data on socket

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x84c
push ebx
push esi
push edi
push 6
push 1
mov esi, ecx
push 2
call dword [sym.imp.WS2_32.dll_socket]
mov edi, eax
xor ebx, ebx
push 0x10
lea eax, [ebp - 0x10]
push ebx
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
mov word [ebp - 0x10], 2
push dword [esi + 0x140]
call dword [sym.imp.WS2_32.dll_inet_addr]
mov dword [ebp - 0xc], eax
mov ax, word [esi + 0x144]
push eax
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0xe], ax
lea eax, [ebp - 0x10]
push 0x10
push eax
push edi
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
je 0x402d3c
push 0x26
lea eax, [ebp - 0x38]
push ebx
push eax
call sub.MSVCRT.dll_memset
push dword [esi + 0x13c]
lea eax, [ebp - 0x30]
push eax
call sub.MSVCRT.dll_strcpy
lea eax, [ebp - 0x30]
push eax
call sub.MSVCRT.dll_strlen
add esp, 0x18
inc eax
mov dword [ebp - 0x34], eax
add eax, 8
push ebx
push eax
lea eax, [ebp - 0x38]
mov dword [ebp - 0x38], 0x701
push eax
push edi
call dword [sym.imp.WS2_32.dll_send]
cmp eax, 0xffffffff
je 0x402d3c
push ebx
lea eax, [ebp - 0x84c]
push 0x814
push eax
push edi
call dword [sym.imp.WS2_32.dll_recv]
cmp eax, 0xffffffff
jne 0x402d40
xor eax, eax
jmp 0x402d4b
xor eax, eax
cmp dword [ebp - 0x844], ebx
setne al
pop edi
pop esi
pop ebx
leave
ret
Function at 0x402f44
Capabilities:
Create thread

Disassembly:
mov eax, 0x40ca62
call fcn.0040b3d0
sub esp, 0xc
push ebx
push esi
push edi
mov esi, ecx
push 0x158
call sub.MFC42.DLL_operatornew
pop ecx
mov ecx, eax
mov dword [ebp - 0x14], ecx
xor ebx, ebx
cmp ecx, ebx
mov dword [ebp - 4], ebx
je 0x402f76
call fcn.00401000
jmp 0x402f78
xor eax, eax
or dword [ebp - 4], 0xffffffff
mov dword [ebp - 0x10], eax
push 0x20
add eax, 0xc
push ebx
push eax
call sub.MSVCRT.dll_memset
mov eax, dword [ebp + 8]
add esp, 0xc
cmp eax, ebx
jne 0x402f9b
mov eax, dword [esi + 0x13c]
push eax
mov eax, dword [ebp - 0x10]
add eax, 0xc
push eax
call sub.MSVCRT.dll_strcpy
mov eax, dword [ebp - 0x10]
push 0x20
add eax, 0x2c
push ebx
push eax
call sub.MSVCRT.dll_memset
mov eax, dword [ebp + 0xc]
add esp, 0x14
cmp eax, ebx
jne 0x402fc7
mov eax, dword [esi + 0xd4]
push eax
mov eax, dword [ebp - 0x10]
add eax, 0x2c
push eax
call sub.MSVCRT.dll_strcpy
pop ecx
lea eax, [esi + 0x140]
pop ecx
push eax
mov eax, dword [ebp - 0x10]
lea ecx, [eax + 4]
call fcn.0040b29e
mov ecx, dword [ebp - 0x10]
mov eax, dword [esi + 0x144]
lea edi, [esi + 0x124]
push edi
mov dword [ecx + 8], eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
lea eax, [ebp - 0x10]
lea ecx, [esi + 0xc4]
push eax
call fcn.0040232c
push edi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
lea eax, [ebp - 0x18]
push eax
push ebx
push dword [ebp - 0x10]
push 0x4032a8
push ebx
push ebx
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov ecx, dword [ebp - 0x10]
mov dword [ecx + 0x154], eax
mov eax, dword [ebp - 0x10]
cmp dword [eax + 0x154], ebx
jne 0x403048
push eax
mov ecx, esi
call fcn.00403059
mov ecx, dword [ebp - 0xc]
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
leave
ret 8
Function at 0x403870
Capabilities:
Access peb ldr_data
Get ntdll base address

Disassembly:
mov eax, 0x40caa7
call fcn.0040b3d0
push ecx
push ecx
mov al, byte [ebp - 0xd]
push ebx
push esi
push edi
mov esi, ecx
xor edi, edi
mov dword [ebp - 0x14], esi
mov byte [esi + 0x20], al
mov dword [esi + 0x24], edi
mov dword [esi + 0x28], edi
mov dword [esi + 0x2c], edi
lea ecx, [esi + 0x151c]
mov dword [ebp - 4], edi
call sub.MFC42.DLL_CString::CString_2
lea ecx, [esi + 0x1520]
mov byte [ebp - 4], 1
call sub.MFC42.DLL_CString::CString_2
or dword [esi + 0x34], 0xffffffff
push 0x400
lea eax, [esi + 0x11c]
push edi
push eax
mov byte [ebp - 4], 2
mov dword [esi], 0x40e4c0
mov dword [esi + 4], edi
mov dword [esi + 8], edi
mov dword [esi + 0xc], edi
mov dword [esi + 0x10], edi
mov dword [esi + 0x30], edi
mov dword [esi + 0x38], edi
mov dword [esi + 0x3c], edi
call sub.MSVCRT.dll_memset
add esp, 0xc
mov ebx, 0x4117b8
lea ecx, [esi + 0x151c]
mov dword [esi + 0x4c], edi
push ebx
mov dword [esi + 0x48], edi
mov dword [esi + 0x40], edi
mov dword [esi + 0x44], edi
mov dword [esi + 0x1c], edi
call sub.MFC42.DLL_CString::operator_1
push ebx
lea ecx, [esi + 0x1520]
call sub.MFC42.DLL_CString::operator_1
or dword [esi + 0x14], 0xffffffff
mov ecx, esi
mov word [esi + 0x1524], di
call fcn.004039cc
mov dword [esi + 0x18], edi
call dword [sym.imp.WS2_32.dll_WSACreateEvent]
mov ecx, dword [ebp - 0xc]
mov dword [esi + 0x18], eax
mov eax, esi
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
leave
ret

Function at 0x4039cc
Capabilities:
Initialize winsock library

Disassembly:
sub esp, 0x190
lea eax, [esp]
push eax
push 0x202
call dword [sym.imp.WS2_32.dll_WSAStartup]
neg eax
sbb eax, eax
inc eax
add esp, 0x190
ret
Function at 0x403a06
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Create tcp socket
Resolve dns

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x14
push esi
mov esi, ecx
push edi
cmp dword [esi + 0x14], 0xffffffff
je 0x403a1b
mov eax, dword [esi]
call dword [eax + 0x14]
mov ecx, esi
call fcn.00403b2b
mov eax, dword [ebp + 0xc]
cmp dword [esi + 0x50], 0
mov edi, dword [ebp + 8]
mov dword [ebp - 4], eax
je 0x403a3d
mov eax, dword [esi + 0x94]
lea edi, [esi + 0x54]
mov dword [ebp - 4], eax
push 6
push 1
push 2
call dword [sym.imp.WS2_32.dll_socket]
cmp eax, 0xffffffff
mov dword [esi + 0x14], eax
je 0x403b1e
push 0x23
push dword [esi + 0x18]
push eax
call dword [sym.imp.WS2_32.dll_WSAEventSelect]
push 0x10
lea eax, [ebp - 0x14]
push 0
push eax
call sub.MSVCRT.dll_memset
add esp, 0xc
mov word [ebp - 0x14], 2
push edi
call dword [sym.imp.WS2_32.dll_inet_addr]
cmp eax, 0xffffffff
mov dword [ebp - 0x10], eax
jne 0x403a9b
push edi
call dword [sym.imp.WS2_32.dll_gethostbyname]
test eax, eax
je 0x403ad1
mov eax, dword [eax + 0xc]
mov eax, dword [eax]
mov eax, dword [eax]
mov dword [ebp - 0x10], eax
push dword [ebp - 4]
call dword [sym.imp.WS2_32.dll_htons]
mov word [ebp - 0x12], ax
lea eax, [ebp - 0x14]
push 0x10
push eax
push dword [esi + 0x14]
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x403aec
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
cmp eax, 0x2733
je 0x403ad8
cmp dword [esi + 0x50], 0
je 0x403b1e
jmp 0x403b13
push 0x2726
jmp 0x403b18
mov ecx, esi
call fcn.00404397
test eax, eax
jne 0x403aec
mov eax, dword [esi]
mov ecx, esi
call dword [eax + 0x14]
jmp 0x403b1e
cmp dword [esi + 0x50], 0
je 0x403b22
push dword [ebp + 0xc]
cmp dword [esi + 0x98], 4
mov ecx, esi
push dword [ebp + 8]
jne 0x403b0a
call fcn.00403c58
jmp 0x403b0f
call fcn.00403d47
test eax, eax
jne 0x403b22
push 0x27d9
call dword [sym.imp.WS2_32.dll_WSASetLastError]
xor eax, eax
jmp 0x403b25
push 1
pop eax
pop edi
pop esi
leave
ret 8