joyce8/EMBER2024-capa huggingface dataset:
Function at 0x406094
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x28
push esi
push edi
or edi, 0xffffffff
or eax, 0xffffffff
mov dword [ebp - 0x24], 0
xor esi, esi
mov edx, dword [0x408280]
add edx, 0x24
mov esi, edx
cmp dword [edx], 0xffffffff
je 0x4060d2
mov ecx, dword [edx + 8]
cmp ecx, dword [ebp + 0x10]
ja 0x4060cd
mov ecx, dword [edx + 8]
cmp ecx, dword [esi + 8]
jbe 0x4060cd
mov esi, edx
add edx, 0x10
jmp 0x4060b6
mov edx, esi
cmp dword [edx], 0xffffffff
je 0x4061e6
mov ecx, dword [edx + 8]
cmp ecx, dword [ebp + 0x10]
ja 0x4061e6
mov ecx, dword [edx + 8]
cmp ecx, dword [ebp + 0x10]
ja 0x4061e4
mov ecx, dword [edx + 8]
sub dword [ebp + 0x10], ecx
mov ecx, dword [edx + 8]
mov dword [ebp - 0x18], ecx
mov edx, dword [edx + 0xc]
test edx, edx
je 0x4061e4
mov cl, byte [edx]
sub cl, 0x3c
jne 0x40611a
jmp 0x4061e4
sub cl, 3
jne 0x406134
inc edx
mov dword [ebp - 0xc], edx
movzx ecx, byte [edx]
inc ecx
add edx, ecx
mov byte [ebp - 0x25], 1
jmp 0x4061df
inc cl
jne 0x406148
movzx ecx, word [edx + 1]
add edi, ecx
add edx, 3
jmp 0x4061df
inc cl
jne 0x40615c
movzx ecx, word [edx + 1]
add edi, ecx
mov ecx, dword [edx + 3]
add eax, ecx
add edx, 7
jmp 0x40616f
movzx ecx, byte [edx]
shr ecx, 6
add edi, ecx
mov cl, byte [edx]
and cl, 0x3f
movzx ecx, cl
add eax, ecx
inc edx
cmp eax, dword [ebp + 0x10]
jne 0x406179
mov esi, eax
mov dword [ebp - 0x24], edi
cmp eax, dword [ebp + 0x10]
jl 0x4061d6
sub eax, dword [ebp + 0x10]
cmp eax, 0xa
jle 0x40618c
cmp byte [ebp - 0x25], 0
jne 0x4061d4
mov eax, dword [ebp - 0xc]
mov cl, byte [eax]
mov eax, dword [ebp + 0xc]
mov byte [eax], cl
mov dword [ebp - 0x14], 0
mov eax, dword [ebp - 0xc]
movzx eax, byte [eax]
cmp eax, dword [ebp - 0x14]
jle 0x4061c2
inc dword [ebp - 0x14]
mov ecx, dword [ebp - 0xc]
mov eax, dword [ebp - 0x14]
mov dl, byte [eax + ecx]
xor dl, 0xaa
mov ecx, dword [ebp + 0xc]
mov eax, dword [ebp - 0x14]
mov byte [eax + ecx], dl
jmp 0x40619d
movzx eax, word [ebp - 0x24]
mov ecx, dword [ebp + 8]
mov dword [ecx], eax
add esi, dword [ebp - 0x18]
mov eax, esi
jmp 0x4061e6
jmp 0x4061e4
mov esi, eax
mov dword [ebp - 0x24], edi
mov byte [ebp - 0x25], 0
jmp 0x40610c
xor eax, eax
pop edi
pop esi
mov esp, ebp
pop ebp
ret 0xc

Function at 0x4066bc
Capabilities:
Query environment variable

