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

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x4004
call fcn.00415aa0
mov eax, dword [0x427050]
xor eax, ebp
mov dword [ebp - 4], eax
xor eax, eax
push 0x1ffe
push eax
lea ecx, [ebp - 0x4002]
push ecx
mov word [ebp - 0x4004], ax
call fcn.00410740
mov eax, dword [0x41fe84]
mov edx, dword [str._INFO_]
mov ecx, dword [0x41fe88]
push 0x1ff0
mov dword [ebp - 0x2000], eax
mov dword [ebp - 0x2004], edx
mov edx, dword [0x41fe8c]
lea eax, [ebp - 0x1ff4]
push 0
push eax
mov dword [ebp - 0x1ffc], ecx
mov dword [ebp - 0x1ff8], edx
call fcn.00410740
mov edx, dword [ebp + 8]
lea ecx, [ebp + 0xc]
push ecx
push edx
lea eax, [ebp - 0x4004]
push 0x1000
push eax
call fcn.00408ec3
lea eax, [ebp - 0x4004]
add esp, 0x28
mov edx, eax
jmp 0x402a40
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x402a40
push esi
push edi
lea edi, [ebp - 0x2004]
sub eax, edx
add edi, 0xfffffffe
jmp 0x402a60
mov cx, word [edi + 2]
add edi, 2
test cx, cx
jne 0x402a60
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea ecx, [ebp - 0x2004]
push ecx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop esi
call fcn.0040845c
mov esp, ebp
pop ebp
ret

Function at 0x402aa0
Capabilities:
Print debug messages

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x4004
call fcn.00415aa0
mov eax, dword [0x427050]
xor eax, ebp
mov dword [ebp - 4], eax
xor eax, eax
push 0x1ffe
push eax
lea ecx, [ebp - 0x4002]
push ecx
mov word [ebp - 0x4004], ax
call fcn.00410740
mov eax, dword [0x41fe94]
mov ecx, dword [0x41fe98]
mov edx, dword [str._ERROR_]
push 0x1fee
mov dword [ebp - 0x1ffc], ecx
mov dword [ebp - 0x2004], edx
mov edx, dword [0x41fe9c]
mov dword [ebp - 0x2000], eax
mov ax, word [0x41fea0]
lea ecx, [ebp - 0x1ff2]
push 0
push ecx
mov dword [ebp - 0x1ff8], edx
mov word [ebp - 0x1ff4], ax
call fcn.00410740
mov eax, dword [ebp + 8]
lea edx, [ebp + 0xc]
push edx
push eax
lea ecx, [ebp - 0x4004]
push 0x1000
push ecx
call fcn.00408ec3
lea eax, [ebp - 0x4004]
add esp, 0x28
mov edx, eax
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x402b45
push esi
push edi
lea edi, [ebp - 0x2004]
sub eax, edx
add edi, 0xfffffffe
lea ecx, [ecx]
mov cx, word [edi + 2]
add edi, 2
test cx, cx
jne 0x402b60
mov ecx, eax
shr ecx, 2
mov esi, edx
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
lea edx, [ebp - 0x2004]
and ecx, 3
push edx
rep movsb byte es:[edi], byte [esi]
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop esi
call fcn.0040845c
mov esp, ebp
pop ebp
ret
Function at 0x402cd0
Capabilities:
Enumerate processes

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x640
mov eax, dword [0x427050]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
push edi
push 0x104
lea eax, [ebp - 0x414]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea ecx, [ebp - 0x414]
push ecx
lea esi, [ebp - 0x20c]
call fcn.00402c10
add esp, 4
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
push 0
push 2
mov edi, eax
mov dword [ebp - 0x640], 0x22c
call sub.KERNEL32.dll_CreateToolhelp32Snapshot
mov esi, eax
cmp esi, 0xffffffff
je 0x402e0f
lea edx, [ebp - 0x640]
push edx
push esi
call sub.KERNEL32.dll_Process32FirstW
lea ecx, [ebp - 0x61c]
lea eax, [ebp - 0x20c]
lea ecx, [ecx]
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x402d76
test dx, dx
je 0x402d72
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x402d76
add eax, 4
add ecx, 4
test dx, dx
jne 0x402d50
xor eax, eax
jmp 0x402d7b
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x402d9c
cmp dword [ebp - 0x638], edi
je 0x402d9c
pop edi
mov eax, 1
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040845c
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x640]
push eax
push esi
call sub.KERNEL32.dll_Process32NextW
test eax, eax
je 0x402e08
lea ecx, [ecx]
lea ecx, [ebp - 0x61c]
lea eax, [ebp - 0x20c]
lea esp, [esp]
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x402de6
test dx, dx
je 0x402de2
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x402de6
add eax, 4
add ecx, 4
test dx, dx
jne 0x402dc0
xor eax, eax
jmp 0x402deb
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x402df7
cmp dword [ebp - 0x638], edi
jne 0x402d87
lea ecx, [ebp - 0x640]
push ecx
push esi
call sub.KERNEL32.dll_Process32NextW
test eax, eax
jne 0x402db0
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
xor eax, eax
pop esi
call fcn.0040845c
mov esp, ebp
pop ebp
ret

