joyce8/EMBER2024-capa huggingface dataset:
Function at 0x407470
Capabilities:
Print debug messages

Disassembly:
push 0xffffffffffffffff
push 0x433c37
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x2c
push ebp
push esi
push edi
mov dword [esp + 0x14], 0
mov ebp, 1
push 0x448b58
lea ecx, [esp + 0x10]
mov dword [esp + 0x44], ebp
call fcn.0042862e
lea ecx, [esp + 0x18]
mov byte [esp + 0x40], 2
call fcn.0042bb01
mov eax, dword [esp + 0x4c]
push 0
push 0
push eax
lea ecx, [esp + 0x24]
mov byte [esp + 0x4c], 3
call fcn.0042bc13
test eax, eax
jne 0x4074f7
push str.CalculateFileMd5___open_file_err
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov esi, dword [esp + 0x48]
lea ecx, [esp + 0xc]
push ecx
mov ecx, esi
call fcn.00428335
mov dword [esp + 0x14], ebp
jmp 0x4075cc
lea ecx, [esp + 0x18]
call fcn.0042bf0d
mov edi, eax
push edi
call fcn.004136f7
mov esi, eax
add esp, 4
test esi, esi
jne 0x40752a
lea ecx, [esp + 0x18]
call fcn.0042be2e
push str.CalculateFileMd5___malloc_err
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
jmp 0x4075b8
push edi
push esi
lea ecx, [esp + 0x20]
call fcn.0042bd30
lea ecx, [esp + 0x18]
call fcn.0042be2e
lea eax, [esp + 0x28]
push eax
push edi
push esi
call fcn.004070c0
push esi
call fcn.0041360e
add esp, 0x10
xor esi, esi
mov ecx, dword [0x444930]
mov dword [esp + 0x10], ecx
mov al, byte [esp + esi + 0x28]
mov byte [esp + 0x40], 4
cmp al, 0x10
jae 0x40757e
and eax, 0xff
lea edx, [esp + 0x10]
push eax
push 0x443fb4
push edx
jmp 0x40758e
and eax, 0xff
push eax
lea eax, [esp + 0x14]
push 0x443fb0
push eax
call fcn.0042582b
add esp, 0xc
lea ecx, [esp + 0x10]
push ecx
lea ecx, [esp + 0x10]
call fcn.004289c3
lea ecx, [esp + 0x10]
mov byte [esp + 0x40], 3
call fcn.004285c0
inc esi
cmp esi, 0x10
jl 0x407555
mov esi, dword [esp + 0x48]
lea edx, [esp + 0xc]
push edx
mov ecx, esi
call fcn.00428335
mov dword [esp + 0x14], ebp
lea ecx, [esp + 0x18]
mov byte [esp + 0x40], 2
call fcn.0042bb56
lea ecx, [esp + 0xc]
mov byte [esp + 0x40], 1
call fcn.004285c0
lea ecx, [esp + 0x4c]
mov byte [esp + 0x40], 0
call fcn.004285c0
mov ecx, dword [esp + 0x38]
mov eax, esi
pop edi
pop esi
pop ebp
mov dword fs:[0], ecx
add esp, 0x38
ret 8
Function at 0x407610
Capabilities:
Create http request
Download and write a file
Read data from internet
Receive and write data from server to client
Receive data
Write file on windows

