Function at 0x401590
Capabilities:
Accept command line arguments
Access pe header
Access peb ldr_data
Create process on windows
Create process suspended
Get process heap flags
Get process heap force flags
Get system information on windows
Terminate process

Disassembly:
push ebp
mov ecx, 0x11
mov ebp, esp
push edi
push esi
lea edi, [ebp - 0x384]
push ebx
movzx ebx, ax
xor eax, eax
sub esp, 0x3d8
mov dword [ebp - 0x3b0], 0
rep stosd dword es:[edi], eax
lea eax, [ebp - 0x3a4]
mov dword [esp + 0x14], 0
mov dword [esp + 0xc], eax
lea eax, [ebp - 0x3b0]
mov dword [esp + 0x10], 0x20
mov dword [esp + 8], 4
mov dword [esp + 4], eax
mov dword [esp], 0xb5
call dword [sym.imp.ntdll.dll_NtQuerySystemInformationEx]
movzx eax, word [ebp - 0x3a4]
sub esp, 0x18
test ax, ax
je 0x40164f
xor edx, edx
jmp 0x401618
add edx, 1
movzx eax, word [ebp + edx*4 - 0x3a4]
test ax, ax
je 0x40164f
cmp bx, ax
jne 0x401608
test byte [ebp + edx*4 - 0x3a2], 4
mov eax, 1
mov dword [esp + 4], 0x104
cmovne ebx, eax
lea eax, [ebp - 0x214]
mov dword [esp], eax
mov dword [esp + 8], ebx
call dword [sym.imp.kernelbase.dll_GetSystemWow64Directory2W]
sub esp, 0xc
test eax, eax
jne 0x401660
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
lea eax, [ebp - 0x214]
mov dword [esp + 4], str._regsvr32.exe
mov dword [esp], eax
mov eax, dword [sym.imp.ucrtbase.dll_wcscat]
mov dword [ebp - 0x3bc], eax
call eax
lea eax, [ebp - 0x340]
mov dword [ebp - 0x3b8], eax
test byte [section..data], 8
jne 0x401860
call dword [sym.imp.kernelbase.dll_GetCommandLineW]
mov ebx, eax
movzx eax, word [eax]
test ax, 0xffdf
je 0x401704
cmp ax, 9
je 0x401704
xor ecx, ecx
xor edi, edi
mov dword [ebp - 0x3b4], ecx
lea esi, [esi]
nop
cmp ax, 0x5c
je 0x401838
cmp ax, 0x22
je 0x401848
mov dword [ebp - 0x3b4], 0
movzx eax, word [ebx + 2]
add ebx, 2
test ax, ax
je 0x401704
cmp ax, 9
sete dl
cmp ax, 0x20
sete cl
or dl, cl
je 0x4016c0
test edi, 1
jne 0x4016c0
lea eax, [ebp - 0x214]
mov edi, dword [sym.imp.ucrtbase.dll_wcslen]
mov dword [esp], eax
call edi
mov dword [esp], ebx
mov esi, eax
call edi
mov dword [esp + 4], 0
lea eax, [esi + eax + 1]
add eax, eax
mov dword [esp + 8], eax
mov edi, dword fs:[0x18]
mov eax, dword [edi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernelbase.dll_HeapAlloc]
sub esp, 0xc
mov esi, eax
lea eax, [ebp - 0x214]
mov dword [esp + 4], eax
mov dword [esp], esi
call dword [sym.imp.ucrtbase.dll_wcscpy]
mov dword [esp + 4], ebx
mov eax, dword [ebp - 0x3bc]
mov dword [esp], esi
call eax
lea eax, [ebp - 0x3ac]
mov dword [ebp - 0x384], 0x44
mov dword [esp], eax
call dword [sym.imp.kernelbase.dll_Wow64DisableWow64FsRedirection]
mov eax, dword [ebp - 0x3b8]
sub esp, 4
mov dword [esp + 0x24], eax
lea eax, [ebp - 0x384]
mov dword [esp + 0x20], eax
lea eax, [ebp - 0x214]
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], esi
mov dword [esp], eax
call dword [sym.imp.kernelbase.dll_CreateProcessW]
sub esp, 0x28
test eax, eax
jne 0x401abc
test byte [section..data], 8
jne 0x4019a0
mov eax, dword [ebp - 0x3ac]
mov dword [esp], eax
call dword [sym.imp.kernelbase.dll_Wow64RevertWow64FsRedirection]
sub esp, 4
mov dword [esp + 8], esi
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernelbase.dll_HeapFree]
sub esp, 0xc
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
add dword [ebp - 0x3b4], 1
jmp 0x4016de
and dword [ebp - 0x3b4], 1
jne 0x4016d4
xor edi, 1
jmp 0x4016de
lea eax, [ebp - 0x214]
shr eax, 0x10
je 0x401a69
lea eax, [ebp - 0x214]
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov ecx, eax
sub esp, 8
mov eax, str._invalid_
test ecx, ecx
jne 0x401973
movzx eax, word [ebp - 0x214]
test ax, ax
je 0x401a9b
lea esi, [esi]
nop
mov edx, ecx
lea ecx, [ecx + 1]
cmp word [ebp + edx*2 - 0x212], 0
jne 0x4018b0
mov ecx, 0x224c
lea esi, [ebp - 0x214]
lea edi, [ebp - 0x21e]
mov word [ebp - 0x340], cx
lea ecx, [ebp - 0x33e]
jmp 0x401910
cmp ax, 9
je 0x401a58
cmp ax, 0xa
jne 0x4019ee
mov eax, 0x6e5c
add ecx, 2
mov word [ecx - 2], ax
lea ebx, [edx - 1]
test edx, edx
jle 0x401941
cmp ecx, edi
ja 0x401941
movzx eax, word [esi]
mov edx, ebx
add esi, 2
cmp ax, 0xd
je 0x4019d0
jbe 0x4018e0
cmp ax, 0x22
je 0x401a40
cmp ax, 0x5c
jne 0x4019e1
mov eax, 0x5c5c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x401900
mov byte [ecx], 0x22
test ebx, ebx
jle 0x401ab4
mov edi, 0x2e2e
mov byte [ecx + 3], 0x2e
lea eax, [ecx + 4]
mov word [ecx + 1], di
mov byte [eax], 0
lea eax, [ebp - 0x340]
mov dword [esp], eax
mov dword [ebp - 0x3b8], eax
call fcn.004028d0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.restarting_as__s_n
mov dword [esp + 8], 0x405108
mov dword [esp + 4], 0x403000
mov dword [esp], 3
call fcn.004010c0
jmp 0x401697
mov eax, dword [edi + 0x34]
mov dword [esp + 0xc], str.failed_to_restart__err_ld_n
mov dword [esp + 8], 0x405108
mov dword [esp + 0x10], eax
mov dword [esp + 4], 0x403000
mov dword [esp], 3
call fcn.004010c0
jmp 0x4017f6
mov eax, 0x725c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x401900
lea ebx, [eax - 0x20]
cmp bx, 0x5e
jbe 0x401a91
mov ebx, eax
mov byte [ecx], 0x5c
add ecx, 5
shr bx, 0xc
movzx ebx, bx
movzx ebx, byte [ebx + str.0123456789abcdefreexec_self]
mov byte [ecx - 4], bl
mov ebx, eax
shr bx, 8
and ebx, 0xf
movzx ebx, byte [ebx + str.0123456789abcdefreexec_self]
mov byte [ecx - 3], bl
mov ebx, eax
and eax, 0xf
shr bx, 4
movzx eax, byte [eax + str.0123456789abcdefreexec_self]
and ebx, 0xf
movzx ebx, byte [ebx + str.0123456789abcdefreexec_self]
mov byte [ecx - 1], al
mov byte [ecx - 2], bl
jmp 0x401900
mov eax, 0x225c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x401900
mov eax, 0x745c
add ecx, 2
mov word [ecx - 2], ax
jmp 0x401900
lea eax, [ebp - 0x214]
mov dword [esp], str._04x
mov dword [ebp - 0x3b4], eax
movzx eax, word [ebp - 0x3b4]
mov dword [esp + 4], eax
call fcn.00401000
jmp 0x401973
mov byte [ecx], al
add ecx, 1
jmp 0x401900
mov eax, 0x224c
mov byte [ebp - 0x33e], 0x22
lea ecx, [ebp - 0x33e]
mov word [ebp - 0x340], ax
lea eax, [ecx + 1]
jmp 0x40195c
mov eax, dword [ebp - 0x340]
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call dword [sym.imp.kernelbase.dll_WaitForSingleObject]
lea eax, [ebp - 0x3a8]
push ebx
push ebx
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x340]
mov dword [esp], eax
call dword [sym.imp.kernelbase.dll_GetExitCodeProcess]
mov eax, dword [ebp - 0x3a8]
push esi
push esi
mov dword [esp], eax
call dword [sym.imp.kernelbase.dll_ExitProcess]