Disassembly:
sub esp, 0x10
cld
push ecx
call fcn.00406698
call fcn.004035ac
mov dword [0x408280], eax
lea edx, [eax + 0x18]
mov dword [0x4082e0], edx
pop edx
call fcn.00406518
call sub.kernel32.dll_GetEnvironmentStrings
mov dword [0x4082ac], eax
push 0
call sub.kernel32.dll_GetModuleHandleA
mov dword [0x4082c0], eax
mov dword [0x4082e8], eax
call fcn.004031dc
cmp eax, 3
setb byte [0x408289]
call fcn.004041fc
lea eax, [esp]
xor edx, edx
mov ecx, dword fs:[edx]
mov dword fs:[edx], eax
mov dword [eax], ecx
mov dword [eax + 4], 0x406948
mov dword [eax + 8], ebp
jmp dword [esp + 0x10]
Function at 0x41339a
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x60
pushal
call 0x4133a9
pop dword [ebp - 0x50]
mov eax, 0x4133a9
sub dword [ebp - 0x50], eax
push 0x40
push 0x1000
push 0x4d862
push 0
mov eax, sym.imp.kernel32.dll_VirtualAlloc
add eax, dword [ebp - 0x50]
call dword [eax]
mov ecx, 0x3d3f
mov edx, eax
mov esi, 0x78a7f5a3
sub esi, 0x786097a3
add esi, dword [ebp - 0x50]
mov ebx, 0x4a27ab91
add ebx, 0x34fa29f3
sub dword [ebp - 0x24], ebx
mov edi, dword [esi]
mov dword [ebp - 0x3c], 0x4455099b
sub edi, ebx
xor dword [ebp - 0x28], eax
mov dword [edx], edi
xor dword [ebp - 0x38], 0x444297c
add edx, 0x2cf5b693
sub edx, 0x2cf5b68f
add esi, 4
loop 0x4133f8
add eax, 0x24819e11
add eax, 0xdb7f49be
xor ebx, ebx
add ebx, eax
add eax, 5
mov ecx, 0x4d44b9b3
add ecx, 0xb2fb464d
add ecx, dword [ebp - 0x50]
call ebx
leave
ret

Function at 0x4400c9
Capabilities:
Encrypt data using dpapi