Disassembly:
push 0xffffffffffffffff
mov eax, dword fs:[0]
push 0x433c60
push eax
mov eax, 0x2008
mov dword fs:[0], esp
call fcn.00413530
push ebx
push ebp
push esi
push edi
xor ebx, ebx
mov dword [esp + 0x2020], 1
push ebx
push ebx
push ebx
push ebx
push str.FirmwareDownload
call dword [sym.imp.WININET.dll_InternetOpenA]
mov ebp, eax
cmp ebp, ebx
je 0x4076ab
mov eax, dword [esp + 0x2028]
push ebx
push accept
push ebx
push ebx
push eax
push ebp
call dword [sym.imp.WININET.dll_InternetOpenUrlA]
mov esi, eax
cmp esi, ebx
jne 0x40767b
push ebp
call dword [sym.imp.WININET.dll_InternetCloseHandle]
jmp 0x4076ab
mov ecx, dword [esp + 0x202c]
push ebx
push 0x80
push 2
push ebx
push ebx
push 0x40000000
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
jne 0x4076da
push esi
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call esi
push ebp
call esi
lea ecx, [esp + 0x2028]
mov byte [esp + 0x2020], bl
call fcn.004285c0
lea ecx, [esp + 0x202c]
mov dword [esp + 0x2020], 0xffffffff
call fcn.004285c0
or eax, 0xffffffff
jmp 0x40774e
lea edx, [esp + 0x10]
lea eax, [esp + 0x18]
push edx
push 0x2000
push eax
push esi
call dword [sym.imp.WININET.dll_InternetReadFile]
mov eax, dword [esp + 0x10]
cmp eax, ebx
je 0x40770f
lea ecx, [esp + 0x14]
push ebx
push ecx
lea edx, [esp + 0x20]
push eax
push edx
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp eax, ebx
jne 0x4076da
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push esi
mov esi, dword [sym.imp.WININET.dll_InternetCloseHandle]
call esi
push ebp
call esi
lea ecx, [esp + 0x2028]
mov byte [esp + 0x2020], bl
call fcn.004285c0
lea ecx, [esp + 0x202c]
mov dword [esp + 0x2020], 0xffffffff
call fcn.004285c0
xor eax, eax
mov ecx, dword [esp + 0x2018]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x2014
ret 8

Function at 0x4077f0
Capabilities:
Access peb ldr_data

Disassembly:
push 0xffffffffffffffff
push 0x433c78
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 8
push ebx
push esi
push edi
mov esi, ecx
lea eax, [esp + 0xc]
lea edx, [esp + 0x28]
push eax
push 0
push 0
push 0
push ecx
mov dword [esp + 0x30], 0
mov ecx, esp
mov dword [esp + 0x24], esp
push edx
mov dword [esp + 0x24], 0xffffffff
call fcn.00428335
mov ebx, dword [esp + 0x38]
mov ecx, esi
push ebx
call fcn.00407970
mov edi, eax
test edi, edi
jge 0x407872
lea ecx, [esp + 0x28]
mov dword [esp + 0x1c], 0xffffffff
call fcn.004285c0
mov eax, edi
mov ecx, dword [esp + 0x14]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
add esp, 0x14
ret 0xc
mov eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0xc]
push eax
push 0
push ecx
push ebx
mov ecx, esi
call fcn.00407ba0
lea ecx, [esp + 0x28]
mov esi, eax
mov dword [esp + 0x1c], 0xffffffff
call fcn.004285c0
mov ecx, dword [esp + 0x14]
mov eax, esi
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
add esp, 0x14
ret 0xc
Function at 0x4078b0
Capabilities:
Access peb ldr_data

Disassembly:
push 0xffffffffffffffff
push 0x433c98
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 8
push ebx
push esi
push edi
mov esi, ecx
lea eax, [esp + 0xc]
lea edx, [esp + 0x28]
push eax
push 0
push 0
push 0x10
push ecx
mov dword [esp + 0x30], 0
mov ecx, esp
mov dword [esp + 0x24], esp
push edx
mov dword [esp + 0x24], 0xffffffff
call fcn.00428335
mov ebx, dword [esp + 0x38]
mov ecx, esi
push ebx
call fcn.00407970
mov edi, eax
test edi, edi
jge 0x407932
lea ecx, [esp + 0x28]
mov dword [esp + 0x1c], 0xffffffff
call fcn.004285c0
mov eax, edi
mov ecx, dword [esp + 0x14]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
add esp, 0x14
ret 0xc
mov eax, dword [esp + 0x2c]
mov ecx, dword [esp + 0xc]
push eax
push 0x10
push ecx
push ebx
mov ecx, esi
call fcn.00407ba0
lea ecx, [esp + 0x28]
mov esi, eax
mov dword [esp + 0x1c], 0xffffffff
call fcn.004285c0
mov ecx, dword [esp + 0x14]
mov eax, esi
pop edi
pop esi
mov dword fs:[0], ecx
pop ebx
add esp, 0x14
ret 0xc
Function at 0x407970
Capabilities:
Send data
Send data on socket

