Function at 0x40b646
Capabilities:
Create process on windows
Get comspec environment variable
Move file
Query environment variable
Self delete
Write and execute a file
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x524
mov eax, dword [0x456178]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
xor eax, eax
mov esi, 0x208
push esi
mov word [ebp - 0x218], ax
xor ebx, ebx
lea eax, [ebp - 0x216]
mov edi, ecx
push ebx
push eax
call fcn.004344f0
add esp, 0xc
xor eax, eax
mov word [ebp - 0x428], ax
lea eax, [ebp - 0x426]
push esi
push ebx
push eax
call fcn.004344f0
add esp, 0xc
lea eax, [ebp - 0x218]
mov esi, 0x104
push esi
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
je 0x40bb5d
push esi
lea eax, [ebp - 0x428]
push eax
push str.COMSPEC
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableW]
test eax, eax
je 0x40bb5d
lea ecx, [ebp - 0x4bc]
call fcn.004031be
xor eax, eax
mov dword [ebp - 0x448], ebx
push 7
pop esi
mov word [ebp - 0x458], ax
lea ecx, [ebp - 0x4bc]
lea eax, [ebp - 0x458]
mov dword [ebp - 0x444], esi
push eax
lea eax, [ebp - 0x4a0]
push eax
call fcn.0040f310
test al, al
jne 0x40b718
push ebx
push 1
jmp 0x40bb47
push str..bat
lea edx, [ebp - 0x458]
lea ecx, [ebp - 0x440]
call fcn.00401ed5
cmp dword [ebp - 0x42c], 8
lea eax, [ebp - 0x458]
pop ecx
lea ecx, [ebp - 0x440]
cmovae ecx, dword [ebp - 0x440]
cmp dword [ebp - 0x444], 8
push ecx
cmovae eax, dword [ebp - 0x458]
push eax
call fcn.00434c2f
pop ecx
pop ecx
test eax, eax
je 0x40b77b
push ebx
xor ebx, ebx
lea ecx, [ebp - 0x440]
inc ebx
push ebx
call fcn.00401751
xor esi, esi
jmp 0x40bb45
mov dword [ebp - 0x45c], esi
xor eax, eax
mov esi, str.if_not_exist__
mov byte [ebp - 0x4bc], bl
push esi
mov dword [ebp - 0x460], ebx
mov word [ebp - 0x470], ax
call fcn.0043402b
pop ecx
push eax
push esi
lea ecx, [ebp - 0x470]
call fcn.004021eb
cmp word [ebp - 0x218], bx
jne 0x40b7bc
mov eax, ebx
jmp 0x40b7c9
lea eax, [ebp - 0x218]
push eax
call fcn.0043402b
pop ecx
push eax
lea eax, [ebp - 0x218]
push eax
lea ecx, [ebp - 0x470]
call fcn.004021eb
mov esi, str.___del__0___else__ping_127.0.0.1__n_2del__
push esi
call fcn.0043402b
pop ecx
push eax
push esi
lea ecx, [ebp - 0x470]
call fcn.004021eb
cmp word [ebp - 0x218], bx
jne 0x40b802
mov eax, ebx
jmp 0x40b80f
lea eax, [ebp - 0x218]
push eax
call fcn.0043402b
pop ecx
push eax
lea eax, [ebp - 0x218]
push eax
lea ecx, [ebp - 0x470]
call fcn.004021eb
mov esi, str.__0_
push esi
call fcn.0043402b
pop ecx
push eax
push esi
lea ecx, [ebp - 0x470]
call fcn.004021eb
lea ecx, [ebp - 0x4d8]
call fcn.00412250
sub esp, 0x10
lea eax, [ebp - 0x440]
lea ecx, [ebp - 0x4d8]
push eax
call fcn.004122f0
test al, al
jne 0x40b881
lea ecx, [ebp - 0x4d8]
call fcn.004122c0
push ebx
xor ebx, ebx
lea ecx, [ebp - 0x470]
inc ebx
push ebx
call fcn.00401751
xor esi, esi
jmp 0x40bb38
push ecx
lea edx, [ebp - 0x470]
lea ecx, [ebp - 0x488]
call fcn.00412210
mov esi, dword [ebp - 0x478]
pop ecx
lea ecx, [ebp - 0x488]
test esi, esi
je 0x40bb14
cmp dword [ebp - 0x474], 0x10
mov eax, dword [ebp - 0x4d8]
cmovae ecx, dword [ebp - 0x488]
mov dword [ebp - 0x4dc], ebx
test eax, eax
je 0x40bb0e
test ecx, ecx
je 0x40bb0e
cmp dword [eax], 0xffffffff
je 0x40bb0e
push ebx
lea edx, [ebp - 0x4dc]
push edx
push esi
push ecx
push dword [eax]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x40bb0e
cmp esi, dword [ebp - 0x4dc]
jne 0x40bb0e
lea ecx, [ebp - 0x4d8]
call fcn.00412330
test al, al
je 0x40bb0e
push 0x3c
pop esi
push esi
lea eax, [ebp - 0x520]
push ebx
push eax
call fcn.004344f0
add esp, 0xc
mov dword [ebp - 0x520], esi
lea eax, [ebp - 0x440]
mov dword [ebp - 0x514], str.Open
mov edx, str._c__
lea ecx, [ebp - 0x4d4]
push eax
call fcn.00404c52
pop ecx
push eax
lea ecx, [ebp - 0x440]
call fcn.00401e84
push ebx
xor ebx, ebx
lea ecx, [ebp - 0x4d4]
inc ebx
push ebx
call fcn.00401751
mov esi, 0x449818
push esi
call fcn.0043402b
pop ecx
push eax
push esi
lea ecx, [ebp - 0x440]
call fcn.004021eb
cmp dword [ebp - 0x42c], 8
lea eax, [ebp - 0x440]
mov dword [ebp - 0x51c], 0x8040
cmovae eax, dword [ebp - 0x440]
xor esi, esi
mov dword [ebp - 0x504], esi
lea esi, [edi + 0x2e0]
mov dword [ebp - 0x50c], eax
mov ecx, esi
lea eax, [ebp - 0x428]
mov dword [ebp - 0x510], eax
call fcn.00408668
mov ecx, esi
call fcn.00408664
mov dword [ebp - 0x4e0], eax
xor edi, edi
push 0x18
pop esi
mov ecx, dword [eax]
mov eax, dword [eax + 4]
sub eax, ecx
mov dword [ebp - 0x4e4], esi
cdq
idiv esi
test eax, eax
je 0x40ba1a
mov ebx, dword [ebp - 0x4e0]
xor esi, esi
add ecx, esi
call fcn.004123f0
mov ecx, dword [ebx]
inc edi
push 0x18
pop eax
add esi, eax
mov eax, dword [ebx + 4]
sub eax, ecx
cdq
idiv dword [ebp - 0x4e4]
cmp edi, eax
jb 0x40b9f8
xor ebx, ebx
inc ebx
lea eax, [ebp - 0x520]
push eax
call dword [sym.imp.SHELL32.dll_ShellExecuteExW]
test eax, eax
jne 0x40ba66
push eax
push ebx
lea ecx, [ebp - 0x488]
call fcn.00401598
lea ecx, [ebp - 0x4d8]
call fcn.004122c0
push 0
push ebx
lea ecx, [ebp - 0x470]
call fcn.00401751
push 0
push ebx
lea ecx, [ebp - 0x440]
call fcn.00401751
push 0
jmp 0x40bb46
mov esi, dword [sym.imp.KERNEL32.dll_SetPriorityClass]
push 0x40
push dword [ebp - 0x4e8]
call esi
test eax, eax
jne 0x40ba99
xor esi, esi
lea ecx, [ebp - 0x488]
push esi
push ebx
call fcn.00401598
lea ecx, [ebp - 0x4d8]
call fcn.004122c0
jmp 0x40bb2b
push 0x100
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call esi
test eax, eax
je 0x40ba7a
push 0xf
call dword [sym.imp.KERNEL32.dll_GetCurrentThread]
push eax
call dword [sym.imp.KERNEL32.dll_SetThreadPriority]
xor esi, esi
lea ecx, [ebp - 0x488]
push esi
push ebx
test eax, eax
je 0x40ba84
call fcn.00401598
lea ecx, [ebp - 0x4d8]
call fcn.004122c0
push esi
push ebx
lea ecx, [ebp - 0x470]
call fcn.00401751
push esi
push ebx
lea ecx, [ebp - 0x440]
call fcn.00401751
push esi
push ebx
lea ecx, [ebp - 0x458]
call fcn.00401751
lea ecx, [ebp - 0x4bc]
call fcn.0040f180
mov al, bl
jmp 0x40bb5f
lea ecx, [ebp - 0x488]
push ebx
xor ebx, ebx
inc ebx
push ebx
call fcn.00401598
lea ecx, [ebp - 0x4d8]
call fcn.004122c0
xor esi, esi
push esi
push ebx
lea ecx, [ebp - 0x470]
call fcn.00401751
push esi
push ebx
lea ecx, [ebp - 0x440]
call fcn.00401751
push esi
push ebx
lea ecx, [ebp - 0x458]
call fcn.00401751
lea ecx, [ebp - 0x4bc]
call fcn.0040f180
xor al, al
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004332ea
mov esp, ebp
pop ebp
ret