joyce8/EMBER2024-capa huggingface dataset:
Function at 0x4963a0
Capabilities:
Enumerate files on windows
Set file attributes

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffeb4
push ebx
push esi
push edi
xor edx, edx
mov dword [ebp - 0x14c], edx
mov dword [ebp - 8], edx
mov ebx, eax
xor eax, eax
push ebp
push 0x4964de
push dword fs:[eax]
mov dword fs:[eax], esp
lea eax, [ebp - 0x148]
push eax
mov edx, ebx
lea eax, [ebp - 0x14c]
call fcn.00403494
lea eax, [ebp - 0x14c]
mov edx, 0x4964f4
call fcn.0040357c
mov eax, dword [ebp - 0x14c]
call fcn.00403738
push eax
call sub.kernel32.dll_FindFirstFileA
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0xffffffff
je 0x4964bd
xor eax, eax
push ebp
push 0x4964b6
push dword fs:[eax]
mov dword fs:[eax], esp
mov edx, 0x496504
lea eax, [ebp - 0x11c]
mov ecx, 5
call fcn.00407438
test eax, eax
jne 0x496487
test byte [ebp - 0x148], 0x10
jne 0x496487
lea eax, [ebp - 0x14c]
lea edx, [ebp - 0x11c]
mov ecx, 0x104
call fcn.0040355c
mov ecx, dword [ebp - 0x14c]
lea eax, [ebp - 8]
mov edx, ebx
call fcn.004035c0
mov esi, dword [ebp - 0x148]
test esi, 1
je 0x49647f
and esi, 0xfffffffe
push esi
mov eax, dword [ebp - 8]
call fcn.00403738
push eax
call sub.kernel32.dll_SetFileAttributesA
mov eax, dword [ebp - 8]
call fcn.00406f30
lea eax, [ebp - 0x148]
push eax
mov eax, dword [ebp - 4]
push eax
call sub.kernel32.dll_FindNextFileA
test eax, eax
jne 0x496417
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x4964bd
mov eax, dword [ebp - 4]
push eax
call sub.kernel32.dll_FindClose
ret
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x4964e5
lea eax, [ebp - 0x14c]
call fcn.00403400
lea eax, [ebp - 8]
call fcn.00403400
ret
Function at 0x49650c
Capabilities:
Check if file exists
Get file attributes
Move file
Set file attributes

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffe4
push ebx
push esi
push edi
xor ecx, ecx
mov dword [ebp - 0x14], ecx
mov dword [ebp - 0xc], ecx
mov dword [ebp - 0x10], ecx
mov dword [ebp - 8], edx
mov dword [ebp - 4], eax
xor eax, eax
push ebp
push 0x496602
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [ebp - 8]
call fcn.00403400
lea edx, [ebp - 0xc]
mov eax, dword [ebp - 4]
call fcn.0042c8f8
xor edi, edi
xor ebx, ebx
lea eax, [ebp - 0x14]
push eax
mov dword [ebp - 0x1c], ebx
mov byte [ebp - 0x18], 0
lea edx, [ebp - 0x1c]
xor ecx, ecx
mov eax, 0x496618
call fcn.004078d4
mov ecx, dword [ebp - 0x14]
lea eax, [ebp - 0x10]
mov edx, dword [ebp - 0xc]
call fcn.004035c0
mov eax, dword [ebp - 0x10]
call fcn.00403738
push eax
call sub.kernel32.dll_GetFileAttributesA
mov esi, eax
cmp esi, 0xffffffff
je 0x4965aa
test esi, 0x10
jne 0x4965da
test esi, 1
je 0x4965aa
and esi, 0xfffffffe
push esi
mov eax, dword [ebp - 0x10]
call fcn.00403738
push eax
call sub.kernel32.dll_SetFileAttributesA
push 1
mov eax, dword [ebp - 0x10]
call fcn.00403738
push eax
mov eax, dword [ebp - 4]
call fcn.00403738
push eax
call sub.kernel32.dll_MoveFileExA
test eax, eax
je 0x4965d4
mov eax, dword [ebp - 8]
mov edx, dword [ebp - 0x10]
call fcn.00403494
jmp 0x4965e7
inc edi
cmp edi, 0xa
je 0x4965e7
inc ebx
cmp ebx, 0x3e8
jne 0x49654b
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x496609
lea eax, [ebp - 0x14]
mov edx, 3
call fcn.00403420
ret
Function at 0x419f80
Capabilities:
Write file on windows