Disassembly:
push esi
push edi
push 0x46c6d0
push str.AdvApi32.dll
call main
mov edi, dword [sym.imp.kernel32.dll_GetProcAddress]
mov esi, eax
test esi, esi
js 0x44010c
push str.SystemFunction040
push dword [0x46c6d0]
call edi
push str.SystemFunction041
push dword [0x46c6d0]
mov dword [0x46c6c0], eax
call edi
mov dword [0x46c6c4], eax
jmp 0x440111
mov eax, dword [0x46c6c4]
cmp dword [0x46c6c0], 0
je 0x440122
test eax, eax
jne 0x4401c9
push 0x46c6d4
push str.Crypt32.dll
call main
mov esi, eax
test esi, esi
js 0x4401d3
push str.CryptProtectMemory
push dword [0x46c6d4]
call edi
cmp dword [0x46c6c0], 0
mov dword [0x46c6c8], eax
jne 0x440187
test eax, eax
jne 0x440187
call dword [sym.imp.kernel32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x440171
movzx esi, si
or esi, 0x80070000
test esi, esi
js 0x440178
mov esi, 0x80004005
push esi
push 0x28
push str.c:_agent_work138_s_srclibsdutilcryputil.cpp
call fcn.004038f5
jmp 0x4401d3
push str.CryptUnprotectMemory
push dword [0x46c6d4]
call edi
cmp dword [0x46c6c4], 0
mov dword [0x46c6cc], eax
jne 0x4401c9
test eax, eax
jne 0x4401c9
call dword [sym.imp.kernel32.dll_GetLastError]
mov esi, eax
test esi, esi
jle 0x4401bd
movzx esi, si
or esi, 0x80070000
test esi, esi
js 0x4401c4
mov esi, 0x80004005
push esi
push 0x2d
jmp 0x44017b
mov dword [0x46c6d8], 1
pop edi
mov eax, esi
pop esi
ret

Function at 0x403d61
Capabilities:
Encode data using xor

Disassembly:
push eax
push ebx
mov eax, 0x499
mov ecx, 0x404498
mov bl, byte [ecx]
sub bl, 0xf2
rol bl, 2
sub bl, cl
ror bl, 1
mov byte [ecx], bl
dec ecx
dec eax
jne 0x403d6d
mov eax, 0x261d
mov ecx, 0x403764
mov bl, byte [ecx]
rol bl, 7
ror bl, 2
sub bl, cl
xor bl, 0x91
mov byte [ecx], bl
dec ecx
dec eax
jne 0x403d8a
pop ebx
pop eax
add ecx, 0x2c1a
jmp ecx
Function at 0x4015cf
Capabilities:
Create process on windows
Terminate process

Disassembly:
push ebx
push ebp
push esi
mov ebx, dword [sym.imp.MSVCRT.dll_wcsncpy]
push edi
mov edi, dword [esp + 0x18]
push 0x100
mov esi, 0x4030e4
push dword [edi]
push esi
call ebx
push 0x4030c0
push esi
call dword [sym.imp.MSVCRT.dll__wstat]
add esp, 0x14
call fcn.00401000
test al, al
jne 0x401668
push 0x4032e4
push esi
jmp loc.00408000
push edi
xor ebp, ebp
push dword [esp + 0x18]
mov word [0x4032e4], bp
call fcn.00401062
pop ecx
test eax, eax
pop ecx
je 0x4016cc
push 0x104
mov esi, 0x4034e4
push 0x4036e4
push esi
call ebx
push str._notepod.exe
push esi
call dword [sym.imp.MSVCRT.dll_wcscat]
add esp, 0x14
call fcn.0040125f
test eax, eax
je 0x4016cc
push 1
push ebp
push ebp
mov edi, str.open
push esi
mov esi, dword [sym.imp.SHELL32.dll_ShellExecuteW]
push edi
push ebp
call esi
push 1
push ebp
push ebp
push 0x4032e4
push edi
push ebp
call esi
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
ret

Function at 0x40170f
Capabilities:
Terminate process

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x402088
push 0x401850
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x20
push ebx
push esi
push edi
mov dword [ebp - 0x18], esp
and dword [ebp - 4], 0
push 1
call dword [sym.imp.MSVCRT.dll___set_app_type]
pop ecx
or dword [0x403cf8], 0xffffffff
or dword [0x403cfc], 0xffffffff
call dword [sym.imp.MSVCRT.dll___p__fmode]
mov ecx, dword [0x403cf4]
mov dword [eax], ecx
call dword [sym.imp.MSVCRT.dll___p__commode]
mov ecx, dword [0x403cf0]
mov dword [eax], ecx
mov eax, dword [sym.imp.MSVCRT.dll__adjust_fdiv]
mov eax, dword [eax]
mov dword [0x403d00], eax
call fcn.00401841
cmp dword [0x4030b0], 0
jne 0x401792
push 0x40183e
call dword [sym.imp.MSVCRT.dll___setusermatherr]
pop ecx
call fcn.0040182c
push 0x40300c
push 0x403008
call sub.MSVCRT.dll__initterm
mov eax, dword [0x403cec]
mov dword [ebp - 0x28], eax
lea eax, [ebp - 0x28]
push eax
push dword [0x403ce8]
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 0x2c]
push eax
lea eax, [ebp - 0x1c]
push eax
call dword [sym.imp.MSVCRT.dll___wgetmainargs]
push 0x403004
push section..data
call sub.MSVCRT.dll__initterm
call dword [sym.imp.MSVCRT.dll___p___winitenv]
mov ecx, dword [ebp - 0x20]
mov dword [eax], ecx
push dword [ebp - 0x20]
push dword [ebp - 0x2c]
push dword [ebp - 0x1c]
call fcn.004015cf
add esp, 0x30
mov dword [ebp - 0x24], eax
push eax
call dword [sym.imp.MSVCRT.dll_exit]
mov eax, dword [ebp - 0x14]
mov ecx, dword [eax]
mov ecx, dword [ecx]
mov dword [ebp - 0x30], ecx
push eax
push ecx
call sub.MSVCRT.dll__XcptFilter
pop ecx
pop ecx
ret

Function at 0x403d61
Capabilities:
Encode data using xor

