joyce8/EMBER2024-capa huggingface dataset:
Function at 0x401170
Capabilities:
Encode data using xor
Generate random numbers using a mersenne twister

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
mov eax, 0x1394
call fcn.00403260
mov eax, dword [section..data]
xor eax, esp
mov dword [esp + 0x1390], eax
push ebx
push esi
push edi
mov esi, edx
call dword [sym.imp.MSVCP140.dll_unsigned_int___cdecl_std::_Random_device_void_]
mov dword [esp + 0x1394], 0xffffffff
mov ecx, 1
mov dword [esp + 0x14], eax
nop dword [eax]
mov edx, eax
shr edx, 0x1e
xor edx, eax
imul eax, edx, 0x6c078965
add eax, ecx
mov dword [esp + ecx*4 + 0x14], eax
inc ecx
cmp ecx, 0x270
jb 0x4011b0
xor esi, 0x80000000
mov dword [esp + 0x10], 0x270
lea ecx, [esp + 0x10]
cmp esi, 0x7fffffff
jne 0x4011ef
call fcn.00402240
mov ecx, eax
jmp 0x401223
add esi, 0x80000001
call fcn.00402240
mul esi
mov ebx, eax
mov ecx, edx
cmp ebx, esi
jae 0x401223
mov eax, esi
xor edx, edx
neg eax
div esi
mov edi, edx
cmp ebx, edi
jae 0x401223
lea ecx, [esp + 0x10]
call fcn.00402240
mul esi
mov ecx, edx
cmp eax, edi
jb 0x401212
pop edi
lea eax, [ecx - 0x80000000]
mov ecx, dword [esp + 0x1398]
pop esi
pop ebx
xor ecx, esp
xor eax, 0x80000000
call fcn.004023b6
mov esp, ebp
pop ebp
ret
Function at 0x402240
Capabilities:
Encode data using xor
Generate random numbers using a mersenne twister

Disassembly:
push ebp
mov ebp, esp
push ecx
push esi
mov esi, ecx
push edi
mov dword [ebp - 4], esi
mov eax, dword [esi]
cmp eax, 0x270
jne 0x40229d
lea edx, [esi + 8]
mov edi, eax
nop dword [eax]
mov ecx, dword [edx]
lea edx, [edx + 4]
xor ecx, dword [edx - 8]
and ecx, 0x7fffffff
xor ecx, dword [edx - 8]
mov eax, ecx
and al, 1
movzx eax, al
neg eax
sbb eax, eax
shr ecx, 1
and eax, 0x9908b0df
xor eax, dword [edx + 0x62c]
xor eax, ecx
mov dword [edx + 0x9b8], eax
sub edi, 1
jne 0x402260
mov eax, dword [esi]
jmp 0x40237b
cmp eax, 0x4e0
jb 0x40237b
lea edi, [esi + 0x9c4]
mov esi, 0xe3
push ebx
mov ebx, dword [edi]
lea edx, [edi]
mov eax, ebx
mov ebx, dword [edx + 4]
lea edi, [edx + 4]
mov ecx, ebx
xor ecx, eax
and ecx, 0x7fffffff
xor ecx, eax
mov eax, ecx
and al, 1
movzx eax, al
neg eax
sbb eax, eax
shr ecx, 1
and eax, 0x9908b0df
xor eax, dword [edx + 0x634]
xor eax, ecx
mov dword [edx - 0x9c0], eax
sub esi, 1
jne 0x4022b6
mov edi, dword [ebp - 4]
mov esi, 0x18c
add edi, 0xd50
mov ebx, dword [edi]
mov eax, ebx
lea edx, [edi]
mov ebx, dword [edx + 4]
lea edi, [edx + 4]
mov ecx, eax
xor ecx, ebx
and ecx, 0x7fffffff
xor ecx, eax
mov eax, ecx
and al, 1
movzx eax, al
neg eax
sbb eax, eax
shr ecx, 1
and eax, 0x9908b0df
xor eax, dword [edx - 0xd4c]
xor eax, ecx
mov dword [edx - 0x9c0], eax
sub esi, 1
jne 0x402301
mov esi, dword [ebp - 4]
pop ebx
mov eax, dword [esi + 0x1380]
mov ecx, dword [esi + 4]
xor ecx, eax
and ecx, 0x7fffffff
xor ecx, eax
mov eax, ecx
and al, 1
movzx eax, al
neg eax
sbb eax, eax
shr ecx, 1
and eax, 0x9908b0df
xor eax, dword [esi + 0x634]
xor eax, ecx
mov dword [esi + 0x9c0], eax
xor eax, eax
mov dword [esi], 0
mov edx, dword [esi + eax*4 + 4]
inc eax
mov dword [esi], eax
mov ecx, edx
mov eax, dword [esi + 0x1384]
shr ecx, 0xb
and eax, ecx
xor edx, eax
mov eax, edx
and eax, 0xff3a58ad
shl eax, 7
xor edx, eax
mov eax, edx
and eax, 0xffffdf8c
shl eax, 0xf
xor edx, eax
mov eax, edx
shr eax, 0x12
pop edi
xor eax, edx
pop esi
mov esp, ebp
pop ebp
ret