Disassembly:
push ebp
lea ebp, [esp - 0x3a0]
sub esp, 0x420
mov eax, dword [0x4232f8]
push edi
xor edi, edi
cmp dword [ebp + 0x3b0], edi
mov dword [ebp + 0x39c], eax
mov dword [ebp - 0x78], edi
mov dword [ebp - 0x7c], edi
jne 0x419fb1
xor eax, eax
jmp 0x41a13a
mov eax, dword [ebp + 0x3a8]
push ebx
mov ebx, dword [ebp + 0x3a8]
and eax, 0x1f
sar ebx, 5
push esi
lea esi, [eax + eax*8]
lea ebx, [ebx*4 + 0x425440]
mov eax, dword [ebx]
shl esi, 2
test byte [eax + esi + 4], 0x20
je 0x419fed
push 2
push edi
push edi
push dword [ebp + 0x3a8]
call fcn.0041ad4a
add esp, 0x10
mov eax, dword [ebx]
add eax, esi
test byte [eax + 4], 0x80
je 0x41a0c8
cmp dword [ebp + 0x3b0], edi
mov eax, dword [ebp + 0x3ac]
mov dword [ebp - 0x74], eax
mov dword [ebp - 0x6c], edi
jbe 0x41a106
mov ecx, dword [ebp - 0x74]
sub ecx, dword [ebp + 0x3ac]
lea eax, [ebp - 0x68]
mov dword [ebp - 0x70], edi
cmp ecx, dword [ebp + 0x3b0]
jae 0x41a051
mov edx, dword [ebp - 0x74]
inc dword [ebp - 0x74]
mov dl, byte [edx]
inc ecx
cmp dl, 0xa
jne 0x41a042
inc dword [ebp - 0x7c]
mov byte [eax], 0xd
inc eax
inc dword [ebp - 0x70]
mov byte [eax], dl
inc eax
inc dword [ebp - 0x70]
cmp dword [ebp - 0x70], 0x400
jl 0x41a022
mov edi, eax
lea eax, [ebp - 0x68]
sub edi, eax
push 0
lea eax, [ebp - 0x80]
push eax
push edi
lea eax, [ebp - 0x68]
push eax
mov eax, dword [ebx]
push dword [eax + esi]
call dword [sym.imp.KERNEL32.DLL_WriteFile]
test eax, eax
je 0x41a091
mov eax, dword [ebp - 0x80]
add dword [ebp - 0x78], eax
cmp eax, edi
jl 0x41a09a
mov eax, dword [ebp - 0x74]
sub eax, dword [ebp + 0x3ac]
xor edi, edi
cmp eax, dword [ebp + 0x3b0]
jb 0x41a013
jmp 0x41a09c
call dword [sym.imp.KERNEL32.DLL_GetLastError]
mov dword [ebp - 0x6c], eax
xor edi, edi
mov eax, dword [ebp - 0x78]
cmp eax, edi
jne 0x41a135
cmp dword [ebp - 0x6c], edi
je 0x41a106
push 5
pop esi
cmp dword [ebp - 0x6c], esi
jne 0x41a0fb
call fcn.00413f22
mov dword [eax], 9
call fcn.00413f2b
mov dword [eax], esi
jmp 0x41a130
push edi
lea ecx, [ebp - 0x80]
push ecx
push dword [ebp + 0x3b0]
push dword [ebp + 0x3ac]
push dword [eax]
call dword [sym.imp.KERNEL32.DLL_WriteFile]
test eax, eax
je 0x41a0f0
mov eax, dword [ebp - 0x80]
mov dword [ebp - 0x6c], edi
mov dword [ebp - 0x78], eax
jmp 0x41a09c
call dword [sym.imp.KERNEL32.DLL_GetLastError]
mov dword [ebp - 0x6c], eax
jmp 0x41a09c
push dword [ebp - 0x6c]
call fcn.00413f34
pop ecx
jmp 0x41a130
mov eax, dword [ebx]
test byte [eax + esi + 4], 0x40
je 0x41a11e
mov eax, dword [ebp + 0x3ac]
cmp byte [eax], 0x1a
jne 0x41a11e
xor eax, eax
jmp 0x41a138
call fcn.00413f22
mov dword [eax], 0x1c
call fcn.00413f2b
mov dword [eax], edi
or eax, 0xffffffff
jmp 0x41a138
sub eax, dword [ebp - 0x7c]
pop esi
pop ebx
mov ecx, dword [ebp + 0x39c]
pop edi
call fcn.0041387c
add ebp, 0x3a0
leave
ret
Function at 0x41a4b7
Capabilities:
Parse pe header

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
push ebx
push esi
mov esi, dword [ebp + 8]
mov ebx, dword [esi + 8]
test bl, 3
jne 0x41a4e5
mov eax, dword fs:[0x18]
mov dword [ebp + 8], eax
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 8]
cmp ebx, ecx
mov dword [ebp - 4], ecx
jb 0x41a4ec
cmp ebx, dword [eax + 4]
jae 0x41a4ec
xor eax, eax
jmp 0x41a6dc
push edi
mov edi, dword [esi + 0xc]
cmp edi, 0xffffffff
jne 0x41a4fd
xor eax, eax
inc eax
jmp 0x41a6db
xor edx, edx
mov dword [ebp + 8], edx
mov eax, ebx
mov ecx, dword [eax]
cmp ecx, 0xffffffff
je 0x41a513
cmp ecx, edx
jae 0x41a658
cmp dword [eax + 4], 0
je 0x41a51c
inc dword [ebp + 8]
inc edx
add eax, 0xc
cmp edx, edi
jbe 0x41a504
cmp dword [ebp + 8], 0
je 0x41a53e
mov eax, dword [esi - 8]
cmp eax, dword [ebp - 4]
jb 0x41a658
cmp eax, esi
jae 0x41a658
mov eax, dword [0x424360]
mov edi, ebx
and edi, 0xfffff000
xor esi, esi
test eax, eax
jle 0x41a563
cmp dword [esi*4 + 0x424368], edi
je 0x41a65c
inc esi
cmp esi, eax
jl 0x41a551
push 0x1c
lea eax, [ebp - 0x20]
push eax
push ebx
call dword [sym.imp.KERNEL32.DLL_VirtualQuery]
test eax, eax
je 0x41a6d8
cmp dword [ebp - 8], 0x1000000
jne 0x41a6d8
test byte [ebp - 0xc], 0xcc
je 0x41a5e1
mov ecx, dword [ebp - 0x1c]
cmp word [ecx], 0x5a4d
jne 0x41a6d8
mov eax, dword [ecx + 0x3c]
add eax, ecx
cmp dword [eax], 0x4550
jne 0x41a6d8
cmp word [eax + 0x18], 0x10b
jne 0x41a6d8
sub ebx, ecx
cmp word [eax + 6], 0
movzx ecx, word [eax + 0x14]
lea ecx, [ecx + eax + 0x18]
jbe 0x41a6d8
mov eax, dword [ecx + 0xc]
cmp ebx, eax
jb 0x41a5e1
mov edx, dword [ecx + 8]
add edx, eax
cmp ebx, edx
jae 0x41a5e1
test byte [ecx + 0x27], 0x80
jne 0x41a658
push 1
push 0x4243a8
call dword [sym.imp.KERNEL32.DLL_InterlockedExchange]
test eax, eax
jne 0x41a4f5
mov ecx, dword [0x424360]
test ecx, ecx
mov edx, ecx
jle 0x41a615
lea eax, [ecx*4 + 0x424364]
cmp dword [eax], edi
je 0x41a615
dec edx
sub eax, 4
test edx, edx
jg 0x41a609
test edx, edx
jne 0x41a646
push 0xf
pop ebx
cmp ecx, ebx
jg 0x41a622
mov ebx, ecx
xor edx, edx
test ebx, ebx
jl 0x41a63a
lea eax, [edx*4 + 0x424368]
mov esi, dword [eax]
inc edx
cmp edx, ebx
mov dword [eax], edi
mov edi, esi
jle 0x41a628
cmp ecx, 0x10
jge 0x41a646
inc ecx
mov dword [0x424360], ecx
push 0
push 0x4243a8
call dword [sym.imp.KERNEL32.DLL_InterlockedExchange]
jmp 0x41a4f5
xor eax, eax
jmp 0x41a6db
test esi, esi
jle 0x41a4f5
mov ebx, dword [sym.imp.KERNEL32.DLL_InterlockedExchange]
push 1
push 0x4243a8
call ebx
test eax, eax
jne 0x41a4f5
cmp dword [esi*4 + 0x424368], edi
je 0x41a6b2
mov eax, dword [0x424360]
lea esi, [eax - 1]
test esi, esi
jl 0x41a6a0
cmp dword [esi*4 + 0x424368], edi
je 0x41a69c
dec esi
jns 0x41a690
test esi, esi
jge 0x41a6b0
cmp eax, 0x10
jge 0x41a6ab
inc eax
mov dword [0x424360], eax
lea esi, [eax - 1]
jmp 0x41a6b2
je 0x41a6ca
xor ecx, ecx
test esi, esi
jl 0x41a6ca
lea eax, [ecx*4 + 0x424368]
mov edx, dword [eax]
inc ecx
cmp ecx, esi
mov dword [eax], edi
mov edi, edx
jle 0x41a6b8
push 0
push 0x4243a8
call ebx
jmp 0x41a4f5
or eax, 0xffffffff
pop edi
pop esi
pop ebx
leave
ret
Function at 0x41a8ec
Capabilities:
Get system information on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x4c
push ebx
push esi
push edi
push 4
pop eax
call fcn.00413140
mov esi, esp
push 0x1c
lea eax, [ebp - 0x28]
push eax
push esi
call dword [sym.imp.KERNEL32.DLL_VirtualQuery]
test eax, eax
je 0x41a987
mov ebx, dword [ebp - 0x24]
lea eax, [ebp - 0x4c]
push eax
call dword [sym.imp.KERNEL32.DLL_GetSystemInfo]
mov ecx, dword [ebp - 0x48]
mov eax, dword [0x423f44]
lea edi, [ecx - 1]
not edi
and edi, esi
sub edi, ecx
mov esi, eax
dec esi
neg esi
sbb esi, esi
and esi, 0xfffffff1
add esi, 0x11
imul esi, ecx
add esi, ebx
cmp edi, esi
mov dword [ebp - 8], ecx
jb 0x41a987
cmp eax, 1
je 0x41a9a8
mov dword [ebp - 4], ebx
mov ebx, 0x1000
push 0x1c
lea eax, [ebp - 0x28]
push eax
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.DLL_VirtualQuery]
test eax, eax
je 0x41a987
mov eax, dword [ebp - 0x1c]
add dword [ebp - 4], eax
test dword [ebp - 0x18], ebx
je 0x41a954
test byte [ebp - 0x13], 1
mov eax, dword [ebp - 0x28]
mov dword [ebp - 4], eax
je 0x41a983
xor eax, eax
inc eax
jmp 0x41a9c7
cmp edi, eax
jae 0x41a98b
xor eax, eax
jmp 0x41a9c7
cmp eax, esi
jae 0x41a992
mov dword [ebp - 4], esi
push 4
push ebx
push dword [ebp - 8]
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.DLL_VirtualAlloc]
mov eax, dword [0x423f44]
jmp 0x41a9ab
mov dword [ebp - 4], edi
dec eax
neg eax
sbb eax, eax
and eax, 0x103
lea ecx, [ebp - 0xc]
push ecx
inc eax
push eax
push dword [ebp - 8]
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.DLL_VirtualProtect]
lea esp, [ebp - 0x58]
pop edi
pop esi
pop ebx
leave
ret