Disassembly:
push 0xffffffffffffffff
mov eax, dword fs:[0]
push 0x433cd9
push eax
mov eax, 0x2034
mov dword fs:[0], esp
call fcn.00413530
push ebx
push ebp
push esi
push edi
mov ebp, ecx
lea eax, [esp + 0x10]
lea edx, [esp + 0x2058]
push eax
push 0x22b9
push ecx
xor ebx, ebx
mov ecx, esp
mov dword [esp + 0x20], esp
push edx
mov dword [esp + 0x205c], ebx
mov dword [esp + 0x20], 0xffffffff
call fcn.00428335
mov esi, dword [esp + 0x2060]
mov ecx, ebp
push esi
call fcn.00407d50
mov edi, eax
cmp edi, ebx
jge 0x4079f7
lea ecx, [esp + 0x2058]
mov dword [esp + 0x204c], 0xffffffff
call fcn.004285c0
mov eax, edi
jmp 0x407b7c
mov eax, dword [esp + 0x2068]
mov ecx, dword [esp + 0x10]
push ecx
lea edx, [esi + 0x24c]
mov dword [eax], ecx
mov ecx, esp
mov dword [esp + 0x24], esp
push edx
call fcn.00428335
push ecx
add esi, 0x248
mov ecx, esp
mov dword [esp + 0x20], esp
push esi
mov byte [esp + 0x2058], 1
call fcn.00428335
push ecx
lea eax, [esp + 0x2064]
mov ecx, esp
mov dword [esp + 0x28], esp
push eax
mov byte [esp + 0x205c], 2
call fcn.00428335
lea ecx, [esp + 0x20]
mov byte [esp + 0x2058], bl
push ecx
mov ecx, ebp
call fcn.00407ef0
mov esi, dword [esp + 0x14]
mov ecx, 0x404
xor eax, eax
lea edi, [esp + 0x24]
mov edx, dword [esi - 8]
mov byte [esp + 0x204c], 3
rep stosd dword es:[edi], eax
mov eax, dword [esp + 0x205c]
cmp edx, ebx
mov dword [esp + 0x28], eax
mov eax, dword [esp + 0x2060]
mov dword [esp + 0x24], 0x7f7f5a5a
mov word [esp + 0x2c], dx
mov word [esp + 0x2e], ax
mov dword [esp + 0x30], ebx
je 0x407abf
mov ecx, edx
lea edi, [esp + 0x34]
mov ebx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
and ecx, 3
xor ebx, ebx
rep movsb byte es:[edi], byte [esi]
mov esi, dword [esp + 0x2064]
cmp esi, ebx
je 0x407ae4
cmp eax, ebx
je 0x407ae4
mov ecx, eax
lea edi, [esp + edx + 0x34]
mov ebx, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
and ecx, 3
xor ebx, ebx
rep movsb byte es:[edi], byte [esi]
lea esi, [edx + eax]
lea ecx, [esp + 0x34]
push esi
push ecx
mov ecx, ebp
call fcn.00408140
add esi, 0x10
mov dword [esp + 0x30], eax
mov edx, esi
and edx, 0x8000000f
jns 0x407b0a
dec edx
or edx, 0xfffffff0
inc edx
je 0x407b12
add esi, 0x10
and esi, 0xfffffff0
cmp dword [esp + 0x205c], ebx
je 0x407b26
cmp dword [ebp + 0x24], 0xe
jb 0x407b26
mov eax, dword [ebp + 0x18]
jmp 0x407b29
mov eax, dword [ebp + 0x14]
lea ecx, [esp + 0x1034]
push eax
lea edx, [esp + 0x28]
push ecx
push edx
push esi
mov ecx, ebp
call fcn.00408280
mov ecx, dword [esp + 0x10]
push ebx
lea eax, [esp + 0x1038]
push esi
push eax
push ecx
call sub.WSOCK32.dll_send
lea ecx, [esp + 0x14]
mov byte [esp + 0x204c], bl
call fcn.004285c0
lea ecx, [esp + 0x2058]
mov dword [esp + 0x204c], 0xffffffff
call fcn.004285c0
xor eax, eax
mov ecx, dword [esp + 0x2044]
pop edi
pop esi
pop ebp
mov dword fs:[0], ecx
pop ebx
add esp, 0x2040
ret 0x18
Function at 0x407c10
Capabilities:
Print debug messages