Function at 0x402c57
Capabilities:
Parse pe header

Disassembly:
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
test eax, eax
je 0x402c96
mov ecx, 0x5a4d
cmp word [eax], cx
jne 0x402c96
mov ecx, dword [eax + 0x3c]
add ecx, eax
cmp dword [ecx], 0x4550
jne 0x402c96
mov eax, 0x10b
cmp word [ecx + 0x18], ax
jne 0x402c96
cmp dword [ecx + 0x74], 0xe
jbe 0x402c96
cmp dword [ecx + 0xe8], 0
setne al
ret
xor al, al
ret
Function at 0x401230
Capabilities:
Delete file

Disassembly:
push ebp
mov ebp, esp
sub esp, 8
mov dword [ebp - 4], esp
mov ebx, dword [ebp + 8]
push dword [ebx]
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
nop
nop
nop
nop
cmp dword [ebp - 4], esp
je 0x40125d
push 6
call fcn.00415cf4
add esp, 4
jmp 0x401262
mov esp, ebp
pop ebp
ret 4
Function at 0x406b03
Capabilities:
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
cmp dword [ebp + 0xc], 0
jne 0x406b1e
call fcn.00406b8e
mov dword [ebp + 8], eax
mov dword [ebp - 4], esp
push dword [ebp + 8]
push 0
push 1
call dword [sym.imp.KERNEL32.dll_OpenProcess]
nop
nop
nop
nop
cmp dword [ebp - 4], esp
je 0x406b4a
push 6
call fcn.00415cf4
add esp, 4
mov dword [ebp - 8], eax
mov dword [ebp - 0xc], esp
push 0
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
nop
nop
nop
nop
cmp dword [ebp - 0xc], esp
je 0x406b74
push 6
call fcn.00415cf4
add esp, 4
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 1
mov eax, 0
sete al
jmp 0x406b88
mov esp, ebp
pop ebp
ret 8