Function at 0x41aba1
Capabilities:
Link many functions at runtime

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
push ebx
xor ebx, ebx
cmp dword [0x4243b0], ebx
push esi
push edi
jne 0x41ac21
push 0x420250
call dword [sym.imp.KERNEL32.DLL_LoadLibraryA]
mov edi, eax
cmp edi, ebx
je 0x41ac5c
mov esi, dword [sym.imp.KERNEL32.DLL_GetProcAddress]
push 0x420244
push edi
call esi
test eax, eax
mov dword [0x4243b0], eax
je 0x41ac5c
push 0x420234
push edi
call esi
push 0x420220
push edi
mov dword [0x4243b4], eax
call esi
cmp dword [0x423f44], 2
mov dword [0x4243b8], eax
jne 0x41ac21
push 0x420204
push edi
call esi
test eax, eax
mov dword [0x4243c0], eax
je 0x41ac21
push 0x4201ec
push edi
call esi
mov dword [0x4243bc], eax
mov eax, dword [0x4243bc]
test eax, eax
je 0x41ac66
call eax
test eax, eax
je 0x41ac4d
lea ecx, [ebp - 4]
push ecx
push 0xc
lea ecx, [ebp - 0x10]
push ecx
push 1
push eax
call dword [0x4243c0]
test eax, eax
je 0x41ac4d
test byte [ebp - 8], 1
jne 0x41ac66
cmp dword [0x423f50], 4
jb 0x41ac60
or byte [ebp + 0x12], 0x20
jmp 0x41ac85
xor eax, eax
jmp 0x41ac95
or byte [ebp + 0x12], 4
jmp 0x41ac85
mov eax, dword [0x4243b4]
test eax, eax
je 0x41ac85
call eax
mov ebx, eax
test ebx, ebx
je 0x41ac85
mov eax, dword [0x4243b8]
test eax, eax
je 0x41ac85
push ebx
call eax
mov ebx, eax
push dword [ebp + 0x10]
push dword [ebp + 0xc]
push dword [ebp + 8]
push ebx
call dword [0x4243b0]
pop edi
pop esi
pop ebx
leave
ret
Function at 0x41b806
Capabilities:
Set environment variable

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
mov eax, dword [ebp + 8]
push ebx
xor ebx, ebx
cmp eax, ebx
push edi
mov dword [ebp - 0x10], ebx
jne 0x41b81f
or eax, 0xffffffff
jmp 0x41b880
push esi
mov esi, dword [eax]
cmp esi, ebx
mov dword [ebp - 4], esi
je 0x41b87c
push 0x3d
push esi
call fcn.00412bfd
cmp eax, ebx
pop ecx
pop ecx
mov dword [ebp - 0xc], eax
je 0x41b87c
cmp esi, eax
je 0x41b87c
xor ecx, ecx
cmp byte [eax + 1], bl
mov eax, dword [0x423f64]
sete cl
cmp eax, dword [0x423f68]
mov dword [ebp - 8], ecx
jne 0x41b862
mov edi, eax
call fcn.0041b7a5
mov dword [0x423f64], eax
cmp eax, ebx
jne 0x41b8bb
cmp dword [ebp + 0xc], ebx
je 0x41b884
cmp dword [0x423f6c], ebx
je 0x41b884
call fcn.0041b1cf
test eax, eax
je 0x41b8bb
or eax, 0xffffffff
pop esi
pop edi
pop ebx
leave
ret
cmp dword [ebp - 8], ebx
je 0x41b88d
xor eax, eax
jmp 0x41b87f
push 4
call fcn.00413e9f
cmp eax, ebx
pop ecx
mov dword [0x423f64], eax
je 0x41b87c
mov dword [eax], ebx
cmp dword [0x423f6c], ebx
jne 0x41b8bb
push 4
call fcn.00413e9f
cmp eax, ebx
pop ecx
mov dword [0x423f6c], eax
je 0x41b87c
mov dword [eax], ebx
mov edi, dword [ebp - 0xc]
sub edi, dword [ebp - 4]
push dword [ebp - 4]
mov esi, dword [0x423f64]
call fcn.0041b758
mov edi, eax
cmp edi, ebx
pop ecx
jl 0x41b91c
cmp dword [esi], ebx
je 0x41b91c
lea esi, [esi + edi*4]
push dword [esi]
call fcn.00413eb1
cmp dword [ebp - 8], ebx
pop ecx
jne 0x41b8ff
mov eax, dword [ebp - 4]
mov dword [esi], eax
mov eax, dword [ebp + 8]
mov dword [eax], ebx
jmp 0x41b95d
mov eax, dword [esi + 4]
mov dword [esi], eax
inc edi
add esi, 4
cmp dword [esi], ebx
jne 0x41b8f6
mov eax, edi
shl eax, 2
push eax
push dword [0x423f64]
call fcn.004161dc
cmp eax, ebx
pop ecx
pop ecx
je 0x41b95d
jmp 0x41b958
cmp dword [ebp - 8], ebx
jne 0x41b9c8
cmp edi, ebx
jge 0x41b92b
neg edi
lea eax, [edi*4 + 8]
push eax
push dword [0x423f64]
call fcn.004161dc
cmp eax, ebx
pop ecx
pop ecx
je 0x41b87c
mov edx, dword [ebp - 4]
lea ecx, [eax + edi*4]
mov dword [ecx], edx
mov dword [ecx + 4], ebx
mov ecx, dword [ebp + 8]
mov dword [ecx], ebx
mov dword [0x423f64], eax
cmp dword [ebp + 0xc], ebx
je 0x41b9b2
push dword [ebp - 4]
call fcn.00414080
inc eax
inc eax
push eax
call fcn.00413e9f
mov esi, eax
cmp esi, ebx
pop ecx
pop ecx
je 0x41b9b2
push dword [ebp - 4]
push esi
call fcn.00417420
mov eax, esi
sub eax, dword [ebp - 4]
pop ecx
add eax, dword [ebp - 0xc]
pop ecx
mov ecx, dword [ebp - 8]
mov byte [eax], bl
inc eax
neg ecx
sbb ecx, ecx
not ecx
and ecx, eax
push ecx
push esi
call dword [sym.imp.KERNEL32.DLL_SetEnvironmentVariableA]
test eax, eax
jne 0x41b9ab
or dword [ebp - 0x10], 0xffffffff
push esi
call fcn.00413eb1
pop ecx
cmp dword [ebp - 8], ebx
je 0x41b9c0
push dword [ebp - 4]
call fcn.00413eb1
pop ecx
mov eax, dword [ebp - 0x10]
jmp 0x41b87f
push dword [ebp - 4]
call fcn.00413eb1
mov eax, dword [ebp + 8]
pop ecx
mov dword [eax], ebx
jmp 0x41b889
Function at 0x401500
Capabilities:
Create process on windows

