joyce8/EMBER2024-capa huggingface dataset:
Function at 0x40a5a0
Capabilities:
Get file version info

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
mov eax, dword [0x461008]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov eax, ecx
xor bl, bl
push edi
lea ecx, [ebp - 0xc]
mov dword [ebp - 0x10], eax
push ecx
push eax
mov edi, edx
call dword [sym.imp.VERSION.dll_GetFileVersionInfoSizeW]
mov dword [ebp - 8], eax
test eax, eax
je 0x40a651
push esi
push eax
call fcn.00432432
mov esi, eax
add esp, 4
test esi, esi
je 0x40a63e
push esi
push dword [ebp - 8]
push dword [ebp - 0xc]
push dword [ebp - 0x10]
call dword [sym.imp.VERSION.dll_GetFileVersionInfoW]
test eax, eax
je 0x40a635
lea eax, [ebp - 8]
push eax
lea eax, [ebp - 0x10]
push eax
push 0x44ba3c
push esi
call dword [sym.imp.VERSION.dll_VerQueryValueW]
test eax, eax
je 0x40a635
mov ecx, dword [ebp - 0x10]
cmp dword [ecx], 0xfeef04bd
jne 0x40a635
movzx eax, word [ecx + 0xa]
mov bl, 1
mov dword [edi], eax
movzx eax, word [ecx + 8]
mov dword [edi + 4], eax
movzx eax, word [ecx + 0xe]
mov dword [edi + 8], eax
movzx eax, word [ecx + 0xc]
mov dword [edi + 0xc], eax
push esi
call fcn.004323fa
add esp, 4
pop esi
pop edi
mov al, bl
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0043183b
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
mov al, bl
pop edi
xor ecx, ebp
pop ebx
call fcn.0043183b
mov esp, ebp
pop ebp
ret
Function at 0x40a670
Capabilities:
Check if file exists
Extract resource via kernel32 functions
Get file attributes
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
mov eax, dword [0x461008]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov eax, ecx
mov byte [ebp - 9], 0
mov dword [ebp - 0x18], eax
mov ebx, edx
push 0xa
movzx eax, ax
push eax
push 0
call dword [sym.imp.KERNEL32.dll_FindResourceW]
mov esi, eax
test esi, esi
jne 0x40a6cc
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.FindResource
push 0x4566ac
call fcn.00416f00
add esp, 0xc
xor al, al
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0043183b
mov esp, ebp
pop ebp
ret
push edi
push esi
push 0
call dword [sym.imp.KERNEL32.dll_SizeofResource]
push esi
push 0
mov dword [ebp - 0x10], eax
call dword [sym.imp.KERNEL32.dll_LoadResource]
mov edi, eax
test edi, edi
jne 0x40a715
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x4557ec
push 0x4566ac
call fcn.00416f00
mov al, byte [ebp - 9]
add esp, 0xc
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0043183b
mov esp, ebp
pop ebp
ret
push edi
call dword [sym.imp.KERNEL32.dll_LockResource]
push ebx
mov dword [ebp - 0x14], eax
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
jne 0x40a730
mov eax, 0x80
push 0
push eax
push 2
push 0
push 0
push 0x1f01ff
push ebx
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov esi, eax
cmp esi, 0xffffffff
jne 0x40a775
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.CreateFile
push 0x4566ac
call fcn.00416f00
push ebx
push dword [ebp - 0x18]
push str.___ResourceID__d_____ws
call fcn.00416f00
add esp, 0x18
jmp 0x40a7b8
mov ebx, dword [ebp - 0x10]
lea eax, [ebp - 8]
push 0
push eax
push ebx
push dword [ebp - 0x14]
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x40a7a8
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x455820
push 0x4566ac
call fcn.00416f00
add esp, 0xc
jmp 0x40a7b1
cmp dword [ebp - 8], ebx
jne 0x40a7b1
mov byte [ebp - 9], 1
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push edi
call dword [sym.imp.KERNEL32.dll_FreeResource]
mov ecx, dword [ebp - 4]
mov al, byte [ebp - 9]
xor ecx, ebp
pop edi
pop esi
pop ebx
call fcn.0043183b
mov esp, ebp
pop ebp
ret
Function at 0x40c8f0
Capabilities:
Check os version

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x320
mov eax, dword [0x461008]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
mov esi, ecx
lea ecx, [ebp - 0x320]
call fcn.0040c7f0
test eax, eax
jne 0x40c926
xor eax, eax
pop esi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0043183b
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x31c]
push eax
push dword [ebp - 0x320]
call dword [sym.imp.ADVAPI32.dll_ConvertSidToStringSidW]
test eax, eax
je 0x40c915
push 0x455980
lea eax, [ebp - 0x204]
push 0x100
push eax
call fcn.0043256a
push str._A__GA___
lea eax, [ebp - 0x204]
push 0x100
push eax
call fcn.004325c6
push dword [ebp - 0x31c]
lea eax, [ebp - 0x204]
push 0x100
push eax
call fcn.004325c6
push 0x45599c
lea eax, [ebp - 0x204]
push 0x100
push eax
call fcn.004325c6
add esp, 0x30
push dword [ebp - 0x31c]
call dword [sym.imp.KERNEL32.dll_LocalFree]
push 0x4559a0
lea eax, [ebp - 0x204]
push 0x100
push eax
call fcn.004325c6
push str._A__GWGR___WD_
lea eax, [ebp - 0x204]
push 0x100
push eax
call fcn.004325c6
add esp, 0x18
mov dword [ebp - 0x318], 0x114
lea eax, [ebp - 0x318]
push eax
call dword [sym.imp.KERNEL32.dll_GetVersionExW]
test eax, eax
je 0x40c915
mov eax, dword [ebp - 0x314]
cmp eax, 6
jb 0x40ca40
cmp eax, 1
jb 0x40ca22
push str._A__GWGR___S_1_15_2_1_
lea eax, [ebp - 0x204]
push 0x100
push eax
call fcn.004325c6
mov eax, dword [ebp - 0x314]
add esp, 0xc
cmp eax, 6
jb 0x40ca40
push 0x455954
lea eax, [ebp - 0x204]
push 0x100
push eax
call fcn.004325c6
add esp, 0xc
push 0
push 0x4636c0
push 1
lea eax, [ebp - 0x204]
push eax
call dword [sym.imp.ADVAPI32.dll_ConvertStringSecurityDescriptorToSecurityDescriptorW]
test eax, eax
je 0x40c915
mov ecx, dword [ebp - 4]
mov dword [esi], 0xc
xor ecx, ebp
mov dword [esi + 8], 1
mov eax, dword [0x4636c0]
mov dword [esi + 4], eax
mov eax, 1
pop esi
call fcn.0043183b
mov esp, ebp
pop ebp
ret
Function at 0x40cbb0
Capabilities:
Create thread

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x1c
mov eax, dword [0x461008]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, ecx
push esi
push edi
mov dword [ebp - 0x1c], ebx
lea ecx, [ebx + 8]
call fcn.0040c8f0
push 0xa
push 0
push 0
push 0xffffffffffffffff
call dword [sym.imp.KERNEL32.dll_CreateIoCompletionPort]
mov dword [ebp - 0x10], eax
lea edi, [ebx + 0x1c]
mov dword [ebp - 0xc], 0
jmp 0x40cbf0
push 0x18
call fcn.0043198f
mov esi, eax
add esp, 4
test esi, esi
je 0x40cc43
mov ecx, dword [ebp - 0x10]
xor eax, eax
mov dword [esi], eax
mov dword [esi + 4], eax
mov dword [esi + 8], eax
mov dword [esi + 0xc], eax
mov dword [esi + 0x10], eax
mov dword [esi + 0x14], eax
mov eax, dword [ebx + 0x14]
mov dword [esi + 0xc], eax
lea eax, [esi + 0x14]
push eax
push 0
push esi
push 0x40cef0
push 0
push 0
mov dword [esi], vtable.PipeWorker.0
mov dword [esi + 4], ebx
mov dword [esi + 8], ecx
call dword [sym.imp.KERNEL32.dll_CreateThread]
mov dword [esi + 0x10], eax
jmp 0x40cc45
xor esi, esi
mov ecx, dword [edi + 4]
lea eax, [ebp - 8]
mov dword [ebp - 8], esi
cmp eax, ecx
jae 0x40ccca
mov ebx, dword [edi]
cmp ebx, eax
ja 0x40ccca
mov edx, dword [edi + 8]
sub eax, ebx
sar eax, 2
mov dword [ebp - 0x14], eax
cmp ecx, edx
jne 0x40ccb7
mov eax, edx
sub eax, ecx
sar eax, 2
cmp eax, 1
jae 0x40ccb7
sub ecx, ebx
mov eax, 0x3fffffff
sar ecx, 2
sub eax, ecx
cmp eax, 1
jb 0x40cd80
inc ecx
sub edx, ebx
sar edx, 2
mov eax, 0x3fffffff
mov dword [ebp - 0x18], ecx
mov ecx, edx
shr ecx, 1
sub eax, ecx
cmp eax, edx
jae 0x40cca4
xor edx, edx
jmp 0x40cca6
add edx, ecx
mov eax, dword [ebp - 0x18]
cmp edx, eax
jae 0x40ccaf
mov edx, eax
push edx
mov ecx, edi
call fcn.004023a0
mov edx, dword [edi + 4]
test edx, edx
je 0x40cd26
mov eax, dword [edi]
mov ecx, dword [ebp - 0x14]
mov eax, dword [eax + ecx*4]
mov dword [edx], eax
jmp 0x40cd26
mov edx, dword [edi + 8]
cmp ecx, edx
jne 0x40cd1d
mov eax, edx
sub eax, ecx
sar eax, 2
cmp eax, 1
jae 0x40cd1d
sub ecx, dword [edi]
mov eax, 0x3fffffff
sar ecx, 2
sub eax, ecx
cmp eax, 1
jb 0x40cd80
sub edx, dword [edi]
lea ebx, [ecx + 1]
sar edx, 2
mov eax, 0x3fffffff
mov ecx, edx
shr ecx, 1
sub eax, ecx
cmp eax, edx
jae 0x40cd0d
xor edx, edx
jmp 0x40cd0f
add edx, ecx
cmp edx, ebx
jae 0x40cd15
mov edx, ebx
push edx
mov ecx, edi
call fcn.004023a0
mov eax, dword [edi + 4]
test eax, eax
je 0x40cd26
mov dword [eax], esi
add dword [edi + 4], 4
cmp dword [ebp - 0xc], 0
jne 0x40cd37
mov ecx, esi
call fcn.0040d100
mov ebx, dword [ebp - 0x1c]
lea esi, [ebx + 0x2c]
push esi
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
cmp dword [ebx + 0x48], 0
jne 0x40cd53
push dword [ebx + 0x44]
call dword [sym.imp.KERNEL32.dll_ResetEvent]
inc dword [ebx + 0x48]
push esi
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov eax, dword [ebp - 0xc]
inc eax
mov dword [ebp - 0xc], eax
cmp eax, 0xa
jb 0x40cbf0
mov ecx, dword [ebp - 4]
mov al, 1
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0043183b
mov esp, ebp
pop ebp
ret
push 0x44b9b0
call fcn.00431782
int3
Function at 0x40cf10
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
mov eax, dword [0x461008]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
mov ebx, ecx
push 0
push dword [ebx + 0xc]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test eax, eax
je 0x40d0de
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
push edi
mov edi, edi
push 0x3e8
lea eax, [ebp - 0x10]
push eax
lea eax, [ebp - 8]
push eax
lea eax, [ebp - 0xc]
push eax
push dword [ebx + 8]
call dword [sym.imp.KERNEL32.dll_GetQueuedCompletionStatus]
mov edi, dword [ebp - 0x10]
test edi, edi
je 0x40d09f
add edi, 0xffffeff8
push 0
lea eax, [edi + 0x101c]
push eax
lea ecx, [edi + 0x1008]
push ecx
push dword [edi]
call dword [sym.imp.KERNEL32.dll_GetOverlappedResult]
test eax, eax
jne 0x40cfc4
call esi
cmp eax, 0x6d
jne 0x40cfaf
mov esi, dword [edi]
push esi
call dword [sym.imp.KERNEL32.dll_DisconnectNamedPipe]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebx + 4]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x40cfc4
call esi
push eax
push 0x455a30
push 0x4566ac
call fcn.00416f00
add esp, 0xc
mov eax, dword [edi + 4]
cmp eax, 1
jne 0x40d03c
lea eax, [edi + 0x1008]
mov dword [edi + 4], 2
push eax
lea eax, [edi + 0x101c]
push eax
push 0x1000
lea eax, [edi + 8]
push eax
push dword [edi]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40d030
call esi
cmp eax, 0x3e5
je 0x40d030
push eax
push str.BeginRead___error__d_r_n
call fcn.00416f00
push str.BeginRead_failed._r_n
call fcn.00416f00
mov esi, dword [edi]
add esp, 0xc
push esi
call dword [sym.imp.KERNEL32.dll_DisconnectNamedPipe]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebx + 4]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
mov ecx, ebx
call fcn.0040d100
jmp 0x40d0c3
cmp eax, 3
jne 0x40d04c
mov ecx, dword [ebx + 4]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
jmp 0x40d0c3
cmp eax, 2
jne 0x40d0c3
cmp dword [edi + 0x101c], 0
je 0x40d077
push edi
mov ecx, ebx
call fcn.0040d2d0
test al, al
je 0x40d077
push edi
call fcn.0040d270
test al, al
jne 0x40d0c3
push str.BeginRead_failed._r_n
jmp 0x40d07c
push str.EndRead_failed._r_n
call fcn.00416f00
mov esi, dword [edi]
add esp, 4
push esi
call dword [sym.imp.KERNEL32.dll_DisconnectNamedPipe]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [ebx + 4]
push edi
mov eax, dword [ecx]
call dword [eax + 4]
jmp 0x40d0c3
test eax, eax
jne 0x40d0c3
call esi
cmp eax, 0x102
je 0x40d0c3
cmp eax, 0x2df
je 0x40d0dc
call esi
push eax
push str.ERROR__d__GetQueuedCompletionStatus__n
call fcn.0043275d
add esp, 8
push 0
push dword [ebx + 0xc]
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x40cf40
pop edi
pop esi
mov ecx, dword [ebx + 4]
mov eax, dword [ecx]
call dword [eax + 0x14]
mov ecx, dword [ebp - 4]
xor ecx, ebp
pop ebx
call fcn.0043183b
mov esp, ebp
pop ebp
ret
Function at 0x40d100
Capabilities:
Connect pipe
Create pipe
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 8
mov eax, ecx
push ebx
mov dword [ebp - 4], eax
push esi
mov ecx, dword [eax + 4]
mov esi, ecx
push edi
mov eax, dword [ecx]
call dword [eax + 0x10]
push eax
mov eax, dword [esi]
mov ecx, esi
push 0x3e8
push 0x1000
push 0x1000
push 0xff
push 6
push 0x40000003
call dword [eax + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_CreateNamedPipeW]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x40d222
mov esi, dword [ebp - 4]
push 0
push ebx
push dword [esi + 8]
push ebx
call dword [sym.imp.KERNEL32.dll_CreateIoCompletionPort]
mov ecx, dword [esi + 4]
mov eax, dword [ecx]
call dword [eax]
mov esi, eax
lea eax, [esi + 0x1008]
mov dword [esi], ebx
push eax
push ebx
mov dword [esi + 4], 1
call dword [sym.imp.KERNEL32.dll_ConnectNamedPipe]
test eax, eax
jne 0x40d19f
call edi
cmp eax, 0x3e5
je 0x40d265
cmp eax, 0x217
jne 0x40d23b
lea eax, [esi + 0x1008]
mov dword [esi + 4], 2
push eax
lea eax, [esi + 0x101c]
push eax
push 0x1000
lea eax, [esi + 8]
push eax
push dword [esi]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x40d1e0
call edi
cmp eax, 0x3e5
je 0x40d1e0
push eax
push str.BeginRead___error__d_r_n
call fcn.00416f00
add esp, 8
mov ecx, dword [ebp - 4]
mov esi, dword [ecx + 4]
mov ecx, esi
mov eax, dword [esi]
call dword [eax + 0x10]
push eax
mov eax, dword [esi]
mov ecx, esi
push 0x3e8
push 0x1000
push 0x1000
push 0xff
push 6
push 0x40000003
call dword [eax + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_CreateNamedPipeW]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x40d153
call edi
push eax
push str.CreateNamedPipeW___error__d_r_n
call fcn.00416f00
add esp, 8
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push eax
push str.ConnectNamedPipe___error__d_r_n
call fcn.00416f00
add esp, 8
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 4]
push esi
mov ecx, dword [eax + 4]
mov eax, dword [ecx]
call dword [eax + 4]
pop edi
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret
pop edi
pop esi
mov al, 1
pop ebx
mov esp, ebp
pop ebp
ret

