Function at 0x40d450
Capabilities:
Check if file exists
Create process on windows
Create process suspended
Write and execute a file
Write file on windows

Disassembly:
push 0xffffffffffffffff
push 0x45907e
mov eax, dword fs:[0]
push eax
sub esp, 0x4a4
mov eax, dword [0x46e3d0]
xor eax, esp
mov dword [esp + 0x4a0], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x46e3d0]
xor eax, esp
push eax
lea eax, [esp + 0x4b8]
mov dword fs:[0], eax
mov esi, ecx
xor ebx, ebx
xor ebp, ebp
cmp esi, ebx
mov dword [esp + 0x34], ebp
je 0x40d9ae
push esi
call dword [sym.imp.SHLWAPI.dll_PathFileExistsW]
test eax, eax
je 0x40d9ae
push esi
call dword [sym.imp.SHLWAPI.dll_PathIsDirectoryW]
test eax, eax
jne 0x40d9ae
mov eax, dword [0x470ce4]
mov edx, dword [eax + 0xc]
mov ecx, 0x470ce4
call edx
add eax, 0x10
mov dword [esp + 0x38], eax
lea ecx, [esp + 0x38]
mov dword [esp + 0x4c0], ebx
call fcn.0040d140
cmp eax, ebx
je 0x40d983
mov eax, dword [0x470ce4]
mov edx, dword [eax + 0xc]
mov ecx, 0x470ce4
call edx
add eax, 0x10
mov dword [esp + 0x14], eax
mov byte [esp + 0x4c0], 1
mov eax, dword [esp + 0x38]
push esi
push eax
push str.__s____s__RunDll__action:install
lea edi, [esp + 0x20]
call fcn.0040f5c0
mov eax, dword [esp + 0x20]
mov ebp, dword [eax - 0xc]
add esp, 0xc
push eax
push str.strCmdLine___s_n
push 0x400
lea ecx, [esp + 0xc0]
push 0x200
push ecx
call fcn.0043ef21
add esp, 0x14
lea ecx, [esp + 0x98]
call fcn.0042a750
mov byte [esp + 0x4c0], 2
mov edi, 7
lea eax, [esp + 0xb4]
mov dword [esp + 0x30], edi
mov dword [esp + 0x2c], ebx
mov word [esp + 0x1c], bx
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x40d575
sub eax, edx
sar eax, 1
push eax
lea edx, [esp + 0xb8]
push edx
lea esi, [esp + 0x20]
call fcn.00406f20
mov eax, esi
push ebx
push eax
or eax, 0xffffffff
lea esi, [esp + 0xa0]
mov byte [esp + 0x4c8], 3
call fcn.00406d90
mov esi, 8
cmp dword [esp + 0x30], esi
jb 0x40d5c9
mov ecx, dword [esp + 0x1c]
push ecx
call fcn.0043ef40
add esp, 4
cmp dword [esp + 0xb0], esi
mov edx, dword [esp + 0x9c]
mov dword [esp + 0x30], edi
mov dword [esp + 0x2c], ebx
mov word [esp + 0x1c], bx
jae 0x40d5ed
lea edx, [esp + 0x9c]
mov edi, dword [0x471b30]
cmp edi, ebx
je 0x40d62f
mov eax, edx
lea esi, [eax + 2]
lea esp, [esp]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x40d600
sub eax, esi
sar eax, 1
push edi
add eax, eax
push eax
push 1
push edx
call fcn.0043fe21
mov ecx, dword [0x471b30]
push ecx
call fcn.004402ef
add esp, 0x14
mov esi, 8
mov byte [esp + 0x4c0], 1
cmp dword [esp + 0xb0], esi
jb 0x40d650
mov edx, dword [esp + 0x9c]
push edx
call fcn.0043ef40
add esp, 4
push 0x40
lea eax, [esp + 0x54]
push ebx
push eax
call fcn.00443e10
or dword [esp + 0x84], 0x80
mov esi, dword [esp + 0x20]
xor eax, eax
mov dword [esp + 0x4c], eax
mov dword [esp + 0x50], eax
mov dword [esp + 0x54], eax
mov dword [esp + 0x58], 0x44
mov dword [esp + 0x60], str.Winsta0default
mov dword [esp + 0x48], ebx
mov eax, dword [esi - 8]
mov edx, 1
sub edx, dword [esi - 4]
lea ecx, [ebp + 0xa]
sub eax, ecx
add esp, 0xc
or eax, edx
jge 0x40d6b2
lea eax, [esp + 0x14]
call fcn.0040eef0
mov esi, dword [esp + 0x14]
lea ecx, [esp + 0x3c]
push ecx
lea edx, [esp + 0x50]
push edx
push ebx
push ebx
push ebx
push ebx
push ebx
push ebx
push esi
push ebx
call dword [sym.imp.KERNEL32.dll_CreateProcessW]
mov ebp, eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
lea edi, [esp + 0x14]
mov esi, eax
call fcn.0040ec20
push esi
push ebp
push str.CreateProcess__._bOk___ld__dwLastError___lu_n
push 0x400
lea eax, [esp + 0xc4]
push 0x200
push eax
call fcn.0043ef21
add esp, 0x18
lea ecx, [esp + 0x98]
call fcn.0042a750
mov byte [esp + 0x4c0], 4
mov edi, 7
lea eax, [esp + 0xb4]
mov dword [esp + 0x30], edi
mov dword [esp + 0x2c], ebx
mov word [esp + 0x1c], bx
lea edx, [eax + 2]
mov edi, edi
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x40d730
sub eax, edx
sar eax, 1
push eax
lea ecx, [esp + 0xb8]
push ecx
lea esi, [esp + 0x20]
call fcn.00406f20
mov edx, esi
push ebx
push edx
or eax, 0xffffffff
lea esi, [esp + 0xa0]
mov byte [esp + 0x4c8], 5
call fcn.00406d90
mov esi, 8
cmp dword [esp + 0x30], esi
jb 0x40d784
mov eax, dword [esp + 0x1c]
push eax
call fcn.0043ef40
add esp, 4
cmp dword [esp + 0xb0], esi
mov edx, dword [esp + 0x9c]
mov dword [esp + 0x30], edi
mov dword [esp + 0x2c], ebx
mov word [esp + 0x1c], bx
jae 0x40d7a8
lea edx, [esp + 0x9c]
mov edi, dword [0x471b30]
cmp edi, ebx
je 0x40d7e2
mov eax, edx
lea esi, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x40d7b7
sub eax, esi
sar eax, 1
push edi
lea ecx, [eax + eax]
push ecx
push 1
push edx
call fcn.0043fe21
mov edx, dword [0x471b30]
push edx
call fcn.004402ef
add esp, 0x14
mov byte [esp + 0x4c0], 1
cmp dword [esp + 0xb0], 8
jb 0x40d804
mov eax, dword [esp + 0x9c]
push eax
call fcn.0043ef40
add esp, 4
cmp ebp, ebx
je 0x40d958
mov ecx, dword [esp + 0x48]
mov edx, dword [esp + 0x44]
push ecx
push edx
push str.SubProcess_PID___lu__TID___lu_n
push 0x400
lea eax, [esp + 0xc4]
push 0x200
push eax
call fcn.0043ef21
add esp, 0x18
lea ecx, [esp + 0x98]
call fcn.0042a750
mov byte [esp + 0x4c0], 6
mov edi, 7
lea eax, [esp + 0xb4]
mov dword [esp + 0x30], edi
mov dword [esp + 0x2c], ebx
mov word [esp + 0x1c], bx
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x40d865
sub eax, edx
sar eax, 1
push eax
lea ecx, [esp + 0xb8]
push ecx
lea esi, [esp + 0x20]
call fcn.00406f20
mov edx, esi
push ebx
push edx
or eax, 0xffffffff
lea esi, [esp + 0xa0]
mov byte [esp + 0x4c8], 7
call fcn.00406d90
mov ebp, 8
cmp dword [esp + 0x30], ebp
jb 0x40d8b9
mov eax, dword [esp + 0x1c]
push eax
call fcn.0043ef40
add esp, 4
cmp dword [esp + 0xb0], ebp
mov edx, dword [esp + 0x9c]
mov dword [esp + 0x30], edi
mov dword [esp + 0x2c], ebx
mov word [esp + 0x1c], bx
jae 0x40d8dd
lea edx, [esp + 0x9c]
mov edi, dword [0x471b30]
cmp edi, ebx
je 0x40d91b
mov eax, edx
lea esi, [eax + 2]
lea esp, [esp]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x40d8f0
sub eax, esi
sar eax, 1
push edi
lea ecx, [eax + eax]
push ecx
push 1
push edx
call fcn.0043fe21
mov edx, dword [0x471b30]
push edx
call fcn.004402ef
add esp, 0x14
mov byte [esp + 0x4c0], 1
cmp dword [esp + 0xb0], ebp
jb 0x40d93c
mov eax, dword [esp + 0x9c]
push eax
call fcn.0043ef40
add esp, 4
mov ecx, dword [esp + 0x40]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
push ecx
mov dword [esp + 0x38], 1
call esi
mov edx, dword [esp + 0x3c]
push edx
call esi
mov byte [esp + 0x4c0], bl
mov eax, dword [esp + 0x14]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d97f
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov ebp, dword [esp + 0x34]
mov dword [esp + 0x4c0], 0xffffffff
mov eax, dword [esp + 0x38]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40d9ae
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
push ebp
push str.bSuc___ld_n
push 0x400
lea ecx, [esp + 0xc0]
push 0x200
push ecx
call fcn.0043ef21
add esp, 0x14
lea ecx, [esp + 0x98]
call fcn.0042a750
mov dword [esp + 0x4c0], 8
mov edi, 7
lea eax, [esp + 0xb4]
mov dword [esp + 0x30], edi
mov dword [esp + 0x2c], ebx
mov word [esp + 0x1c], bx
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x40da01
sub eax, edx
sar eax, 1
push eax
lea edx, [esp + 0xb8]
push edx
lea esi, [esp + 0x20]
call fcn.00406f20
mov eax, esi
push ebx
push eax
or eax, 0xffffffff
lea esi, [esp + 0xa0]
mov byte [esp + 0x4c8], 9
call fcn.00406d90
mov esi, 8
cmp dword [esp + 0x30], esi
jb 0x40da55
mov ecx, dword [esp + 0x1c]
push ecx
call fcn.0043ef40
add esp, 4
cmp dword [esp + 0xb0], esi
mov edx, dword [esp + 0x9c]
mov dword [esp + 0x30], edi
mov dword [esp + 0x2c], ebx
mov word [esp + 0x1c], bx
jae 0x40da79
lea edx, [esp + 0x9c]
mov edi, dword [0x471b30]
cmp edi, ebx
je 0x40dabf
mov eax, edx
lea esi, [eax + 2]
jmp 0x40da90
mov cx, word [eax]
add eax, 2
cmp cx, bx
jne 0x40da90
sub eax, esi
sar eax, 1
push edi
add eax, eax
push eax
push 1
push edx
call fcn.0043fe21
mov ecx, dword [0x471b30]
push ecx
call fcn.004402ef
add esp, 0x14
mov esi, 8
cmp dword [esp + 0xb0], esi
jb 0x40dad8
mov edx, dword [esp + 0x9c]
push edx
call fcn.0043ef40
add esp, 4
mov eax, ebp
mov ecx, dword [esp + 0x4b8]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0x4a0]
xor ecx, esp
call fcn.0043ef12
add esp, 0x4b0
ret