Disassembly:
push eax
push ebx
mov eax, 0x499
mov ecx, 0x404498
mov bl, byte [ecx]
sub bl, 0xf2
rol bl, 2
sub bl, cl
ror bl, 1
mov byte [ecx], bl
dec ecx
dec eax
jne 0x403d6d
mov eax, 0x261d
mov ecx, 0x403764
mov bl, byte [ecx]
rol bl, 7
ror bl, 2
sub bl, cl
xor bl, 0x91
mov byte [ecx], bl
dec ecx
dec eax
jne 0x403d8a
pop ebx
pop eax
add ecx, 0x2c1a
jmp ecx
Function at 0x100024be
Capabilities:
Encode data using xor

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
pushal
call 0x100024cd
pop dword [ebp - 8]
mov eax, 0x8bd75ba8
sub eax, 0x7bd736db
sub dword [ebp - 8], eax
mov dword [ebp - 0x18], 0x2ceb874d
sub dword [ebp - 0x18], 0xde994202
mov dword [ebp - 0x14], 0x4565615a
add dword [ebp - 0x14], 0xeccdeaeb
mov dword [ebp - 0x10], 0x96f6e6ba
sub dword [ebp - 0x10], 0x4aaaa28c
mov dword [ebp - 0xc], 0xc92e4a7e
sub dword [ebp - 0xc], 0xc92e4a7e
lea eax, [ebp - 0x18]
push eax
mov eax, sym.imp.kernel32.dll_LoadLibraryA
add eax, dword [ebp - 8]
call dword [eax]
mov dword [ebp - 0x18], 0x400d99dd
sub dword [ebp - 0x18], 0xcb9b3087
mov dword [ebp - 0x14], 0x16e9b59
sub dword [ebp - 0x14], 0xc00239e4
mov dword [ebp - 0x10], 0x8bd97e2d
sub dword [ebp - 0x10], 0x286a11c1
mov dword [ebp - 0xc], 0xa92ab8b9
add dword [ebp - 0xc], 0x56d54747
lea ebx, [ebp - 0x18]
push ebx
push eax
mov eax, 0xdd0e923c
add eax, 0x32f1ae40
add eax, dword [ebp - 8]
call dword [eax]
push 0x40
push 0x1000
push 0x38b17
push 0
call eax
mov ecx, 0x3bacee75
sub ecx, 0x3bac9de5
xor ebx, ebx
add ebx, eax
mov esi, 0x9c49d446
sub esi, 0x8c493e46
add esi, dword [ebp - 8]
mov edi, 0x4bf8f828
add dword [ebp - 4], ecx
mov edx, dword [esi]
sub dword [ebp - 4], esi
sub edx, edi
xor dword [ebp - 4], ebx
mov dword [ebx], edx
sub dword [ebp - 4], 0x78bc73d6
add ebx, 0x4cfc6b9
add ebx, 0xfb30394b
add esi, 4
loop 0x100025e6
add eax, 0x971510a8
sub eax, 0x9713db95
xor ebx, ebx
add ebx, eax
add eax, 0xe1c52cf6
add eax, 0x1e3ad30f
mov ecx, 0x10000000
add ecx, dword [ebp - 8]
call ebx
leave
ret

Function at 0x100032c8
Capabilities:
Terminate process

Disassembly:
cmp ecx, dword [0x10007040]
jne 0x100032d2
repz ret
jmp fcn.100036ab
Function at 0x4035f0
Capabilities:
Check if file exists
Create directory
Get file attributes

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x140
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
push edi
mov edi, ecx
mov byte [ebp - 0x130], 0
push 0x12b
lea eax, [ebp - 0x12f]
push 0
push eax
mov dword [edi], vtable.core_log::log_device_file.0
call sub.MSVCR120.dll_memset
add esp, 0xc
call fcn.004015de
mov ecx, eax
test ecx, ecx
je 0x4036e1
mov eax, dword [ecx]
call dword [eax + 0xc]
mov esi, eax
lea eax, [ebp - 0x140]
push eax
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
push str.c:MyLog_
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
cmp eax, 0xffffffff
je 0x403661
test al, 0x10
jne 0x40366e
push 0
push str.c:MyLog_
call dword [sym.imp.KERNEL32.dll_CreateDirectoryW]
movzx eax, word [ebp - 0x13a]
push eax
movzx eax, word [ebp - 0x13e]
push eax
movzx eax, word [ebp - 0x140]
push eax
push str.c:MyLogMyLog__d__02d__02d.log
push 0xffffffffffffffff
lea eax, [ebp - 0x130]
push 0x12c
push eax
call dword [sym.imp.MSVCR120.dll__snprintf_s]
push 0x48b5a4
lea eax, [ebp - 0x130]
push eax
lea eax, [edi + 4]
push eax
call dword [sym.imp.MSVCR120.dll_fopen_s]
add esp, 0x28
lea eax, [esi + 0xc]
or ecx, 0xffffffff
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x4036cf
mov ecx, dword [esi]
push esi
mov edx, dword [ecx]
call dword [edx + 4]
mov ecx, dword [ebp - 4]
mov eax, edi
pop edi
xor ecx, ebp
pop esi
call fcn.00452da4
mov esp, ebp
pop ebp
ret
push 0x80004005
call fcn.00403560
int3