Function at 0x40d270
Capabilities:
Read file on windows

Disassembly:
push ebp
mov ebp, esp
mov ecx, dword [ebp + 8]
lea eax, [ecx + 0x1008]
mov dword [ecx + 4], 2
push eax
lea eax, [ecx + 0x101c]
push eax
push 0x1000
lea eax, [ecx + 8]
push eax
push dword [ecx]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40d2a6
mov al, 1
pop ebp
ret 4
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x3e5
je 0x40d2a0
push eax
push str.BeginRead___error__d_r_n
call fcn.00416f00
add esp, 8
xor al, al
pop ebp
ret 4
Function at 0x40d2d0
Capabilities:
Print debug messages
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x110
mov eax, dword [0x461008]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, ecx
push ebx
mov dword [ebp - 0x110], eax
xor bl, bl
push esi
mov ecx, dword [eax + 4]
mov esi, dword [ebp + 8]
push edi
mov eax, dword [ecx]
call dword [eax]
mov ecx, eax
lea edi, [esi + 8]
mov eax, dword [esi]
xor edx, edx
mov dword [ebp - 0x10c], ecx
mov dword [ecx], eax
lea eax, [ecx + 8]
mov dword [ecx + 4], 3
lea ecx, [ebp - 0xf8]
mov esi, dword [esi + 0x101c]
mov dword [ebp - 0x104], eax
mov dword [ebp - 0xfc], 0x1000
call fcn.00421140
push esi
call fcn.00432432
lea ecx, [ebp - 0xf8]
mov dword [ebp - 0x108], eax
push ecx
lea ecx, [ebp - 0x100]
mov dword [ebp - 0x100], esi
push ecx
push eax
mov edx, esi
mov ecx, edi
call fcn.0041a7e0
add esp, 0x10
test al, al
jne 0x40d376
push str.Decryption_failed_r_n
call fcn.00416f00
jmp 0x40d485
mov eax, dword [ebp - 0x100]
cmp eax, 0x14
jae 0x40d39b
push str.Too_short._r_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
push str.Failed_to_handle_message_r_n
call fcn.00416f00
jmp 0x40d485
lea ecx, [ebp - 0xfc]
push ecx
push dword [ebp - 0x104]
mov ecx, dword [ebp - 0x108]
push eax
call fcn.0040d4d0
test al, al
jne 0x40d3c7
push str.Failed_to_handle_message_r_n
call fcn.00416f00
jmp 0x40d485
mov esi, dword [ebp - 0xfc]
lea ecx, [ebp - 0xf8]
xor edx, edx
call fcn.0041f560
lea eax, [esi + 0x10]
push eax
mov dword [ebp - 0x100], eax
call fcn.00432432
mov ecx, dword [ebp - 0x104]
mov edi, eax
lea eax, [ebp - 0xf8]
mov edx, esi
push eax
lea eax, [ebp - 0x100]
push eax
push edi
call fcn.0041a550
add esp, 0x10
test al, al
jne 0x40d41d
push str.Encryption_failed_r_n
call fcn.00416f00
add esp, 4
jmp 0x40d47b
mov esi, dword [ebp - 0x100]
push esi
push edi
push dword [ebp - 0x104]
call fcn.00433580
mov ecx, dword [ebp - 0x10c]
add esp, 0xc
lea eax, [ecx + 0x1008]
push eax
lea eax, [ecx + 0x101c]
push eax
push esi
lea eax, [ecx + 8]
push eax
push dword [ecx]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x40d479
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
cmp eax, 0x3e5
je 0x40d479
call esi
push eax
push str.WriteFile___error__d_r_n
call fcn.00416f00
add esp, 8
jmp 0x40d47b
mov bl, 1
test edi, edi
je 0x40d488
push edi
call fcn.004323fa
add esp, 4
mov eax, dword [ebp - 0x108]
test eax, eax
je 0x40d49b
push eax
call fcn.004323fa
add esp, 4
test bl, bl
jne 0x40d4b3
mov ecx, dword [ebp - 0x110]
push dword [ebp - 0x10c]
mov ecx, dword [ecx + 4]
mov edx, dword [ecx]
call dword [edx + 4]
mov ecx, dword [ebp - 4]
mov al, bl
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0043183b
mov esp, ebp
pop ebp
ret 4
Function at 0x40d4d0
Capabilities:
Print debug messages