Disassembly:
mov eax, dword fs:[0]
push 0xffffffffffffffff
push 0x433d00
push eax
mov dword fs:[0], esp
push ebx
push esi
mov esi, dword [esp + 0x20]
push edi
mov edi, dword [esp + 0x20]
mov eax, dword [esi]
mov ebx, ecx
cmp eax, 0x7f7f5a5a
jne 0x407cd6
cmp dword [esi + 4], edi
jne 0x407cd6
mov eax, dword [0x444930]
mov dword [esp + 0x24], eax
lea ecx, [esi + 0x10]
lea edx, [esp + 0x24]
push ecx
push 0x443448
push edx
mov dword [esp + 0x20], 1
call fcn.0042582b
add esp, 0xc
test edi, edi
je 0x407c9a
cmp edi, 0xf
jle 0x407caf
cmp edi, 0x12
jg 0x407caf
push ecx
lea eax, [esp + 0x28]
mov ecx, esp
mov dword [esp + 0x24], esp
push eax
call fcn.00428335
mov ecx, dword [esp + 0x20]
push edi
call fcn.00405d20
jmp 0x407caf
xor ecx, ecx
mov cx, word [esi + 8]
mov dword [ebx + 0x24], ecx
mov edx, dword [esi + 0x14]
push edx
call sub.WSOCK32.dll_htonl
mov dword [ebx + 0x20], eax
lea ecx, [esp + 0x24]
mov dword [esp + 0x14], 0xffffffff
call fcn.004285c0
xor eax, eax
mov ecx, dword [esp + 0xc]
mov dword fs:[0], ecx
pop edi
pop esi
pop ebx
add esp, 0xc
ret 0x10
push 0
push 0
push str.HandleRpcReplyData:_Wrong_rpc_packet_header
call fcn.0042e103
mov eax, dword [0x444930]
mov dword [esp + 0x20], eax
mov ecx, dword [esi + 4]
mov edx, dword [esi]
push edi
push ecx
push edx
lea eax, [esp + 0x2c]
push str.magic:_x__code:_d__cmd:_d
push eax
mov dword [esp + 0x28], 0
call fcn.0042582b
mov ecx, dword [esp + 0x34]
add esp, 0x14
push ecx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
lea ecx, [esp + 0x20]
mov dword [esp + 0x14], 0xffffffff
call fcn.004285c0
mov ecx, dword [esp + 0xc]
pop edi
pop esi
or eax, 0xffffffff
mov dword fs:[0], ecx
pop ebx
add esp, 0xc
ret 0x10
Function at 0x407d50
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket
Get socket status
Initialize winsock library
Set socket configuration

Disassembly:
push 0xffffffffffffffff
push 0x433d18
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x2b0
push ebp
push esi
mov ebp, ecx
lea eax, [esp + 0x128]
mov dword [esp + 0x2c0], 0
push eax
push 0x202
call sub.WSOCK32.dll_WSAStartup
push 6
push 1
push 2
call sub.WSOCK32.dll_socket
mov esi, eax
test esi, esi
jge 0x407dbc
lea ecx, [esp + 0x2cc]
mov dword [esp + 0x2c0], 0xffffffff
call fcn.004285c0
or eax, 0xffffffff
jmp 0x407eb0
lea ecx, [esp + 8]
mov dword [esp + 8], 1
push ecx
push 0x8004667e
push esi
call sub.WSOCK32.dll_ioctlsocket
mov eax, dword [esp + 0x2d0]
xor edx, edx
mov dword [esp + 0xc], edx
push eax
mov dword [esp + 0x14], edx
mov word [esp + 0x10], 2
mov dword [esp + 0x18], edx
mov dword [esp + 0x1c], edx
call sub.WSOCK32.dll_htons
mov ecx, dword [esp + 0x2cc]
mov word [esp + 0xe], ax
push ecx
call sub.WSOCK32.dll_inet_addr
lea edx, [esp + 0xc]
push 0x10
push edx
push esi
mov dword [esp + 0x1c], eax
call sub.WSOCK32.dll_connect
lea eax, [esp + 0x1c]
lea ecx, [esp + 0x24]
push eax
push 0
push ecx
push 0
push 0
mov dword [esp + 0x30], 3
mov dword [esp + 0x34], 0
mov dword [esp + 0x3c], esi
mov dword [esp + 0x38], 1
call sub.WSOCK32.dll_select
test eax, eax
jg 0x407e76
push esi
mov ecx, ebp
call fcn.00407ed0
lea ecx, [esp + 0x2cc]
mov dword [esp + 0x2c0], 0xffffffff
call fcn.004285c0
or eax, 0xffffffff
jmp 0x407eb0
lea edx, [esp + 8]
mov dword [esp + 8], 0
push edx
push 0x8004667e
push esi
call sub.WSOCK32.dll_ioctlsocket
mov eax, dword [esp + 0x2d4]
lea ecx, [esp + 0x2cc]
mov dword [esp + 0x2c0], 0xffffffff
mov dword [eax], esi
call fcn.004285c0
xor eax, eax
mov ecx, dword [esp + 0x2b8]
pop esi
pop ebp
mov dword fs:[0], ecx
add esp, 0x2bc
ret 0x10