Function at 0x403730
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
mov edi, ecx
mov eax, dword [edi + 4]
test eax, eax
je 0x40376a
push eax
push dword [ebp + 0xc]
push 1
push dword [ebp + 8]
call dword [sym.imp.MSVCR120.dll_fwrite]
push dword [edi + 4]
push 2
push 1
push 0x48b5a8
call dword [sym.imp.MSVCR120.dll_fwrite]
push dword [edi + 4]
call dword [sym.imp.MSVCR120.dll_fflush]
add esp, 0x24
pop edi
pop ebp
ret 8

Function at 0x403850
Capabilities:
Query or enumerate registry value

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xc
lea eax, [ebp - 8]
mov dword [ebp - 8], 0
push eax
push 0x20119
push 0
push str.SOFTWAREMyLogLog
push reloc.OLEAUT32.dll_SysReAllocString
mov word [0x4a5bfc], 0
call dword [sym.imp.ADVAPI32.dll_RegOpenKeyExW]
test eax, eax
jne 0x4038ff
push edi
mov dword [ebp - 4], eax
lea eax, [ebp - 0xc]
push eax
lea eax, [ebp - 4]
mov dword [ebp - 0xc], 4
push eax
push 0
push 0
push str.EnableLogToView
push dword [ebp - 8]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
mov edi, 1
test eax, eax
jne 0x4038c5
movzx eax, byte [0x4a5bfc]
cmp dword [ebp - 4], edi
cmove eax, edi
mov byte [0x4a5bfc], al
lea eax, [ebp - 0xc]
push eax
lea eax, [ebp - 4]
push eax
push 0
push 0
push str.EnableLogToFile
push dword [ebp - 8]
call dword [sym.imp.ADVAPI32.dll_RegQueryValueExW]
test eax, eax
jne 0x4038f5
movzx eax, byte [0x4a5bfd]
cmp dword [ebp - 4], edi
cmove eax, edi
mov byte [0x4a5bfd], al
push dword [ebp - 8]
call dword [sym.imp.ADVAPI32.dll_RegCloseKey]
pop edi
mov esp, ebp
pop ebp
ret
Function at 0x4051d0
Capabilities:
Create service
Modify service
Persist via windows service