Disassembly:
lea ecx, [esp + 4]
and esp, 0xfffffff0
push dword [ecx - 4]
push ebp
mov ebp, esp
push ecx
sub esp, 0x14
call dbg.__main
mov dword [esp + 4], 5
mov dword [esp], str.calc.exe
mov eax, dword [sym.imp.KERNEL32.dll_WinExec]
call eax
sub esp, 8
mov eax, 0
mov ecx, dword [ebp - 4]
leave
lea esp, [ecx - 4]
ret

Function at 0x4019a0
Capabilities:
Write file on windows

Disassembly:
push ebx
sub esp, 0x18
mov eax, dword [sym.imp.msvcrt.dll__iob]
mov dword [esp + 8], 0x1b
mov dword [esp + 4], 1
lea ebx, [esp + 0x24]
mov dword [esp], str.Mingw_w64_runtime_failure:_n
add eax, 0x40
mov dword [esp + 0xc], eax
call sym._fwrite
mov eax, dword [esp + 0x20]
mov dword [esp + 8], ebx
mov dword [esp + 4], eax
mov eax, dword [sym.imp.msvcrt.dll__iob]
add eax, 0x40
mov dword [esp], eax
call sym._vfprintf
call sym._abort
jmp dbg.mark_section_writable

Function at 0x401a00
Capabilities:
Allocate or change rwx memory