Disassembly:
push ebp
mov ebp, esp
sub esp, 8
mov eax, dword [ebp + 0x10]
push ebx
mov ebx, dword [ebp + 0xc]
push esi
mov esi, ecx
mov dword [ebp - 4], eax
cmp dword [esi], 0x51504d48
je 0x40d500
push str.Invalid_magic._r_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 0xc
mov eax, dword [ebp + 8]
cmp eax, dword [esi + 4]
jae 0x40d51d
push str.Too_enought_received._r_n
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
pop esi
xor al, al
pop ebx
mov esp, ebp
pop ebp
ret 0xc
push edi
lea edi, [esi + 0x10]
push edi
lea eax, [ebp - 8]
push eax
call fcn.0040df70
mov eax, dword [eax]
cmp eax, dword [0x4637a4]
jne 0x40d54f
push dword [edi]
push str.Dont_know_how_to_handle_message_type__d__r_n
call fcn.00416f00
add esp, 8
xor al, al
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0xc
push dword [ebp - 4]
mov eax, dword [eax + 0x14]
push ebx
push esi
call eax
mov bl, al
add esp, 0xc
test bl, bl
jne 0x40d571
push dword [edi]
push str.Message__d_handler_returned_failure__r_n
call fcn.00416f00
add esp, 8
pop edi
pop esi
mov al, bl
pop ebx
mov esp, ebp
pop ebp
ret 0xc
Function at 0x40ef90
Capabilities:
Create service
Modify service
Persist via windows service

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x244
mov eax, dword [0x461008]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push ecx
push str.__s___service
lea eax, [ebp - 0x210]
xor bl, bl
push 0x104
push eax
call fcn.00432bf1
add esp, 0x10
push 0xf003f
push str.ServicesActive
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov edi, eax
test edi, edi
jne 0x40f006
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenSCManager
push 0x4566ac
call fcn.00416f00
add esp, 0xc
mov al, bl
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0043183b
mov esp, ebp
pop ebp
ret
mov ecx, 0x69
call fcn.00416830
push 0
push 0
push 0
push 0
push str.Base
lea ecx, [ebp - 0x210]
push ecx
push 1
push 2
push 0x10
push 0xf01ff
push eax
push str.hmpalertsvc
push edi
call dword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov esi, eax
test esi, esi
jne 0x40f07c
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
cmp eax, 0x431
jne 0x40f05c
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x40f15d
call esi
push eax
push str.CreateService
push 0x4566ac
call fcn.00416f00
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
add esp, 0xc
jmp 0x40f15f
mov ecx, 0x6e
call fcn.00416830
mov dword [ebp - 0x22c], eax
lea eax, [ebp - 0x22c]
push eax
push 1
push esi
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2W]
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x40f0bb
call ebx
push eax
push str.ChangeServiceConfig2
push 0x4566ac
call fcn.00416f00
add esp, 0xc
lea eax, [ebp - 0x228]
mov dword [ebp - 0x228], 1
mov dword [ebp - 0x230], eax
lea eax, [ebp - 0x240]
push eax
push 2
push esi
mov dword [ebp - 0x224], 0x3e8
mov dword [ebp - 0x220], 1
mov dword [ebp - 0x21c], 0x3e8
mov dword [ebp - 0x218], 1
mov dword [ebp - 0x214], 0x3e8
mov dword [ebp - 0x234], 3
mov dword [ebp - 0x240], 0x15180
mov dword [ebp - 0x238], 0
mov dword [ebp - 0x23c], 0
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2W]
test eax, eax
jne 0x40f154
call ebx
push eax
push str.UpdateServiceConfiguration::ChangeServiceConfig2
push 0x4566ac
call fcn.00416f00
add esp, 0xc
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
mov bl, 1
push edi
call esi
mov ecx, dword [ebp - 4]
mov al, bl
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0043183b
mov esp, ebp
pop ebp
ret
Function at 0x40f180
Capabilities:
Start service

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc
mov eax, dword [0x461008]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push 4
push str.ServicesActive
push 0
xor bl, bl
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
test eax, eax
jne 0x40f1d0
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenSCManager
push 0x4566ac
call fcn.00416f00
add esp, 0xc
mov al, bl
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0043183b
mov esp, ebp
pop ebp
ret
push 0x10
push str.hmpalertsvc
push eax
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
test eax, eax
jne 0x40f20c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenService
push 0x4566ac
call fcn.00416f00
add esp, 0xc
mov al, bl
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0043183b
mov esp, ebp
pop ebp
ret
lea ecx, [ebp - 0xc]
mov dword [ebp - 0xc], str._service
push ecx
push 1
push eax
mov dword [ebp - 8], str._updated
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
jne 0x40f255
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.StartService
push 0x4566ac
call fcn.00416f00
add esp, 0xc
mov al, bl
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0043183b
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
mov al, 1
xor ecx, ebp
pop ebx
call fcn.0043183b
mov esp, ebp
pop ebp
ret

Function at 0x40f270
Capabilities:
Delete service
Stop service

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
mov eax, dword [0x461008]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push edi
push 0xf003f
push 0
push 0
xor bl, bl
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov edi, eax
test edi, edi
je 0x40f338
push esi
push 0x10020
push str.hmpalertsvc
push edi
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov esi, eax
test esi, esi
jne 0x40f2cc
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
cmp eax, 0x424
jne 0x40f334
mov bl, 1
jmp 0x40f334
lea eax, [ebp - 0x20]
push eax
push 1
push esi
call dword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
jne 0x40f303
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x426
je 0x40f303
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ControlService__svc_
push 0x4566ac
call fcn.00416f00
add esp, 0xc
push esi
call dword [sym.imp.ADVAPI32.dll_DeleteService]
test eax, eax
je 0x40f312
mov bl, 1
jmp 0x40f32b
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.DeleteService__svc_
push 0x4566ac
call fcn.00416f00
add esp, 0xc
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push edi
call esi
pop esi
mov ecx, dword [ebp - 4]
mov al, bl
pop edi
xor ecx, ebp
pop ebx
call fcn.0043183b
mov esp, ebp
pop ebp
ret