Function at 0x408100
Capabilities:
Hash data with crc32

Disassembly:
push esi
xor edx, edx
mov ecx, 0x448b60
mov eax, edx
mov esi, 8
test al, 1
je 0x40811c
shr eax, 1
xor eax, 0xedb88320
jmp 0x40811e
shr eax, 1
dec esi
jne 0x40810f
mov dword [ecx], eax
add ecx, 4
inc edx
cmp ecx, 0x448f60
jl 0x408108
pop esi
ret

Function at 0x408140
Capabilities:
Encode data using xor

Disassembly:
push esi
mov esi, dword [esp + 0xc]
or eax, 0xffffffff
xor ecx, ecx
test esi, esi
jbe 0x408176
push ebx
push edi
mov edi, dword [esp + 0x10]
xor edx, edx
mov ebx, eax
mov dl, byte [ecx + edi]
and ebx, 0xff
xor edx, ebx
shr eax, 8
mov edx, dword [edx*4 + 0x448b60]
xor eax, edx
inc ecx
cmp ecx, esi
jb 0x408154
pop edi
pop ebx
pop esi
ret 8
Function at 0x408180
Capabilities:
Get socket status
Receive data
Receive data on socket

Disassembly:
sub esp, 0x110
push ebx
mov ebx, dword [esp + 0x11c]
push ebp
push esi
xor esi, esi
or ebp, 0xffffffff
cmp ebx, esi
mov dword [esp + 0xc], ecx
mov dword [esp + 0x10], 3
mov dword [esp + 0x14], esi
jne 0x4081b8
pop esi
pop ebp
or eax, 0xffffffff
pop ebx
add esp, 0x110
ret 0xc
push edi
mov edi, dword [esp + 0x124]
lea eax, [esp + 0x14]
lea ecx, [esp + 0x1c]
push eax
push 0
push 0
push ecx
push 0
mov dword [esp + 0x34], edi
mov dword [esp + 0x30], 1
call sub.WSOCK32.dll_select
test eax, eax
jl 0x40821d
je 0x4081c0
lea edx, [esp + 0x1c]
push edx
push edi
call sub.WSOCK32.dll___WSAFDIsSet
test eax, eax
je 0x408209
push 0
lea eax, [esi + ebx]
push 0x1000
push eax
push edi
call sub.WSOCK32.dll_recv
add esi, eax
cmp esi, 0x10
jl 0x4081c0
xor ecx, ecx
mov cx, word [ebx + 0xa]
add ecx, 0x10
cmp esi, ecx
jl 0x4081c0
xor ebp, ebp
mov ecx, dword [esp + 0x10]
push edi
call fcn.00407ed0
pop edi
mov eax, ebp
pop esi
pop ebp
pop ebx
add esp, 0x110
ret 0xc
Function at 0x409190
Capabilities:
Encode data using xor

Disassembly:
mov ecx, dword [esp + 0xc]
mov eax, dword [esp + 4]
mov edx, dword [esp + 8]
and ecx, 0xff
add eax, 8
push ebx
shl ecx, 4
push esi
mov esi, 4
lea ecx, [ecx + edx + 2]
mov dl, byte [ecx - 2]
mov bl, byte [eax - 8]
xor bl, dl
add ecx, 4
mov byte [eax - 8], bl
mov dl, byte [ecx - 5]
mov bl, byte [eax - 4]
xor bl, dl
mov byte [eax - 4], bl
mov dl, byte [ecx - 4]
mov bl, byte [eax]
xor bl, dl
mov byte [eax], bl
mov dl, byte [ecx - 3]
mov bl, byte [eax + 4]
xor bl, dl
mov byte [eax + 4], bl
inc eax
dec esi
jne 0x4091b3
pop esi
pop ebx
ret