Function at 0x40a9ae
Capabilities:
Log keystrokes via polling

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
mov dword [ebp - 4], 0
mov dword [ebp - 4], 0
mov dword [ebp - 8], esp
push 0x11
call dword [sym.imp.USER32.dll_GetAsyncKeyState]
nop
nop
nop
nop
cmp dword [ebp - 8], esp
je 0x40a9e9
push 6
call fcn.00415cf4
add esp, 4
mov dword [ebp - 0xc], eax
push 0x80000301
push 0
push 0x8000
push 0x80000301
push 0
push dword [ebp - 0xc]
push 2
mov ebx, 0xc4
call fcn.004192d0
add esp, 0x1c
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
je 0x40aa4c
push 0x80000301
push 0
push 1
push 0x80000301
push 0
push dword [ebp - 4]
push 2
mov ebx, 0xc8
call fcn.004192f0
add esp, 0x1c
mov dword [ebp - 4], eax
mov dword [ebp - 8], esp
push 0x10
call dword [sym.imp.USER32.dll_GetAsyncKeyState]
nop
nop
nop
nop
cmp dword [ebp - 8], esp
je 0x40aa70
push 6
call fcn.00415cf4
add esp, 4
mov dword [ebp - 0xc], eax
push 0x80000301
push 0
push 0x8000
push 0x80000301
push 0
push dword [ebp - 0xc]
push 2
mov ebx, 0xc4
call fcn.004192d0
add esp, 0x1c
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
je 0x40aad3
push 0x80000301
push 0
push 2
push 0x80000301
push 0
push dword [ebp - 4]
push 2
mov ebx, 0xc8
call fcn.004192f0
add esp, 0x1c
mov dword [ebp - 4], eax
mov dword [ebp - 8], esp
push 0x12
call dword [sym.imp.USER32.dll_GetAsyncKeyState]
nop
nop
nop
nop
cmp dword [ebp - 8], esp
je 0x40aaf7
push 6
call fcn.00415cf4
add esp, 4
mov dword [ebp - 0xc], eax
push 0x80000301
push 0
push 0x8000
push 0x80000301
push 0
push dword [ebp - 0xc]
push 2
mov ebx, 0xc4
call fcn.004192d0
add esp, 0x1c
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
je 0x40ab5a
push 0x80000301
push 0
push 4
push 0x80000301
push 0
push dword [ebp - 4]
push 2
mov ebx, 0xc8
call fcn.004192f0
add esp, 0x1c
mov dword [ebp - 4], eax
mov eax, dword [ebp - 4]
jmp 0x40ab62
mov esp, ebp
pop ebp
ret
Function at 0x40f076
Capabilities:
Get graphical window text

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
mov dword [ebp - 4], 0
mov dword [ebp - 8], 0
mov ebx, dword [ebp + 8]
mov ebx, dword [ebx]
add ebx, 4
mov dword [ebp - 0xc], ebx
mov dword [ebp - 0x10], esp
mov ebx, dword [ebp - 0xc]
push dword [ebx]
call dword [sym.imp.USER32.dll_GetWindowTextLengthA]
nop
nop
nop
nop
cmp dword [ebp - 0x10], esp
je 0x40f0bc
push 6
call fcn.00415cf4
add esp, 4
mov dword [ebp - 0x1c], eax
fild dword [ebp - 0x1c]
fstp qword [ebp - 0x1c]
fld qword [ebp - 0x1c]
fadd qword [0x44a509]
fstp qword [ebp - 0x24]
fld qword [ebp - 0x24]
call fcn.004021b7
mov dword [ebp - 4], eax
push 0x80000301
push 0
push dword [ebp - 4]
push 1
mov ebx, 0x184
call fcn.00418cd0
add esp, 0x10
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0xc]
push eax
mov ebx, dword [ebp - 8]
test ebx, ebx
je 0x40f10f
push ebx
call fcn.00415cee
add esp, 4
pop eax
mov dword [ebp - 8], eax
mov ebx, dword [ebp + 8]
mov ebx, dword [ebx]
add ebx, 4
mov dword [ebp - 0xc], ebx
mov dword [ebp - 0x10], esp
push dword [ebp - 4]
push dword [ebp - 8]
mov ebx, dword [ebp - 0xc]
push dword [ebx]
call dword [sym.imp.USER32.dll_GetWindowTextA]
nop
nop
nop
nop
cmp dword [ebp - 0x10], esp
je 0x40f148
push 6
call fcn.00415cf4
add esp, 4
mov eax, dword [ebp - 8]
test eax, eax
je 0x40f164
push eax
mov ebx, eax
call fcn.004010a9
inc eax
push eax
call fcn.00415ce8
pop ecx
pop esi
mov edi, eax
rep movsb byte es:[edi], byte [esi]
jmp 0x40f169
push eax
mov ebx, dword [ebp - 8]
test ebx, ebx
je 0x40f17a
push ebx
call fcn.00415cee
add esp, 4
pop eax
mov esp, ebp
pop ebp
ret 4

