Function at 0x513800
Capabilities:
Create process on windows
Resolve function by parsing pe exports

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0x25c
mov eax, dword [esp + 0x270]
and eax, 7
cmp eax, 5
jae 0x5138e4
mov edi, dword [esp + 0x274]
movsx eax, byte [edi]
lea ecx, [eax - 0x20]
cmp eax, 0x60
cmovbe ecx, eax
add ecx, 0xffffffbf
cmp ecx, 0x19
ja 0x51383e
cmp byte [edi + 1], 0x3a
je 0x51386a
mov dword [esp], edi
mov dword [esp + 4], 0x2f
call fcn.00511b08
test eax, eax
jne 0x51386a
mov dword [esp], edi
mov dword [esp + 4], 0x5c
call fcn.00511b08
test eax, eax
je 0x513a9b
xor ebx, ebx
mov dword [esp], edi
mov dword [esp + 4], 0x5c
call fcn.00511d48
test eax, eax
lea eax, [eax + 1]
cmove eax, edi
mov dword [esp], eax
mov dword [esp + 4], 0x2e
call fcn.00511d48
mov esi, eax
mov dword [esp + 4], edi
lea ebp, [esp + 0x54]
mov dword [esp], ebp
call fcn.00507aa0
test esi, esi
je 0x5138f9
test ebx, ebx
je 0x513944
lea eax, [esp + 0x158]
mov dword [esp + 8], eax
lea eax, [esp + 0x54]
mov dword [esp], eax
mov dword [esp + 4], 0x5227da
call fcn.00513648
cmp byte [esp + 0x158], 0
jne 0x513975
jmp 0x513e63
call fcn.0051257c
mov dword [eax], 0x13
mov ebx, 0xffffffff
jmp 0x513f1b
mov dword [esp], ebp
call fcn.00507aec
mov byte [esp + eax + 0x58], 0
mov dword [esp + eax + 0x54], 0x4558452e
test ebx, ebx
je 0x5139aa
lea eax, [esp + 0x158]
mov dword [esp + 8], eax
mov dword [esp], ebp
mov dword [esp + 4], 0x5227da
call fcn.00513648
cmp byte [esp + 0x158], 0
jne 0x513a2c
jmp 0x5139d1
lea eax, [esp + 0x54]
mov edi, eax
mov dword [esp + 4], edi
lea eax, [esp + 0x158]
mov dword [esp], eax
call fcn.00507aa0
mov dword [esp], edi
mov dword [esp + 4], 4
call fcn.0050b3dc
test eax, eax
jne 0x513e63
mov dword [esp], esi
mov dword [esp + 4], str..BAT
call fcn.00511bac
test eax, eax
je 0x513e16
mov dword [esp], esi
mov dword [esp + 4], str..CMD
call fcn.00511bac
test eax, eax
jne 0x513a2c
jmp 0x513e16
mov dword [esp + 4], ebp
lea eax, [esp + 0x158]
mov dword [esp], eax
call fcn.00507aa0
mov dword [esp], ebp
mov dword [esp + 4], 4
call fcn.0050b3dc
test eax, eax
je 0x513a2c
mov dword [esp + 4], edi
lea esi, [esp + 0x54]
mov dword [esp], esi
call fcn.00507aa0
mov dword [esp], esi
call fcn.00507aec
test ebx, ebx
mov byte [esp + eax + 0x58], 0
mov dword [esp + eax + 0x54], 0x5441422e
je 0x513d78
lea eax, [esp + 0x158]
mov dword [esp + 8], eax
mov dword [esp], esi
mov dword [esp + 4], 0x5227da
call fcn.00513648
cmp byte [esp + 0x158], 0
jne 0x513e16
jmp 0x513d9f
mov eax, dword [esp + 0x278]
mov ecx, dword [eax]
add eax, 4
mov dword [esp], eax
mov dword [esp + 0x28], 0
xor edx, edx
call fcn.00513f60
mov ebp, eax
test ebp, ebp
je 0x513e4e
mov edi, dword [esp + 0x27c]
test edi, edi
mov dword [esp + 0x30], esi
je 0x513a97
mov dword [esp + 0x2c], ebp
mov ebx, dword [edi]
test ebx, ebx
je 0x513aa7
lea esi, [edi + 4]
mov ebp, 1
mov eax, ebx
nop word [eax + eax]
mov dword [esp], eax
call fcn.00507aec
lea ebp, [ebp + eax + 1]
mov eax, dword [esi]
add esi, 4
test eax, eax
jne 0x513a80
jmp 0x513aac
xor esi, esi
jmp 0x513ae9
mov ebx, dword [esp + 0x280]
jmp 0x51386c
mov ebp, 1
mov dword [esp], ebp
call fcn.00507010
mov esi, eax
test esi, esi
mov ebp, dword [esp + 0x2c]
je 0x513d2e
test ebx, ebx
mov eax, esi
je 0x513ae6
add edi, 4
mov eax, esi
nop dword [eax]
mov dword [esp + 4], ebx
mov dword [esp], eax
call fcn.005076c0
inc eax
mov ebx, dword [edi]
add edi, 4
test ebx, ebx
jne 0x513ad0
mov byte [eax], 0
call dword [0x5226e0]
mov dword [esp + 0x84], 0
mov dword [esp + 0x94], 0
mov dword [esp + 0x90], 0
mov dword [esp + 0x8c], 0
mov dword [esp + 0x88], 0
mov dword [esp + 0x80], 0
mov dword [esp + 0x7c], 0
mov dword [esp + 0x78], 0
mov dword [esp + 0x74], 0
mov dword [esp + 0x70], 0
mov dword [esp + 0x6c], 0
mov dword [esp + 0x68], 0
mov dword [esp + 0x64], 0
mov dword [esp + 0x60], 0
mov dword [esp + 0x5c], 0
mov dword [esp + 0x58], 0
mov dword [esp + 0x54], 0x44
mov word [esp + 0x84], 0xa
cmp dword [0x52a6cc], 0
je 0x513bd4
mov dword [esp], 0
call dword [0x520fc0]
mov word [esp + 0x86], ax
movzx eax, ax
mov dword [esp], eax
call fcn.00507010
mov dword [esp + 0x88], eax
test eax, eax
je 0x513d2e
mov dword [esp], eax
call dword [0x520fc0]
mov edi, esi
mov dword [esp + 0x48], 0xc
mov dword [esp + 0x4c], 0
mov dword [esp + 0x50], 1
mov ebx, dword [esp + 0x270]
mov eax, ebx
shr eax, 1
and eax, 8
test bl, 0x20
mov ecx, 0x10
cmove ecx, eax
mov eax, ebx
and eax, 0x40
mov edx, ebx
shr edx, 5
and edx, 4
lea edx, [edx + eax*8]
lea eax, [ebx*4]
and eax, 0x1000
test bh, 2
mov esi, 0x800
cmove esi, eax
or esi, ecx
mov eax, ebx
shl eax, 0xf
and eax, 0x4000000
or eax, esi
or eax, edx
mov ecx, 0x20
test bh, 0x20
jne 0x513c67
mov ecx, 0x40
test bh, 0x10
jne 0x513c67
mov ecx, 0x80
test bh, 0x40
jne 0x513c67
mov ecx, ebx
shr ecx, 7
and ecx, 0x100
or eax, ecx
cmp byte [esp + 0x28], 0
lea ecx, [esp + 0x158]
cmovne ecx, dword [esp + 0x30]
lea edx, [esp + 0x38]
mov dword [esp + 0x24], edx
lea edx, [esp + 0x54]
mov dword [esp + 0x20], edx
mov esi, edi
mov dword [esp + 0x18], esi
mov dword [esp + 0x14], eax
lea eax, [esp + 0x48]
mov dword [esp + 0xc], eax
mov dword [esp + 8], eax
mov dword [esp + 4], ebp
mov dword [esp], ecx
mov dword [esp + 0x1c], 0
mov dword [esp + 0x10], 1
call sub.KERNEL32.DLL_CreateProcessA
sub esp, 0x28
cmp eax, 1
jne 0x513d4b
mov eax, dword [esp + 0x270]
cmp eax, 0x10
mov ecx, 4
cmovne ecx, eax
mov eax, ecx
and al, 7
cmp al, 4
ja case.default.0x513ced
mov eax, ecx
and eax, 7
mov edi, ecx
jmp dword [eax*4 + 0x513f48]
test ch, 1
jne case.0x513ced.1
mov eax, dword [esp + 0x38]
mov dword [esp], eax
call sub.KERNEL32.DLL_CloseHandle
sub esp, 4
mov eax, dword [esp + 0x38]
mov ecx, dword [esp + 0x40]
mov dword [esp + 4], eax
mov dword [esp], ecx
call dword [0x5227bc]
mov ecx, edi
mov ebx, eax
test cl, cl
jns 0x513ef4
jmp 0x513f0b
call fcn.0051257c
mov dword [eax], 8
mov dword [esp], ebp
call fcn.00507020
mov ebx, 0xffffffff
jmp 0x513f1b
call sub.KERNEL32.DLL_GetLastError
movzx eax, ax
cmp eax, 0x59
je 0x513e7f
cmp eax, 8
je 0x513e78
cmp eax, 1
jne 0x513e86
mov esi, 0x13
jmp 0x513e8b
mov dword [esp + 4], esi
lea eax, [esp + 0x158]
mov dword [esp], eax
call fcn.00507aa0
mov dword [esp], esi
mov dword [esp + 4], 4
call fcn.0050b3dc
test eax, eax
je 0x513e16
mov dword [esp + 4], edi
lea esi, [esp + 0x54]
mov dword [esp], esi
call fcn.00507aa0
mov dword [esp], esi
call fcn.00507aec
test ebx, ebx
mov byte [esp + eax + 0x58], 0
mov dword [esp + eax + 0x54], 0x444d432e
je 0x513def
lea eax, [esp + 0x158]
mov dword [esp + 8], eax
mov dword [esp], esi
mov dword [esp + 4], 0x5227da
call fcn.00513648
cmp byte [esp + 0x158], 0
jne 0x513e16
jmp 0x513e63
mov dword [esp + 4], esi
lea eax, [esp + 0x158]
mov dword [esp], eax
call fcn.00507aa0
mov dword [esp], esi
mov dword [esp + 4], 4
call fcn.0050b3dc
test eax, eax
jne 0x513e63
mov dword [esp], 0x5227cf
call fcn.00512bdc
mov esi, eax
test esi, esi
je 0x513e63
mov eax, dword [esp + 0x278]
mov dword [esp], eax
mov edx, 0x5227d7
mov ecx, esi
call fcn.00513f60
mov ebp, eax
mov al, 1
mov dword [esp + 0x28], eax
test ebp, ebp
jne 0x513a54
call fcn.0051257c
mov dword [eax], 8
mov ebx, 0xffffffff
jmp 0x513f1b
call fcn.0051257c
mov dword [eax], 2
mov ebx, 0xffffffff
jmp 0x513f1b
mov esi, 8
jmp 0x513e8b
mov esi, 0x2a
jmp 0x513e8b
mov esi, 0x15
call fcn.0051257c
mov dword [eax], esi
mov ebx, 0xffffffff
mov esi, edi
jmp 0x513f0b
mov eax, dword [esp + 0x38]
mov dword [esp], eax
mov dword [esp + 4], 0xffffffff
call sub.KERNEL32.DLL_WaitForSingleObject
sub esp, 8
mov eax, dword [esp + 0x38]
lea ecx, [esp + 0x34]
mov dword [esp + 4], ecx
mov dword [esp], eax
call sub.KERNEL32.DLL_GetExitCodeProcess
sub esp, 8
mov ecx, edi
test ch, 1
jne 0x513ee1
mov eax, dword [esp + 0x38]
mov dword [esp], eax
call sub.KERNEL32.DLL_CloseHandle
sub esp, 4
mov ecx, edi
mov ebx, dword [esp + 0x34]
test cl, cl
jns 0x513ef4
jmp 0x513f0b
mov ebx, 0xffffffff
test cl, cl
js 0x513f0b
and ecx, 0x100
jne 0x513f0b
mov eax, dword [esp + 0x3c]
mov dword [esp], eax
call sub.KERNEL32.DLL_CloseHandle
sub esp, 4
mov dword [esp], esi
call fcn.00507020
mov dword [esp], ebp
call fcn.00507020
mov eax, ebx
add esp, 0x25c
pop esi
pop edi
pop ebx
pop ebp
ret
mov dword [esp], esi
call fcn.00507020
mov dword [esp], ebp
call fcn.00507020
mov dword [esp], 0
call fcn.00512ad4
sub esp, 4
nop
wait
push ecx
add byte [eax], cl
cmp eax, 0x3f280051
push ecx
add ah, dh
cmp al, 0x51
add ah, dh
cmp al, 0x51
add byte [edi], cl
pop ds
inc eax
add byte [ebp + 0x53], dl
push ebp
push ebx