Function at 0x409350
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
sub esp, 8
mov dl, byte [0x448f60]
push ebx
mov ebx, dword [0x448f64]
inc dl
shl dl, 2
push edi
mov edi, dword [esp + 0x18]
test ebx, ebx
mov byte [esp + 0xc], dl
mov byte [esp + 8], 0
jle 0x4093b8
mov ecx, dword [esp + 0x14]
xor eax, eax
mov bl, byte [ecx + eax*4]
mov byte [edi + eax*4], bl
mov bl, byte [ecx + eax*4 + 1]
mov byte [edi + eax*4 + 1], bl
mov bl, byte [ecx + eax*4 + 2]
mov byte [edi + eax*4 + 2], bl
mov bl, byte [ecx + eax*4 + 3]
mov byte [edi + eax*4 + 3], bl
mov al, byte [esp + 8]
mov ebx, dword [0x448f64]
inc al
mov byte [esp + 8], al
mov eax, dword [esp + 8]
and eax, 0xff
cmp eax, ebx
jl 0x40937d
mov al, bl
cmp al, dl
mov byte [esp + 8], al
jae 0x4094d4
mov eax, dword [esp + 0xc]
push ebp
mov ebp, dword [esp + 0xc]
and eax, 0xff
and ebp, 0xff
push esi
sub eax, ebp
lea esi, [edi + ebp*4 - 3]
mov dword [esp + 0x1c], eax
jmp 0x4093ed
mov ebx, dword [0x448f64]
mov al, byte [esi - 1]
mov byte [esp + 0x20], al
mov cl, byte [esi]
mov byte [esp + 0x21], cl
mov dl, byte [esi + 1]
mov byte [esp + 0x22], dl
mov al, byte [esi + 2]
mov byte [esp + 0x23], al
mov eax, ebp
cdq
idiv ebx
test edx, edx
jne 0x40944f
lea ecx, [esp + 0x20]
push ecx
call fcn.00409330
lea edx, [esp + 0x24]
push edx
call fcn.00409300
add esp, 8
lea eax, [esp + 0x20]
push eax
mov eax, ebp
cdq
idiv dword [0x448f64]
push eax
call fcn.00409120
add esp, 4
lea ecx, [esp + 0x24]
push eax
push ecx
call fcn.00408fd0
add esp, 0xc
jmp 0x409466
cmp ebx, 6
jle 0x40946c
cmp edx, 4
jne 0x40946c
lea edx, [esp + 0x20]
push edx
call fcn.00409300
add esp, 4
mov ebx, dword [0x448f64]
mov eax, ebp
mov edx, ebp
sub eax, ebx
add esi, 4
mov cl, byte [edi + eax*4]
mov al, byte [esp + 0x20]
xor cl, al
mov byte [esi - 1], cl
mov ebx, dword [0x448f64]
mov cl, byte [esp + 0x21]
sub edx, ebx
mov al, byte [edi + edx*4 + 1]
xor al, cl
mov ecx, ebp
mov byte [esi], al
mov eax, dword [0x448f64]
mov bl, byte [esp + 0x22]
sub ecx, eax
mov eax, ebp
mov dl, byte [edi + ecx*4 + 2]
xor dl, bl
mov byte [esi + 1], dl
mov ecx, dword [0x448f64]
mov bl, byte [esp + 0x23]
sub eax, ecx
mov cl, byte [edi + eax*4 + 3]
mov eax, dword [esp + 0x1c]
xor cl, bl
inc ebp
mov byte [esi + 2], cl
dec eax
mov dword [esp + 0x1c], eax
jne 0x4093e7
pop esi
pop ebp
pop edi
pop ebx
add esp, 8
ret
Function at 0x409840
Capabilities:
Act as tcp client
Connect socket
Connect tcp socket
Connect udp socket
Create tcp socket
Create udp socket
Get socket status
Initialize winsock library
Set socket configuration