Function at 0x415c9f
Capabilities:
Terminate process

Disassembly:
cld
fninit
call fcn.00415c89
push 0x415c94
mov eax, 3
call fcn.00416020
add esp, 4
call fcn.00401000
call fcn.00407034
call fcn.00401170
push eax
call fcn.00415cdc
call fcn.00415cd6
add esp, 4

Function at 0x416200
Capabilities:
Create directory

Disassembly:
sub esp, 0xc
mov ecx, dword [esp + 0x14]
xor eax, eax
mov dword [esp + 4], eax
mov dword [esp + 8], eax
lea eax, [esp]
mov dword [esp], 0xc
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
add esp, 0xc
ret
Function at 0x416230
Capabilities:
Accept command line arguments

Disassembly:
sub esp, 0x14
push ebx
push esi
push edi
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
mov edi, eax
mov al, 0x20
mov cl, byte [edi]
inc edi
cmp cl, 0x22
jne 0x41624a
mov al, cl
mov dl, byte [edi]
inc edi
cmp dl, al
je 0x416258
mov cl, byte [edi]
inc edi
cmp cl, al
jne 0x416251
cmp al, 0x20
je 0x416262
cmp byte [edi], 0x20
jne 0x416262
inc edi
lea ecx, [esp + 0xc]
call fcn.00419bf0
mov dword [esp + 0xc], 0x4446d0
mov al, byte [edi]
test al, al
je 0x416326
mov esi, dword [esp + 0x28]
cmp al, 0x22
jne 0x4162ce
mov al, byte [edi + 1]
inc edi
test al, al
mov esi, edi
je 0x4162a9
mov al, byte [esi]
cmp al, 0x22
je 0x4162a9
test al, al
jge 0x4162a1
mov al, byte [esi + 1]
test al, al
je 0x4162a9
inc esi
mov al, byte [esi + 1]
inc esi
test al, al
jne 0x41628f
mov edx, esi
sub edx, edi
push edx
push edi
call fcn.0041a0a0
add esp, 8
lea ecx, [esp + 0xc]
push eax
call fcn.00419e80
mov al, byte [esi]
mov edi, esi
test al, al
je 0x41631c
lea edi, [esi + 1]
jmp 0x41631c
cmp al, 0x20
jg 0x4162da
cmp byte [esi], 0
jl 0x4162da
inc edi
jmp 0x41631c
test al, al
mov esi, edi
je 0x416302
mov al, byte [esi]
cmp al, 0x22
je 0x416302
cmp al, 0x20
jg 0x4162ee
test al, al
jge 0x416302
test al, al
jge 0x4162fa
mov al, byte [esi + 1]
test al, al
je 0x416302
inc esi
mov al, byte [esi + 1]
inc esi
test al, al
jne 0x4162e0
mov eax, esi
sub eax, edi
push eax
push edi
call fcn.0041a0a0
add esp, 8
lea ecx, [esp + 0xc]
push eax
call fcn.00419e80
mov edi, esi
mov al, byte [edi]
test al, al
jne 0x416281
mov ebx, dword [esp + 0x28]
mov eax, dword [ebx]
test eax, eax
je 0x416339
push eax
call fcn.0041a040
add esp, 4
mov edi, dword [esp + 0x1c]
shr edi, 2
shl edi, 2
lea ecx, [edi + 8]
push ecx
call fcn.00415f40
mov dword [eax], 1
mov edx, dword [esp + 0x20]
shr edx, 2
mov dword [eax + 4], edx
mov esi, dword [esp + 0x20]
mov ecx, dword [esp + 0x18]
add esp, 4
neg esi
sbb esi, esi
and esi, ecx
mov ecx, edi
mov edx, ecx
lea edi, [eax + 8]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [esp + 0xc]
mov dword [ebx], eax
mov dword [esp + 0xc], 0x4446cc
call fcn.00419df0
pop edi
pop esi
pop ebx
add esp, 0x14
ret