Function at 0x403270
Capabilities:
Access firewall settings via inetfwmgr

Disassembly:
push ebx
push edi
push 2
push 0
call dword [sym.imp.ole32.dll_CoInitializeEx]
mov edi, eax
cmp edi, 0x80010106
je 0x40328a
test edi, edi
jl 0x4032cd
push esi
push 0x421274
push 1
push 0
push 0x421264
call dword [sym.imp.ole32.dll_CoCreateInstance]
mov edi, eax
test edi, edi
jl 0x4032cd
mov eax, dword [esi]
mov ecx, dword [eax]
mov edx, dword [ecx + 0x1c]
lea ebx, [esi + 4]
push ebx
push eax
call edx
mov edi, eax
test edi, edi
jl 0x4032cd
mov eax, dword [ebx]
mov ecx, dword [eax]
lea edx, [esi + 8]
push edx
push eax
mov eax, dword [ecx + 0x1c]
call eax
mov edi, eax
test edi, edi
jge 0x40330b
mov eax, dword [esi + 8]
xor ebx, ebx
cmp eax, ebx
je 0x4032e1
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
mov dword [esi + 8], ebx
mov eax, dword [esi + 4]
cmp eax, ebx
je 0x4032f3
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
mov dword [esi + 4], ebx
mov eax, dword [esi]
cmp eax, ebx
je 0x403303
mov ecx, dword [eax]
mov edx, dword [ecx + 8]
push eax
call edx
mov dword [esi], ebx
call dword [sym.imp.ole32.dll_CoUninitialize]
mov eax, edi
pop edi
pop ebx
ret
Function at 0x4033f0
Capabilities:
Enumerate processes

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x230
mov eax, dword [0x427050]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push str.Checking_KDSInst.exe_instance
call fcn.004029a0
add esp, 4
xor ebx, ebx
push ebx
push 2
xor edi, edi
call sub.KERNEL32.dll_CreateToolhelp32Snapshot
mov esi, eax
cmp esi, 0xffffffff
je 0x4034ae
push 0x228
lea eax, [ebp - 0x22c]
push ebx
push eax
call fcn.00410740
add esp, 0xc
lea ecx, [ebp - 0x230]
push ecx
push esi
mov dword [ebp - 0x230], 0x22c
call sub.KERNEL32.dll_Process32FirstW
test eax, eax
je 0x40348d
lea ebx, [ebx]
push 0x42027c
lea edx, [ebp - 0x20c]
push edx
call dword [sym.imp.KERNEL32.dll_lstrcmpiW]
test eax, eax
jne 0x40347c
inc edi
cmp edi, 1
jg 0x4034c1
lea eax, [ebp - 0x230]
push eax
push esi
call sub.KERNEL32.dll_Process32NextW
test eax, eax
jne 0x403460
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x12
je 0x40349a
xor ebx, ebx
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push str.Done_checking_KDSInst.exe_instance
call fcn.004029a0
add esp, 4
mov ecx, dword [ebp - 4]
pop edi
pop esi
mov eax, ebx
xor ecx, ebp
pop ebx
call fcn.0040845c
mov esp, ebp
pop ebp
ret
push str.KDSInst.exe_instance_already_running
call fcn.004029a0
add esp, 4
mov ebx, 1
jmp 0x40349a
Function at 0x4035e0
Capabilities:
Receive data
Receive data on socket

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x41d108
mov eax, dword fs:[0]
push eax
sub esp, 0x5c
mov eax, dword [0x427050]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov edx, dword [ebp + 8]
mov eax, dword [ebp + 0xc]
push 8
push 4
lea ecx, [ebp - 0x5c]
push ecx
push edx
mov dword [ebp - 0x60], eax
call dword [sym.imp.WS2_32.dll_recv]
xor esi, esi
mov eax, 4
lea ebx, [ebx]
movzx ecx, byte [ebp + eax - 0x5c]
shl esi, 8
add esi, ecx
sub eax, 1
jns 0x403630
lea ebx, [esi + 2]
push ebx
call fcn.00408adb
add esp, 4
push ebx
mov edi, eax
push 0
push edi
mov dword [ebp - 0x58], edi
call fcn.00410740
mov edx, dword [ebp + 8]
add esp, 0xc
push 8
push esi
push edi
push edx
call dword [sym.imp.WS2_32.dll_recv]
lea ebx, [ebp - 0x64]
call fcn.00401730
mov ecx, dword [eax + 8]
xor esi, esi
xor edx, edx
mov dword [ebp - 0x54], eax
mov dword [ebp - 0x50], edx
cmp ecx, esi
je 0x40368d
mov ecx, dword [ecx]
inc edx
cmp ecx, esi
jne 0x403683
mov dword [ebp - 0x50], edx
cmp edx, esi
mov dword [ebp - 0x4c], esi
jle 0x403795
jmp 0x4036a5
mov eax, dword [ebp - 0x54]
xor esi, esi
mov dword [ebp - 0x30], 0xf
mov dword [ebp - 0x34], esi
mov byte [ebp - 0x44], 0
mov ecx, dword [ebp - 0x4c]
mov dword [ebp - 4], esi
mov ebx, dword [eax + 8]
cmp ebx, esi
je 0x4036cb
cmp ecx, esi
jle 0x4036cb
mov ebx, dword [ebx]
dec ecx
cmp ebx, esi
jne 0x4036c0
push str.FileName
mov eax, ebx
call fcn.004021e0
mov esi, dword [eax + 0x10]
mov ecx, esi
lea edi, [ecx + 1]
nop
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4036e0
sub ecx, edi
push ecx
push esi
lea ecx, [ebp - 0x48]
call fcn.00405df0
sub esp, 0x1c
mov edi, esp
mov ecx, 7
lea esi, [ebp - 0x48]
push str.fileItem.fileName____s_n
rep movsd dword es:[edi], dword [esi]
call fcn.004029a0
add esp, 0x20
push str.CreationTime
mov eax, ebx
call fcn.004021e0
fld qword [eax + 0x18]
call fcn.00419be6
mov dword [ebp - 0x20], eax
push str.ModificationTime
mov eax, ebx
mov dword [ebp - 0x1c], edx
call fcn.004021e0
fld qword [eax + 0x18]
call fcn.00419be6
mov dword [ebp - 0x28], eax
push str.AccessTime
mov eax, ebx
mov dword [ebp - 0x24], edx
call fcn.004021e0
fld qword [eax + 0x18]
call fcn.00419be6
mov ebx, dword [ebp - 0x60]
mov dword [ebp - 0x18], eax
lea eax, [ebp - 0x48]
push eax
mov dword [ebp - 0x14], edx
call fcn.004053f0
mov dword [ebp - 4], 0xffffffff
cmp dword [ebp - 0x30], 0x10
jb 0x403782
mov ecx, dword [ebp - 0x44]
push ecx
call fcn.0040957d
add esp, 4
mov eax, dword [ebp - 0x4c]
inc eax
cmp eax, dword [ebp - 0x50]
mov dword [ebp - 0x4c], eax
jl 0x4036a0
mov edi, dword [ebp - 0x58]
push edi
call fcn.004089fe
add esp, 4
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0040845c
mov esp, ebp
pop ebp
ret
Function at 0x4037c0
Capabilities:
Download and write a file
Receive and write data from server to client
Receive data
Receive data on socket
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1028
call fcn.00415aa0
mov eax, dword [0x427050]
xor eax, ebp
mov dword [ebp - 8], eax
push ebx
push esi
push edi
push 0
push 0x80
push 2
push 0
push 1
mov esi, edx
push 0x40000000
mov ebx, ecx
push esi
mov dword [ebp - 0x1010], ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
jne 0x40382a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push esi
push str.DownloadFileFromPipe_CreateFile_failed_for_appended_file__s___d_
call fcn.00402aa0
add esp, 0xc
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 8]
xor ecx, ebp
call fcn.0040845c
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp + 8]
push 0
push 0x1000
lea eax, [ebp - 0x100c]
push eax
push ecx
call dword [sym.imp.WS2_32.dll_recv]
mov esi, eax
test esi, esi
jbe 0x4038ad
push 2
push 0
push 0
push edi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
push esi
push 0
mov ebx, eax
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_LockFile]
push 0
lea edx, [ebp - 0x1028]
push edx
push esi
lea eax, [ebp - 0x100c]
push eax
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push 0
push esi
push 0
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_UnlockFile]
mov edx, dword [ebp + 8]
push 0
push 0x1000
lea ecx, [ebp - 0x100c]
push ecx
push edx
call dword [sym.imp.WS2_32.dll_recv]
mov esi, eax
test esi, esi
ja 0x403848
mov ebx, dword [ebp - 0x1010]
push str.DownloadFileFromPipe_Failed
call fcn.004029a0
mov eax, dword [ebx + 0x28]
mov ecx, dword [ebx + 0x2c]
mov edx, dword [ebx + 0x20]
mov ebx, dword [ebx + 0x24]
add esp, 4
mov dword [ebp - 0x1024], eax
mov dword [ebp - 0x101c], eax
lea eax, [ebp - 0x1014]
push eax
mov dword [ebp - 0x1020], ecx
mov dword [ebp - 0x1018], ecx
lea ecx, [ebp - 0x101c]
mov dword [ebp - 0x1014], edx
push ecx
lea edx, [ebp - 0x1024]
push edx
push edi
mov dword [ebp - 0x1010], ebx
call dword [sym.imp.KERNEL32.dll_SetFileTime]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebp - 8]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040845c
mov esp, ebp
pop ebp
ret
Function at 0x403920
Capabilities:
Connect socket
Initialize winsock library
Resolve dns

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c4
mov eax, dword [0x427050]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
lea eax, [ebp - 0x2a0]
push eax
xor esi, esi
push 0x202
mov edi, ecx
or ebx, 0xffffffff
mov dword [ebp - 0x2a4], esi
call dword [sym.imp.WS2_32.dll_WSAStartup]
cmp eax, esi
je 0x40397a
push eax
push str.WSAStartup_failed_with_error:__d_n
call fcn.004025a0
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040845c
mov esp, ebp
pop ebp
ret
xor eax, eax
push 0x103
lea ecx, [ebp - 0x10f]
push esi
mov dword [ebp - 0x2c0], eax
mov dword [ebp - 0x2bc], eax
mov dword [ebp - 0x2b8], eax
push ecx
mov dword [ebp - 0x2c4], eax
mov dword [ebp - 0x2b4], eax
mov dword [ebp - 0x2b0], eax
mov dword [ebp - 0x2ac], eax
mov dword [ebp - 0x2a8], eax
mov dword [ebp - 0x2c0], esi
mov dword [ebp - 0x2bc], 1
mov dword [ebp - 0x2b8], 6
mov byte [ebp - 0x110], al
call fcn.00410740
add esp, 0xc
lea esi, [ebp - 0x110]
call fcn.00402ba0
lea edx, [ebp - 0x2a4]
push edx
lea eax, [ebp - 0x2c4]
push eax
push str.9444
mov ecx, esi
push ecx
call dword [sym.imp.WS2_32.dll_getaddrinfo]
test eax, eax
je 0x403a33
push eax
push str.getaddrinfo_failed_with_error:__d_n
call fcn.004025a0
add esp, 8
call dword [sym.imp.WS2_32.dll_WSACleanup]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040845c
mov esp, ebp
pop ebp
ret
mov esi, dword [ebp - 0x2a4]
test esi, esi
je 0x403a7d
mov edi, dword [sym.imp.WS2_32.dll_closesocket]
mov edx, dword [esi + 0xc]
mov eax, dword [esi + 8]
mov ecx, dword [esi + 4]
push edx
push eax
push ecx
call dword [sym.imp.WS2_32.dll_socket]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x403aa1
mov edx, dword [esi + 0x10]
mov eax, dword [esi + 0x18]
push edx
push eax
push ebx
call dword [sym.imp.WS2_32.dll_connect]
cmp eax, 0xffffffff
jne 0x403a7d
push ebx
call edi
mov esi, dword [esi + 0x1c]
or ebx, 0xffffffff
test esi, esi
jne 0x403a43
mov ecx, dword [ebp - 0x2a4]
push ecx
call dword [sym.imp.WS2_32.dll_freeaddrinfo]
cmp ebx, 0xffffffff
jne 0x403ab2
push str.Unable_to_connect_to_server__n
call fcn.004025a0
add esp, 4
jmp 0x403a1a
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push str.socket_failed_with_error:__ld_n
jmp 0x403a12
mov ecx, dword [ebp - 4]
pop edi
pop esi
mov eax, ebx
xor ecx, ebp
pop ebx
call fcn.0040845c
mov esp, ebp
pop ebp
ret
Function at 0x403f10
Capabilities:
Create service
Persist via windows service