Disassembly:
sub esp, 0x2b0
lea eax, [esp + 0x120]
push esi
push edi
push eax
mov edi, ecx
push 0x202
call sub.WSOCK32.dll_WSAStartup
test eax, eax
je 0x40986c
pop edi
or eax, 0xffffffff
pop esi
add esp, 0x2b0
ret
push 0
push 1
push 2
call sub.WSOCK32.dll_socket
lea ecx, [esp + 8]
mov esi, eax
push ecx
push 0x8004667e
push esi
mov dword [esp + 0x14], 1
call sub.WSOCK32.dll_ioctlsocket
mov eax, dword [edi + 0x14]
push eax
call sub.WSOCK32.dll_inet_addr
mov dx, word [edi + 0x18]
mov dword [esp + 0x18], eax
push edx
mov word [esp + 0x18], 2
call sub.WSOCK32.dll_htons
mov word [esp + 0x16], ax
lea eax, [esp + 0x14]
push 0x10
push eax
push esi
call sub.WSOCK32.dll_connect
lea ecx, [esp + 0xc]
lea edx, [esp + 0x24]
push ecx
push 0
push edx
push 0
push 0
mov dword [esp + 0x20], 0xa
mov dword [esp + 0x24], 0
mov dword [esp + 0x3c], esi
mov dword [esp + 0x38], 1
call sub.WSOCK32.dll_select
test eax, eax
jg 0x40990a
push esi
mov ecx, edi
call fcn.00409930
pop edi
or eax, 0xffffffff
pop esi
add esp, 0x2b0
ret
lea eax, [esp + 8]
mov dword [esp + 8], 0
push eax
push 0x8004667e
push esi
call sub.WSOCK32.dll_ioctlsocket
mov eax, esi
pop edi
pop esi
add esp, 0x2b0
ret
Function at 0x409b50
Capabilities:
Send data
Send data on socket

Disassembly:
push 0xffffffffffffffff
push 0x434178
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x18
push ebx
push ebp
push esi
push edi
mov dword [esp + 0x10], ecx
mov esi, dword [esp + 0x40]
lea edi, [esi + 0x20]
push edi
mov dword [esp + 0x18], edi
call fcn.004136f7
push edi
mov ebx, eax
call fcn.004136f7
add esp, 8
mov ebp, eax
test ebx, ebx
je 0x409c7e
test ebp, ebp
je 0x409c7b
lea eax, [esi + 0x10]
mov edx, eax
mov dword [esp + 0x40], eax
and edx, 0x8000000f
mov ecx, eax
jns 0x409bb6
dec edx
or edx, 0xfffffff0
inc edx
je 0x409bc1
add eax, 0x10
and al, 0xf0
mov dword [esp + 0x40], eax
push eax
push ecx
mov ecx, dword [esp + 0x18]
lea eax, [esp + 0x20]
push 0x7faffaf7
push eax
call fcn.00409b20
mov ecx, edi
xor eax, eax
mov edx, ecx
mov edi, ebx
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
push ebp
and ecx, 3
push ebx
rep stosb byte es:[edi], al
mov ecx, dword [esp + 0x20]
mov eax, ebx
lea edi, [ebx + 0x10]
mov dword [eax], ecx
mov edx, dword [esp + 0x24]
mov dword [eax + 4], edx
mov ecx, dword [esp + 0x28]
mov dword [eax + 8], ecx
mov edx, dword [esp + 0x2c]
mov ecx, esi
mov dword [eax + 0xc], edx
mov esi, dword [esp + 0x44]
mov eax, ecx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov ecx, dword [esp + 0x1c]
mov edi, ebp
mov edx, ecx
mov esi, dword [esp + 0x48]
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
push esi
and ecx, 3
rep stosb byte es:[edi], al
mov ecx, dword [esp + 0x1c]
call fcn.004097d0
mov eax, dword [esp + 0x44]
mov ecx, dword [esp + 0x38]
push eax
push esi
push ebp
push ecx
call sub.WSOCK32.dll_send
push ebx
mov esi, eax
call fcn.0041360e
push ebp
call fcn.0041360e
add esp, 8
lea ecx, [esp + 0x3c]
mov dword [esp + 0x30], 0xffffffff
call fcn.004285c0
mov eax, esi
jmp 0x409c9f
push ebx
jmp 0x409c83
test ebp, ebp
je 0x409c8b
push ebp
call fcn.0041360e
add esp, 4
lea ecx, [esp + 0x3c]
mov dword [esp + 0x30], 0xffffffff
call fcn.004285c0
or eax, 0xffffffff
mov ecx, dword [esp + 0x28]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x24
ret 0x10

Function at 0x409cc0
Capabilities:
Get socket status