Function at 0x4189f0
Capabilities:
Get file size
Read file on windows

Disassembly:
mov eax, dword [esp + 8]
push edi
push 0
push 0x20
push 3
push 0
push 3
push SysReAllocString
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
xor eax, eax
cmp edi, 0xffffffff
je 0x418a59
push ebx
lea ecx, [esp + 0x10]
push esi
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
lea edx, [ebx + 8]
push edx
call fcn.00415f40
add esp, 4
mov esi, eax
lea eax, [esp + 0x14]
push 0
push eax
lea ecx, [esi + 8]
push ebx
push ecx
push edi
mov dword [esi], 1
mov dword [esi + 4], ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, esi
pop esi
pop ebx
pop edi
ret
Function at 0x418a70
Capabilities:
Write file on windows

Disassembly:
sub esp, 8
mov eax, dword [esp + 0x10]
push edi
push 0
push 0x20
push 2
push 0
push 0
push 0x40000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
xor eax, eax
cmp edi, 0xffffffff
je 0x418b02
mov eax, dword [esp + 0x10]
push ebx
mov ebx, 1
push ebp
cmp eax, ebx
push esi
mov dword [esp + 0x10], ebx
jle 0x418af4
mov ebp, dword [sym.imp.KERNEL32.dll_WriteFile]
lea esi, [esp + 0x2c]
mov eax, dword [esi]
lea edx, [esp + 0x14]
push 0
push edx
lea ecx, [eax + 8]
mov eax, dword [eax + 4]
push eax
push ecx
push edi
call ebp
test eax, eax
je 0x418aec
mov eax, dword [esp + 0x1c]
inc ebx
add esi, 0xc
cmp ebx, eax
jl 0x418ab5
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x10]
pop esi
pop ebp
pop ebx
pop edi
add esp, 8
ret
mov dword [esp + 0x10], 0
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [esp + 0x10]
pop esi
pop ebp
pop ebx
pop edi
add esp, 8
ret

Function at 0x418b10
Capabilities:
Create process on windows

Disassembly:
sub esp, 0x54
push esi
lea eax, [esp + 0x14]
push edi
push eax
mov dword [esp + 0x1c], 0x44
call dword [sym.imp.KERNEL32.dll_GetStartupInfoA]
mov eax, dword [esp + 0x84]
xor edi, edi
cmp eax, edi
mov dword [esp + 0x54], edi
mov dword [esp + 0x58], edi
mov dword [esp + 0x44], 1
je case.0x418b51.2
mov ecx, dword [esp + 0x7c]
lea eax, [ecx - 1]
cmp eax, 5
ja case.0x418b51.2
jmp dword [eax*4 + 0x418bdc]
mov word [esp + 0x48], di
jmp 0x418b8a
mov word [esp + 0x48], 2
jmp 0x418b8a
mov word [esp + 0x48], 3
jmp 0x418b8a
mov word [esp + 0x48], 4
jmp 0x418b8a
mov word [esp + 0x48], 7
jmp 0x418b8a
mov word [esp + 0x48], 5
lea edx, [esp + 8]
mov ecx, dword [esp + 0x64]
lea eax, [esp + 0x18]
push edx
push eax
push edi
push edi
push edi
push 1
push edi
push edi
push ecx
push edi
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
mov esi, eax
cmp esi, edi
je 0x418bd4
cmp dword [esp + 0x70], edi
je 0x418bc0
mov edx, dword [esp + 8]
push 0xffffffffffffffff
push edx
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov eax, dword [esp + 8]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push eax
call edi
mov ecx, dword [esp + 0xc]
push ecx
call edi
mov eax, esi
pop edi
pop esi
add esp, 0x54
ret

Function at 0x418d10
Capabilities:
Query environment variable