Disassembly:
push esi
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov esi, eax
test esi, esi
jne 0x403f3c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x4205e8
call fcn.00402aa0
add esp, 8
pop esi
ret
push 0
push 0
push 0
push 0
push 0
push 0x4283b8
push 1
push 2
push 0x10
push 0xf01ff
push str.KDService
push str.KDService
push esi
call dword [sym.imp.ADVAPI32.dll_CreateServiceW]
test eax, eax
jne 0x403f88
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str._InstallKDService_CreateService_failed___d_
call fcn.00402aa0
add esp, 8
push esi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
pop esi
ret
push edi
mov edi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push eax
call edi
push esi
call edi
pop edi
pop esi
ret

Function at 0x403fa0
Capabilities:
Query service status
Stop service

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x48
push esi
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov esi, eax
mov dword [ebp - 8], esi
test esi, esi
jne 0x403fd8
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.StopKDServiceIfExists_OpenSCManager_failed___d_
call fcn.00402aa0
add esp, 8
pop esi
mov esp, ebp
pop ebp
ret
push 0xf01ff
push str.KDService
push esi
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov dword [ebp - 4], eax
test eax, eax
jne 0x403ffc
push esi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
pop esi
mov esp, ebp
pop ebp
ret
push ebx
push edi
lea ecx, [ebp - 0x48]
push ecx
push 1
push eax
call dword [sym.imp.ADVAPI32.dll_ControlService]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
xor esi, esi
lea esp, [esp]
mov eax, dword [ebp - 4]
lea edx, [ebp - 0x24]
push edx
push eax
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
je 0x404038
cmp dword [ebp - 0x20], 1
je 0x404059
call edi
mov ecx, dword [ebp - 0x20]
push eax
push ecx
push str.Service_State___d___ld
call fcn.00402aa0
add esp, 0xc
push 0x3e8
call ebx
inc esi
cmp esi, 0x3c
jl 0x404020
mov edx, dword [ebp - 4]
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push edx
call esi
mov eax, dword [ebp - 8]
push eax
call esi
pop edi
pop ebx
pop esi
mov esp, ebp
pop ebp
ret
Function at 0x404080
Capabilities:
Start service