Disassembly:
push edi
push esi
push ebx
sub esp, 0x30
mov esi, dword [0x405050]
test esi, esi
jle 0x401aed
mov edi, dword [0x405054]
xor ebx, ebx
lea edx, [edi + 4]
nop
mov ecx, dword [edx]
cmp ecx, eax
ja 0x401a34
mov edi, dword [edx + 4]
add ecx, dword [edi + 8]
cmp eax, ecx
jb 0x401ae6
add ebx, 1
add edx, 0xc
cmp ebx, esi
jne 0x401a20
mov dword [esp], eax
mov ebx, eax
call dbg.__mingw_GetSectionForAddress
test eax, eax
mov edi, eax
je 0x401b2a
lea ebx, [esi + esi*2]
mov esi, dword [0x405054]
shl ebx, 2
add esi, ebx
mov dword [esi + 8], eax
mov dword [esi], 0
call dbg._GetPEImageBase
add eax, dword [edi + 0xc]
mov dword [esi + 4], eax
lea eax, [esp + 0x14]
mov dword [esp + 8], 0x1c
mov dword [esp + 4], eax
mov eax, dword [0x405054]
mov eax, dword [eax + ebx + 4]
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_VirtualQuery]
sub esp, 0xc
test eax, eax
je 0x401b0a
mov eax, dword [esp + 0x28]
lea edx, [eax - 4]
and edx, 0xfffffffb
je 0x401adf
sub eax, 0x40
and eax, 0xffffffbf
je 0x401adf
mov eax, dword [esp + 0x20]
add ebx, dword [0x405054]
mov dword [esp + 8], 0x40
mov dword [esp + 4], eax
mov eax, dword [esp + 0x14]
mov dword [esp + 0xc], ebx
mov dword [esp], eax
call dword [sym.imp.KERNEL32.dll_VirtualProtect]
sub esp, 0x10
test eax, eax
je 0x401af4
add dword [0x405050], 1
add esp, 0x30
pop ebx
pop esi
pop edi
ret
xor esi, esi
jmp 0x401a3e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esp], str.__VirtualProtect_failed_with_code_0x_x
mov dword [esp + 4], eax
call dbg.__report_error
mov eax, dword [0x405054]
mov eax, dword [eax + ebx + 4]
mov dword [esp + 8], eax
mov eax, dword [edi + 8]
mov dword [esp], str.__VirtualQuery_failed_for__d_bytes_at_address__p
mov dword [esp + 4], eax
call dbg.__report_error
mov dword [esp + 4], ebx
mov dword [esp], str.Address__p_has_no_image_section
call dbg.__report_error
lea esi, [esi]
Function at 0x401240
Capabilities:
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x424
mov eax, dword [0x42c008]
xor eax, ebp
mov dword [ebp - 4], eax
push 0x208
lea eax, [ebp - 0x20c]
push 0
push eax
call fcn.0040ce90
push str.CLSID60EB195D_B64E_4209_8AB8_53E040061B9CSystemEvent
push 0x4239b4
lea eax, [ebp - 0x20c]
mov dword [ebp - 0x41c], 0
push 0x104
push eax
call fcn.00401120
add esp, 0x1c
mov dword [ebp - 0x418], 0
lea eax, [ebp - 0x418]
push eax
push 0x20019
push 0
lea eax, [ebp - 0x20c]
push eax
push 0x80000000
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
je 0x4012cc
xor eax, eax
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040aea4
mov esp, ebp
pop ebp
ret
push str.DebugMode
push 0x4239b4
lea eax, [ebp - 0x414]
mov dword [ebp - 0x424], 0
push 0x104
push eax
mov dword [ebp - 0x420], 0
call fcn.00401120
add esp, 0x10
lea eax, [ebp - 0x420]
push eax
push 0
lea eax, [ebp - 0x424]
push eax
push 0
lea eax, [ebp - 0x414]
push eax
push dword [ebp - 0x418]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
je 0x401333
mov dword [ebp - 0x41c], 0
jmp 0x40135d
lea eax, [ebp - 0x420]
push eax
lea eax, [ebp - 0x41c]
push eax
lea eax, [ebp - 0x424]
push eax
push 0
lea eax, [ebp - 0x414]
push eax
push dword [ebp - 0x418]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
mov eax, dword [ebp - 0x418]
test eax, eax
je 0x40136e
push eax
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov ecx, dword [ebp - 4]
xor eax, eax
cmp dword [ebp - 0x41c], 1
sete al
xor ecx, ebp
call fcn.0040aea4
mov esp, ebp
pop ebp
ret