Disassembly:
push ebp
push esi
push edi
push 0x104
call fcn.00415f40
mov ebp, dword [esp + 0x18]
add esp, 4
mov edi, eax
push 0x104
push edi
push ebp
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
mov esi, eax
cmp esi, 0x104
jbe 0x418d67
push ebx
push edi
call fcn.00415fd0
push esi
mov ebx, esi
call fcn.00415f40
add esp, 8
mov edi, eax
push esi
push edi
push ebp
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
mov esi, eax
cmp esi, ebx
ja 0x418d3e
mov eax, edi
pop ebx
pop edi
pop esi
pop ebp
ret
mov eax, edi
pop edi
pop esi
pop ebp
ret
Function at 0x41e4c0
Capabilities:
Terminate process

Disassembly:
push ecx
push ebx
push ebp
push esi
push 0x800
call fcn.0042db4e
mov esi, dword [esp + 0x18]
add esp, 4
mov edx, eax
xor ebp, ebp
test esi, esi
mov dword [esp + 0xc], edx
jne 0x41e4e8
pop esi
pop ebp
xor eax, eax
pop ebx
pop ecx
ret
push edi
mov edi, esi
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
pop edi
cmp ecx, 0x800
jbe 0x41e503
pop esi
pop ebp
pop ebx
pop ecx
ret
mov al, byte [esi]
inc esi
test al, al
je 0x41e5d9
cmp ebp, 0x400
je 0x41e5c4
cmp al, 0x25
jne 0x41e5a3
mov al, byte [esi]
inc esi
test al, al
je 0x41e5bc
mov cl, byte [esi]
inc esi
test cl, cl
mov byte [esp + 0x14], cl
je 0x41e5bc
movsx eax, al
push eax
call fcn.0042e280
movsx ecx, byte [esp + 0x18]
push ecx
mov bl, al
call fcn.0042e280
movsx edx, bl
push edx
mov byte [esp + 0x20], al
call fcn.0042e3e2
add esp, 0xc
test eax, eax
je 0x41e5d2
movsx eax, byte [esp + 0x14]
push eax
call fcn.0042e3e2
add esp, 4
test eax, eax
je 0x41e5d2
cmp bl, 0x39
jg 0x41e582
add bl, 0xd0
jmp 0x41e585
add bl, 0xa9
mov al, byte [esp + 0x14]
cmp al, 0x39
jg 0x41e591
add al, 0xd0
jmp 0x41e593
add al, 0xa9
mov ecx, dword [esp + 0xc]
shl bl, 4
add bl, al
mov edx, ecx
mov byte [ecx + ebp], bl
jmp 0x41e5b0
cmp al, 0x2b
jne 0x41e5ad
mov byte [edx + ebp], 0x20
jmp 0x41e5b0
mov byte [edx + ebp], al
mov al, byte [esi]
inc ebp
inc esi
test al, al
jne 0x41e50e
cmp ebp, 0x400
jne 0x41e5d9
pop esi
pop ebp
mov byte [edx + 0x3ff], 0
mov eax, edx
pop ebx
pop ecx
ret
push 0
call fcn.0042e464
mov byte [edx + ebp], 0
pop esi
pop ebp
mov eax, edx
pop ebx
pop ecx
ret

Function at 0x422000
Capabilities:
Set socket configuration

Disassembly:
push ecx
mov ecx, dword [esp + 8]
lea eax, [esp]
push eax
push 0x8004667e
push ecx
mov dword [esp + 0xc], 0
call sub.WS2_32.dll_ioctlsocket
xor edx, edx
cmp eax, 0xffffffff
setne dl
mov eax, edx
pop ecx
ret

Function at 0x422030
Capabilities:
Set socket configuration

Disassembly:
push ecx
mov ecx, dword [esp + 8]
lea eax, [esp]
push eax
push 0x8004667e
push ecx
mov dword [esp + 0xc], 1
call sub.WS2_32.dll_ioctlsocket
xor edx, edx
cmp eax, 0xffffffff
setne dl
mov eax, edx
pop ecx
ret

Function at 0x422060
Capabilities:
Create tcp socket
Initialize winsock library