Disassembly:
push edi
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov edi, eax
test edi, edi
jne 0x4040ac
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.StartKDServiceIfExists_OpenSCManager_failed___d_
call fcn.00402aa0
add esp, 8
pop edi
ret
push esi
push 0xf01ff
push str.KDService
push edi
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov esi, eax
test esi, esi
jne 0x4040e2
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.StartKDServiceIfExists_OpenService_failed___d_
call fcn.00402aa0
add esp, 8
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
pop esi
pop edi
ret
push 0
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
jne 0x404105
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.StartKDServiceIfExists_StartService_failed___d_
call fcn.00402aa0
add esp, 8
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push edi
call esi
pop esi
pop edi
ret

Function at 0x404120
Capabilities:
Create directory

Disassembly:
push ebx
push esi
push edi
mov edi, dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
push 0
push str.C:Program_FilesKDService
call edi
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
call ebx
test esi, esi
jne 0x404160
cmp eax, 0xb7
je 0x404160
push eax
push str.C:Program_FilesKDService
push str.CreateRequiredFolders_CreateDirectory_failed_for__s___d_
call fcn.00402aa0
add esp, 0xc
pop edi
pop esi
xor eax, eax
pop ebx
ret
push 0
push str.C:Program_FilesKDService_bin
call edi
mov esi, eax
call ebx
test esi, esi
jne 0x404191
cmp eax, 0xb7
je 0x404191
push eax
push str.C:Program_FilesKDService_bin
push str.CreateRequiredFolders_CreateDirectory_failed_for__s___d_
call fcn.00402aa0
add esp, 0xc
pop edi
pop esi
xor eax, eax
pop ebx
ret
pop edi
pop esi
mov eax, 1
pop ebx
ret
Function at 0x4041a0
Capabilities:
Query or enumerate registry key

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x41d0cb
mov eax, dword fs:[0]
push eax
sub esp, 0x45c
mov eax, dword [0x427050]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
push 0x206
xor edi, edi
lea ecx, [ebp - 0x416]
xor eax, eax
push edi
push ecx
mov dword [ebp - 0x424], esi
mov ebx, edx
mov word [ebp - 0x418], ax
call fcn.00410740
add esp, 0xc
lea edx, [ebp - 0x438]
push edx
lea eax, [ebp - 0x468]
push eax
lea ecx, [ebp - 0x460]
push ecx
lea edx, [ebp - 0x430]
push edx
lea eax, [ebp - 0x43c]
push eax
lea ecx, [ebp - 0x464]
push ecx
lea edx, [ebp - 0x45c]
push edx
lea eax, [ebp - 0x41c]
push eax
push edi
lea ecx, [ebp - 0x428]
push ecx
lea edx, [ebp - 0x418]
push edx
push esi
mov dword [ebp - 0x428], 0x104
mov dword [ebp - 0x41c], edi
call dword [sym.imp.ADVAPI32.dll_RegQueryInfoKeyW]
cmp dword [ebp - 0x41c], edi
je 0x40434a
push str.GetSubKeys_Number_of_subkeys:__d
call fcn.004029a0
xor eax, eax
add esp, 4
mov dword [ebp - 0x420], eax
cmp dword [ebp - 0x41c], edi
jbe 0x40434a
jmp 0x404296
mov esi, dword [ebp - 0x424]
lea ecx, [ebp - 0x438]
push ecx
push edi
push edi
push edi
lea edx, [ebp - 0x42c]
push edx
lea ecx, [ebp - 0x210]
push ecx
push eax
push esi
mov dword [ebp - 0x42c], 0xff
call dword [sym.imp.ADVAPI32.dll_RegEnumKeyExW]
cmp eax, edi
jne 0x404331
xor edx, edx
lea eax, [ebp - 0x210]
mov word [ebp - 0x454], dx
mov dword [ebp - 0x440], 7
mov dword [ebp - 0x444], edi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, di
jne 0x4042e6
sub eax, edx
sar eax, 1
push eax
lea eax, [ebp - 0x210]
lea esi, [ebp - 0x458]
call fcn.00405f90
mov eax, esi
push eax
mov dword [ebp - 4], edi
call fcn.004054e0
mov dword [ebp - 4], 0xffffffff
cmp dword [ebp - 0x440], 8
jb 0x404331
mov ecx, dword [ebp - 0x454]
push ecx
call fcn.0040957d
add esp, 4
mov eax, dword [ebp - 0x420]
inc eax
mov dword [ebp - 0x420], eax
cmp eax, dword [ebp - 0x41c]
jb 0x404290
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.0040845c
mov esp, ebp
pop ebp
ret
Function at 0x404e10
Capabilities:
Accept command line arguments