Function at 0x402180
Capabilities:
Create service
Persist via windows service

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x414
mov eax, dword [0x42c008]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push 0xf003f
xor ebx, ebx
push ebx
push ebx
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov edi, eax
test edi, edi
je 0x4021d6
push 1
push str.HPWMISVC
push edi
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
test eax, eax
je 0x4021cb
push eax
mov ebx, 1
call esi
push edi
call esi
test ebx, ebx
jne 0x402271
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov edi, eax
test edi, edi
je 0x402258
push 0x104
lea eax, [ebp - 0x20c]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
push 0x423aec
lea eax, [ebp - 0x20c]
push eax
push 0x423aec
lea eax, [ebp - 0x414]
push 0x423af0
push eax
call fcn.0040ad20
add esp, 0x14
lea eax, [ebp - 0x414]
push 0
push 0
push 0
push 0
push 0
push eax
push 1
push 2
push 0x10
push 0xf01ff
push str.HPWMISVC
push str.HPWMISVC
push edi
call dword [sym.imp.ADVAPI32.dll_CreateServiceW]
test eax, eax
jne 0x40226b
push edi
call esi
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040aea4
mov esp, ebp
pop ebp
ret
push eax
call esi
push edi
call esi
mov ecx, dword [ebp - 4]
mov eax, 1
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040aea4
mov esp, ebp
pop ebp
ret
Function at 0x402290
Capabilities:
Continue service
Create process on windows
Delete service
Get common file path
Query service status
Stop service

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x434
mov eax, dword [0x42c008]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov edi, dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
push 0xf003f
push 0
push 0
mov dword [ebp - 0x434], 0
call edi
mov esi, eax
test esi, esi
je 0x402455
push 1
push str.HPWMISVC
push esi
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov ebx, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
test eax, eax
je 0x4022f0
push eax
mov dword [ebp - 0x434], 1
call ebx
push esi
call ebx
cmp dword [ebp - 0x434], 0
je 0x402455
push 0xf003f
push 0
push 0
call edi
mov ebx, eax
mov dword [ebp - 0x434], ebx
test ebx, ebx
je 0x402337
push 0x10020
push str.HPWMISVC
push ebx
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov edi, eax
test edi, edi
jne 0x40234a
mov edi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push ebx
call edi
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040aea4
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x430]
xor esi, esi
push eax
push 1
push edi
call dword [sym.imp.ADVAPI32.dll_ControlService]
mov ebx, dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
lea eax, [ebp - 0x430]
push eax
push edi
call ebx
cmp dword [ebp - 0x42c], 3
jne 0x40239d
push 0x1f4
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0x430]
push eax
push edi
call ebx
test eax, eax
je 0x40238f
inc esi
cmp esi, 0x14
ja 0x40239d
cmp dword [ebp - 0x42c], 3
je 0x402375
push edi
call dword [sym.imp.ADVAPI32.dll_DeleteService]
push edi
mov edi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov esi, eax
call edi
push dword [ebp - 0x434]
call edi
push 0x208
lea eax, [ebp - 0x414]
push 0
push eax
call fcn.0040ce90
push 0x208
lea eax, [ebp - 0x20c]
push 0
push eax
call fcn.0040ce90
add esp, 0x18
lea eax, [ebp - 0x20c]
push 0
push 0x25
push eax
push 0
call dword [sym.imp.SHELL32.dll_SHGetSpecialFolderPathW]
lea eax, [ebp - 0x20c]
push eax
push str._s_taskkill.exe
push 0x104
push eax
call fcn.00401120
push str._IM_HPMSGSVC.exe__F
lea eax, [ebp - 0x414]
push 0x104
push eax
call fcn.00401120
add esp, 0x1c
lea eax, [ebp - 0x414]
push 0
push 0
push eax
lea eax, [ebp - 0x20c]
push eax
push str.open
push 0
call dword [sym.imp.SHELL32.dll_ShellExecuteW]
pop edi
mov eax, esi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040aea4
mov esp, ebp
pop ebp
ret
mov ecx, dword [ebp - 4]
mov eax, 1
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040aea4
mov esp, ebp
pop ebp
ret