Disassembly:
sub esp, 0x190
lea eax, [esp]
push eax
push 1
call sub.WS2_32.dll_WSAStartup
test eax, eax
je 0x422080
or eax, 0xffffffff
add esp, 0x190
ret
push 6
push 1
push 2
call sub.WS2_32.dll_socket
add esp, 0x190
ret
Function at 0x4220b0
Capabilities:
Connect socket
Get socket status

Disassembly:
sub esp, 0x228
push esi
mov esi, dword [esp + 0x234]
test esi, esi
je 0x42229e
mov ecx, dword [esp + 0x23c]
mov eax, 0x66666667
imul ecx
sar edx, 2
mov eax, edx
push ebx
shr eax, 0x1f
add edx, eax
push edi
test edx, edx
mov edi, 1
mov dword [esp + 0xc], edx
jg 0x4220f1
mov dword [esp + 0xc], edi
xor ecx, ecx
push esi
mov dword [esp + 0x18], ecx
mov word [esp + 0x18], 2
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x20], ecx
mov dword [esp + 0x24], ecx
call sub.WS2_32.dll_inet_addr
mov edx, dword [esp + 0x240]
mov dword [esp + 0x18], eax
push edx
call sub.WS2_32.dll_htons
mov esi, dword [esp + 0x238]
mov word [esp + 0x16], ax
push esi
call fcn.00422030
add esp, 4
call dword [sym.imp.KERNEL32.dll_GetTickCount]
lea eax, [esp + 0x14]
push 0x10
push eax
push esi
call sub.WS2_32.dll_connect
test eax, eax
jge 0x422287
call fcn.00421ca0
push eax
call fcn.004222b0
add esp, 4
cmp eax, 0xffffd8cd
je 0x422184
cmp eax, 0xffffd8cc
je 0x422184
push esi
mov edi, eax
call fcn.00422000
add esp, 4
mov eax, edi
pop edi
pop ebx
pop esi
add esp, 0x228
ret
mov eax, dword [esp + 0xc]
mov dword [esp + 0x10], 0
test eax, eax
jle 0x422239
lea ebx, [esi + 1]
lea ecx, [esp + 0x24]
lea edx, [esp + 0x2c]
push ecx
push 0
lea eax, [esp + 0x138]
push edx
push eax
push ebx
mov dword [esp + 0x44], esi
mov dword [esp + 0x40], edi
mov dword [esp + 0x148], esi
mov dword [esp + 0x144], edi
mov dword [esp + 0x38], 0
mov dword [esp + 0x3c], 0x2710
call sub.WS2_32.dll_select
cmp eax, 0xffffffff
je 0x42226d
lea ecx, [esp + 0x2c]
push ecx
push esi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
jne 0x422287
lea edx, [esp + 0x130]
push edx
push esi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
jne 0x422287
mov ecx, dword [esp + 0x248]
mov eax, dword [esp + 0x24c]
cmp dword [ecx], eax
je 0x422253
call fcn.00421ca0
test eax, eax
jne 0x42226d
mov eax, dword [esp + 0x10]
mov ecx, dword [esp + 0xc]
inc eax
cmp eax, ecx
mov dword [esp + 0x10], eax
jl 0x42219b
push esi
mov edi, 0xfffffff5
call fcn.00422000
add esp, 4
mov eax, edi
pop edi
pop ebx
pop esi
add esp, 0x228
ret
push esi
mov edi, 0xffffffec
call fcn.00422000
add esp, 4
mov eax, edi
pop edi
pop ebx
pop esi
add esp, 0x228
ret
push esi
mov edi, 0xfffffffb
call fcn.00422000
add esp, 4
mov eax, edi
pop edi
pop ebx
pop esi
add esp, 0x228
ret
push esi
xor edi, edi
call fcn.00422000
add esp, 4
mov eax, edi
pop edi
pop ebx
pop esi
add esp, 0x228
ret
xor eax, eax
pop esi
add esp, 0x228
ret
Function at 0x4226c0
Capabilities:
Get socket status
Send data
Send data on socket