Disassembly:
push ebp
mov ebp, esp
push ecx
push esi
lea eax, [ebp - 4]
push eax
call dword [sym.imp.KERNEL32.dll_GetCommandLineW]
push eax
call dword [sym.imp.SHELL32.dll_CommandLineToArgvW]
mov esi, eax
test esi, esi
jne 0x404e45
push str.GetRemoteHostName_Unable_to_parse_command_line
call fcn.00402aa0
add esp, 4
push esi
call dword [sym.imp.KERNEL32.dll_LocalFree]
pop esi
mov esp, ebp
pop ebp
ret
push str.KDSInst.exe_Version:_2.0.07.01
call fcn.004029a0
add esp, 4
cmp dword [ebp - 4], 3
jl 0x404eb1
mov ecx, dword [esi + 4]
mov eax, 0x420c40
mov dx, word [eax]
cmp dx, word [ecx]
jne 0x404e86
test dx, dx
je 0x404e82
mov dx, word [eax + 2]
cmp dx, word [ecx + 2]
jne 0x404e86
add eax, 4
add ecx, 4
test dx, dx
jne 0x404e60
xor eax, eax
jmp 0x404e8b
sbb eax, eax
sbb eax, 0xffffffff
test eax, eax
jne 0x404eb1
mov ecx, dword [esi + 8]
mov edx, edi
movzx eax, word [ecx]
mov word [edx], ax
add ecx, 2
add edx, 2
test ax, ax
jne 0x404e94
push esi
call dword [sym.imp.KERNEL32.dll_LocalFree]
pop esi
mov esp, ebp
pop ebp
ret
push esi
call dword [sym.imp.KERNEL32.dll_LocalFree]
push edi
call fcn.00404370
add esp, 4
pop esi
mov esp, ebp
pop ebp
ret