Disassembly:
push ebp
mov ebp, esp
sub esp, 8
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push 2
xor ebx, ebx
mov esi, ecx
push ebx
push ebx
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov edi, eax
test edi, edi
jne 0x40520e
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00452da4
mov esp, ebp
pop ebp
ret
push 0
push 0
push 0
push 0
push 0x48b6d4
push esi
push 1
push 2
push 0x110
push 0xf01ff
push str.Light_Service
push str.LightSvr
push edi
call dword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov esi, eax
test esi, esi
jne 0x405251
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov ebx, eax
jmp 0x40526e
lea eax, [ebp - 8]
mov dword [ebp - 8], str.Light_Service_Common
push eax
push 1
push esi
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2W]
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push edi
call esi
mov ecx, dword [ebp - 4]
mov eax, ebx
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00452da4
mov esp, ebp
pop ebp
ret
Function at 0x405350
Capabilities:
Check for time delay via gettickcount
Query service status
Stop service

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x30
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push edi
mov edi, dword [sym.imp.KERNEL32.dll_GetTickCount]
call edi
push 0xf003f
push 0
push 0
mov ebx, eax
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov dword [ebp - 0x30], eax
test eax, eax
je 0x4054aa
push esi
push 0x124
push str.LightSvr
push eax
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov esi, eax
test esi, esi
jne 0x4053b8
push dword [ebp - 0x30]
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
pop esi
pop edi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00452da4
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 8]
push eax
push 0x24
lea eax, [ebp - 0x2c]
push eax
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x40549b
mov eax, dword [ebp - 0x28]
cmp eax, 1
je 0x40549b
cmp eax, 3
jne 0x40544d
mov ecx, 0x2710
lea esp, [esp]
mov eax, 0xcccccccd
mul dword [ebp - 0x14]
shr edx, 3
cmp edx, 0x3e8
jae 0x40540a
mov edx, 0x3e8
jmp 0x405413
cmp edx, 0x2710
cmova edx, ecx
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 8]
push eax
push 0x24
lea eax, [ebp - 0x2c]
push eax
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x40549b
cmp dword [ebp - 0x28], 1
je 0x40549b
call edi
sub eax, ebx
cmp eax, 0x2710
ja 0x40549b
cmp dword [ebp - 0x28], 3
mov ecx, 0x2710
je 0x4053f0
lea eax, [ebp - 0x2c]
push eax
push 1
push esi
call dword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
je 0x40549b
cmp dword [ebp - 0x28], 1
je 0x40549b
push dword [ebp - 0x14]
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 8]
push eax
push 0x24
lea eax, [ebp - 0x2c]
push eax
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x40549b
cmp dword [ebp - 0x28], 1
je 0x40549b
call edi
sub eax, ebx
cmp eax, 0x2710
ja 0x40549b
cmp dword [ebp - 0x28], 1
jne 0x405464
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push dword [ebp - 0x30]
call esi
pop esi
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop ebx
call fcn.00452da4
mov esp, ebp
pop ebp
ret
Function at 0x4054c0
Capabilities:
Query service status
Start service

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x24
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push 0x104
push str.LightSvr
push 0x4a52a0
xor ebx, ebx
call dword [sym.imp.MSVCR120.dll_wcsncpy]
add esp, 0xc
push 0xf003f
push ebx
push ebx
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov esi, eax
mov dword [ebp - 0x24], esi
test esi, esi
jne 0x405518
call dword [sym.imp.KERNEL32.dll_GetLastError]
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00452da4
mov esp, ebp
pop ebp
ret
push edi
push 0xf01ff
push str.LightSvr
push esi
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov edi, eax
test edi, edi
jne 0x405540
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov ebx, eax
jmp 0x4055a8
push 0
push 0
push edi
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
jne 0x405559
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
jmp 0x40559f
mov esi, 7
mov edi, edi
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0x20]
mov dword [ebp - 0x20], ebx
xorps xmm0, xmm0
push eax
push edi
movdqu xmmword [ebp - 0x1c], xmm0
movq qword [ebp - 0xc], xmm0
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
je 0x405594
cmp dword [ebp - 0x1c], 4
je 0x40559c
dec esi
test esi, esi
jg 0x405560
jmp 0x40559c
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
mov esi, dword [ebp - 0x24]
push edi
mov edi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call edi
push esi
call edi
mov ecx, dword [ebp - 4]
mov eax, ebx
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00452da4
mov esp, ebp
pop ebp
ret
Function at 0x4059a0
Capabilities:
Check if file exists
Create service
Modify service
Persist via windows service
Start service

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x80c
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push 0xf003f
push 0
push 0
mov edi, edx
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov ebx, eax
test ebx, ebx
jne 0x4059f3
push str.LaunchService_OpenSCManager_FAILED
push eax
push str.ServiceProvider.cpp
call fcn.00404060
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00452da4
mov esp, ebp
pop ebp
ret
push 0xf01ff
push str.LightSvr
push ebx
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov esi, eax
test esi, esi
jne 0x405ad4
push edi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x405aa5
xor eax, eax
push 0x7fe
push eax
mov word [ebp - 0x808], ax
lea eax, [ebp - 0x806]
push eax
call sub.MSVCR120.dll_memset
push 0x48a240
push edi
push str.__s___s
lea eax, [ebp - 0x808]
push 0xffffffffffffffff
push eax
call fcn.00405b20
add esp, 0x20
lea eax, [ebp - 0x808]
push esi
push esi
push esi
push esi
push 0x48b6d4
push eax
push 1
push 2
push 0x110
push 0xf01ff
push str.Light_Service
push str.LightSvr
push ebx
call dword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov esi, eax
test esi, esi
je 0x405aba
lea eax, [ebp - 0x80c]
mov dword [ebp - 0x80c], str.Light_Service_Common
push eax
push 1
push esi
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2W]
jmp 0x405ae8
push edi
push str.LaunchService_FILE_is_Not_Exist_lpSvrExe__s
push 0
push str.ServiceProvider.cpp
call fcn.00404060
add esp, 0x10
push ebx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00452da4
mov esp, ebp
pop ebp
ret
push str.LaunchService_OpenService_OK
push 0
push str.ServiceProvider.cpp
call fcn.00404060
add esp, 0xc
push 0
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
neg eax
sbb edi, edi
neg edi
call dword [sym.imp.KERNEL32.dll_GetLastError]
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push ebx
call esi
mov ecx, dword [ebp - 4]
mov eax, edi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00452da4
mov esp, ebp
pop ebp
ret
Function at 0x4063a0
Capabilities:
Get common file path

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x22c
mov eax, dword [section..data]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [0x4a5c28]
mov dword [ebp - 0x214], 0
push esi
mov esi, ecx
test al, 1
jne 0x4063fa
or eax, 1
mov dword [0x4a5c24], 7
mov dword [0x4a5c28], eax
xor eax, eax
push 0x481aa0
mov dword [0x4a5c20], 0
mov word [0x4a5c10], ax
call fcn.00452ee9
add esp, 4
cmp dword [0x4a5c20], 0
jne 0x4064a4
xor eax, eax
push 0x206
push eax
mov word [ebp - 0x210], ax
lea eax, [ebp - 0x20e]
push eax
call sub.MSVCR120.dll_memset
add esp, 0xc
lea eax, [ebp - 0x210]
push eax
push 0x104
call dword [sym.imp.KERNEL32.dll_GetTempPathW]
cmp word [ebp - 0x210], 0
jne 0x406445
xor ecx, ecx
jmp 0x40645f
lea ecx, [ebp - 0x210]
lea edx, [ecx + 2]
mov edi, edi
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x406450
sub ecx, edx
sar ecx, 1
push ecx
lea eax, [ebp - 0x210]
mov ecx, 0x4a5c10
push eax
call fcn.0040235a
mov edx, 0x4a5c10
lea ecx, [ebp - 0x22c]
call fcn.00406020
push eax
mov ecx, 0x4a5c10
call fcn.004064e0
cmp dword [ebp - 0x218], 8
jb 0x4064a4
push dword [ebp - 0x22c]
call dword [sym.imp.MSVCR120.dll_void___cdecl_operator_delete_void__]
add esp, 4
xor eax, eax
mov dword [esi + 0x14], 7
push 0xffffffffffffffff
push eax
mov dword [esi + 0x10], 0
mov ecx, esi
push 0x4a5c10
mov word [esi], ax
call fcn.004022c7
mov ecx, dword [ebp - 4]
mov eax, esi
xor ecx, ebp
pop esi
call fcn.00452da4
mov esp, ebp
pop ebp
ret