Disassembly:
sub esp, 0x10c
mov eax, 1
push esi
mov esi, dword [esp + 0x114]
mov dword [esp + 0xc], eax
mov dword [esp + 4], eax
lea eax, [esp + 4]
push eax
push 0
lea ecx, [esp + 0x14]
push 0
lea edx, [esi + 1]
push ecx
push edx
mov dword [esp + 0x24], esi
mov dword [esp + 0x1c], 0
call sub.WSOCK32.dll_select
test eax, eax
jge 0x409d0e
xor eax, eax
pop esi
add esp, 0x10c
ret 4
lea eax, [esp + 0xc]
push eax
push esi
call sub.WSOCK32.dll___WSAFDIsSet
neg eax
sbb eax, eax
pop esi
neg eax
add esp, 0x10c
ret 4
Function at 0x409d30
Capabilities:
Receive data
Receive data on socket

Disassembly:
push ecx
push ebp
mov ebp, dword [ecx + 0x10]
push esi
mov esi, dword [esp + 0x18]
push edi
xor edi, edi
test ebp, ebp
mov dword [esp + 0xc], ecx
jle 0x409d7b
push ebx
mov ebx, dword [esp + 0x18]
jmp 0x409d50
mov ecx, dword [esp + 0x10]
push ebx
call fcn.00409cc0
test eax, eax
je 0x409d75
mov eax, dword [esp + 0x1c]
push 0
push esi
lea ecx, [edi + eax]
push ecx
push ebx
call sub.WSOCK32.dll_recv
sub esi, eax
add edi, eax
test esi, esi
jle 0x409d7a
jmp 0x409d76
dec ebp
test ebp, ebp
jg 0x409d4c
pop ebx
pop edi
pop esi
test ebp, ebp
pop ebp
jne 0x409d89
or eax, 0xffffffff
pop ecx
ret 0xc
mov eax, dword [esp + 0x10]
pop ecx
ret 0xc

Function at 0x40a4cc
Capabilities:
Access peb ldr_data
Print debug messages

Disassembly:
push 0xffffffffffffffff
push 0x4342f7
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
push ecx
mov eax, dword [0x444930]
push ebx
push esi
mov esi, ecx
push edi
mov dword [esp + 0xc], esi
mov dword [esi + 4], eax
mov ecx, dword [0x444930]
mov dword [esp + 0x18], 0
mov dword [esi + 8], ecx
mov edx, dword [0x444930]
mov dword [esi + 0xc], edx
mov eax, dword [0x444930]
lea edi, [esi + 0x10]
mov dword [edi], eax
mov ecx, dword [0x444930]
lea ebx, [esi + 0x14]
mov dword [ebx], ecx
mov edx, dword [0x444930]
mov dword [esi + 0x18], edx
mov eax, dword [0x444930]
mov dword [esi + 0x1c], eax
mov ecx, dword [0x444930]
mov dword [esi + 0x20], ecx
mov edx, dword [0x444930]
mov dword [esi + 0x2c], edx
mov eax, dword [0x444930]
mov dword [esi + 0x30], eax
mov ecx, dword [0x444930]
mov dword [esi + 0x34], ecx
mov edx, dword [0x444930]
mov dword [esi + 0x38], edx
mov eax, dword [0x444930]
mov dword [esi + 0x3c], eax
mov ecx, dword [0x444930]
mov dword [esi + 0x40], ecx
mov edx, dword [0x444930]
mov dword [esi + 0x48], edx
mov eax, dword [0x444930]
mov dword [esi + 0x4c], eax
mov ecx, dword [0x444930]
mov dword [esi + 0x50], ecx
mov edx, dword [0x444930]
mov dword [esi + 0x54], edx
mov eax, dword [0x444930]
mov dword [esi + 0x58], eax
mov ecx, dword [0x444930]
mov dword [esi + 0x5c], ecx
lea ecx, [esi + 0x68]
mov byte [esp + 0x18], 0x13
call fcn.00407430
push str.factorytools_updater_update.ini
push str.http:__120.197.155.172:8880_
push str._s_s
push edi
mov byte [esp + 0x28], 0x14
mov dword [esi], 0x436e00
mov dword [esi + 0x64], 5
call fcn.0042582b
push str.factorytools_unzip.exe
push str.http:__120.197.155.172:8880_
push str._s_s
push ebx
call fcn.0042582b
mov edx, dword [edi]
mov edi, dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
add esp, 0x20
push edx
call edi
mov eax, dword [ebx]
push eax
call edi
mov ecx, dword [esp + 0x10]
mov eax, esi
pop edi
pop esi
pop ebx
mov dword fs:[0], ecx
add esp, 0x10
ret