Function at 0x408190
Capabilities:
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
push esi
push edi
push 0x421284
push str.kernel32
mov edi, 0x20019
mov dword [ebp - 0x14], reloc.OLEAUT32.dll_SysReAllocString
mov dword [ebp - 4], 0
call dword [sym.imp.KERNEL32.dll_GetModuleHandleA]
push eax
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov esi, eax
mov dword [ebp - 8], 0
test esi, esi
je 0x4081e7
lea eax, [ebp - 8]
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call esi
cmp dword [ebp - 8], 0
je 0x4081e7
mov edi, 0x20119
lea ecx, [ebp - 0xc]
push ecx
push edi
push 0
push ebx
push reloc.OLEAUT32.dll_SysReAllocString
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x408247
mov esi, dword [ebp + 8]
lea edx, [ebp - 0x10]
push edx
mov edx, dword [ebp - 0xc]
lea eax, [ebp - 4]
push eax
lea ecx, [ebp - 0x18]
push ecx
push 0
push esi
push edx
mov dword [ebp - 0x10], 4
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
je 0x408234
push esi
push eax
push str.GetRegValueLong___Get_value_error____ld_for__s_n
call fcn.00402410
add esp, 0xc
mov eax, dword [ebp - 0xc]
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov eax, dword [ebp - 4]
pop edi
pop esi
mov esp, ebp
pop ebp
ret
push ebx
push eax
push str.GetRegValueLong___Open_registry_error____ld_for__s_n
call fcn.00402410
mov eax, dword [ebp - 4]
add esp, 0xc
pop edi
pop esi
mov esp, ebp
pop ebp
ret