Disassembly:
sub esp, 0x10c
mov ecx, dword [esp + 0x114]
push esi
mov esi, dword [esp + 0x114]
mov dword [esp + 0xc], 1
test ecx, ecx
mov dword [esp + 0x10], esi
jne 0x4226f3
push ecx
lea eax, [esp + 0x10]
push ecx
push eax
push ecx
lea ecx, [esi + 1]
push ecx
jmp 0x42274b
cmp ecx, 0xffffffff
jne 0x42270a
mov dword [esp + 4], 0
mov dword [esp + 8], 0
jmp 0x422739
mov eax, 0x10624dd3
imul ecx
sar edx, 6
mov eax, edx
shr eax, 0x1f
add edx, eax
mov eax, ecx
mov dword [esp + 4], edx
mov ecx, 0x3e8
cdq
idiv ecx
lea eax, [edx + edx*4]
lea eax, [eax + eax*4]
lea edx, [eax + eax*4]
shl edx, 3
mov dword [esp + 8], edx
lea eax, [esp + 4]
lea ecx, [esp + 0xc]
push eax
push 0
push ecx
lea edx, [esi + 1]
push 0
push edx
call sub.WS2_32.dll_select
test eax, eax
jge 0x422761
mov eax, 0xfffffffb
pop esi
add esp, 0x10c
ret
jne 0x422770
mov eax, 0xfffffffa
pop esi
add esp, 0x10c
ret
lea eax, [esp + 0xc]
push eax
push esi
call sub.WS2_32.dll___WSAFDIsSet
test eax, eax
je 0x4227c9
mov ecx, dword [esp + 0x11c]
mov edx, dword [esp + 0x120]
push 0
push ecx
push edx
push esi
call sub.WS2_32.dll_send
test eax, eax
jg 0x4227b1
call fcn.00421ca0
push eax
call fcn.004222b0
add esp, 4
pop esi
add esp, 0x10c
ret
mov ecx, dword [0x45dbc8]
test ecx, ecx
je 0x4227ce
mov edx, dword [ecx]
pop esi
add edx, eax
mov dword [ecx], edx
add esp, 0x10c
ret
mov eax, 0xfffffff7
pop esi
add esp, 0x10c
ret

Function at 0x4227e0
Capabilities:
Resolve dns

Disassembly:
mov eax, dword [esp + 4]
push eax
call sub.WS2_32.dll_gethostbyname
test eax, eax
jne 0x4227ef
ret
mov ecx, dword [eax + 0xc]
push esi
push edi
mov edx, dword [ecx]
mov eax, dword [edx]
push eax
call sub.WS2_32.dll_inet_ntoa
mov edi, eax
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
mov eax, dword [esp + 0x10]
not ecx
sub edi, ecx
mov edx, ecx
mov esi, edi
mov edi, eax
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
pop edi
pop esi
ret

Function at 0x422980
Capabilities:
Get local ipv4 addresses
Get socket information

Disassembly:
sub esp, 0x14
mov edx, dword [esp + 0x18]
lea eax, [esp]
lea ecx, [esp + 4]
push eax
push ecx
push edx
mov dword [esp + 0xc], 0x10
call sub.WS2_32.dll_getsockname
test eax, eax
jne 0x4229b6
mov eax, dword [esp + 6]
push eax
call sub.WS2_32.dll_ntohs
and eax, 0xffff
add esp, 0x14
ret
or eax, 0xffffffff
add esp, 0x14
ret

Function at 0x4229c0
Capabilities:
Get hostname
Resolve dns

Disassembly:
sub esp, 0x64
lea eax, [esp]
push esi
push 0x64
push eax
xor esi, esi
call sub.WS2_32.dll_gethostname
lea ecx, [esp + 4]
push ecx
call sub.WS2_32.dll_gethostbyname
test eax, eax
jne 0x4229e5
pop esi
add esp, 0x64
ret
mov edx, dword [eax + 0xc]
mov eax, dword [edx]
test eax, eax
je 0x4229f8
mov eax, dword [eax]
push eax
call sub.WS2_32.dll_inet_ntoa
mov esi, eax
mov eax, esi
pop esi
add esp, 0x64
ret