Function at 0x40c7a0
Capabilities:
Check if file exists
Get file attributes

Disassembly:
push ecx
call dword [sym.imp.KERNEL32.dll_GetFileAttributesW]
xor ecx, ecx
cmp eax, 0xffffffff
setne cl
mov eax, ecx
ret

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

Disassembly:
push ebp
mov ebp, esp
sub esp, 8
push ebx
push esi
push 0
mov dword [ebp - 8], edx
mov esi, ecx
call dword [sym.imp.KERNEL32.dll_SetLastError]
push 0
push 0x80
push 3
push 0
push 1
push SysReAllocString
push esi
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, eax
cmp ebx, 0xffffffff
jne 0x40c7fd
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
push edi
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov esi, eax
cmp esi, 0xffffffff
je 0x40c833
test esi, esi
je 0x40c833
push 0x4a3b45
push esi
mov dword [ebp - 4], 0
call fcn.004534b6
mov edi, eax
add esp, 8
test edi, edi
jne 0x40c843
call dword [sym.imp.KERNEL32.dll_GetLastError]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret
push esi
push 0
push edi
call sub.MSVCR120.dll_memset
add esp, 0xc
lea eax, [ebp - 4]
push 0
push eax
push esi
push edi
push ebx
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x40c867
cmp dword [ebp - 4], esi
je 0x40c875
push edi
call dword [sym.imp.MSVCR120.dll_void___cdecl_operator_delete___void__]
add esp, 4
xor edi, edi
xor esi, esi
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 8]
mov dword [eax], edi
mov eax, esi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret