Function at 0x406740
Capabilities:
Accept command line arguments

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x2c
push ebx
push esi
mov esi, dword [ebp + 8]
mov eax, dword [esi + 4]
mov ecx, dword [esi]
push edi
cmp ecx, eax
je 0x40677c
mov edx, dword [esp + 0x34]
push edx
push ecx
push eax
push eax
call fcn.00407e20
mov edi, dword [esi + 4]
mov ebx, eax
mov eax, dword [esp + 0x44]
push eax
mov eax, ebx
call fcn.00407f00
add esp, 0x14
mov dword [esi + 4], ebx
mov ecx, dword [ebp + 0xc]
lea edi, [esi + 0x14]
mov esi, dword [edi]
lea eax, [ecx - 0x10]
sub esi, 0x10
cmp eax, esi
je 0x4067d1
cmp dword [esi + 0xc], 0
lea ebx, [esi + 0xc]
jl 0x4067c7
mov edx, dword [eax]
cmp edx, dword [esi]
jne 0x4067c7
call fcn.004043b0
mov dword [esp + 0x28], eax
or eax, 0xffffffff
lock xadd dword [ebx], eax
dec eax
test eax, eax
jg 0x4067bc
mov ecx, dword [esi]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push esi
call eax
mov ecx, dword [esp + 0x28]
add ecx, 0x10
mov dword [edi], ecx
jmp 0x4067d1
mov ebx, dword [ecx - 0xc]
push ecx
push edi
call fcn.00403580
mov edi, dword [edi]
lea edx, [esp + 0x24]
push edx
push edi
call dword [sym.imp.SHELL32.dll_CommandLineToArgvW]
mov esi, eax
mov dword [esp + 0x28], esi
test esi, esi
je 0x406ea7
mov eax, dword [0x4f36ec]
mov edx, dword [eax + 0xc]
mov ecx, 0x4f36ec
call edx
lea ebx, [eax + 0x10]
mov eax, dword [0x4f36ec]
mov edx, dword [eax + 0xc]
mov ecx, 0x4f36ec
mov dword [esp + 0x14], ebx
call edx
cmp dword [esp + 0x24], 0
lea edi, [eax + 0x10]
mov dword [esp + 0x10], edi
mov dword [esp + 0x20], 0
jle 0x406e22
lea esp, [esp]
mov eax, dword [esp + 0x28]
mov ecx, dword [esp + 0x20]
mov edi, dword [eax + ecx*4]
mov edx, dword [0x4f36ec]
mov eax, dword [edx + 0xc]
mov ecx, 0x4f36ec
call eax
lea esi, [eax + 0x10]
mov dword [esp + 0x18], esi
test edi, edi
je 0x406878
test edi, 0xffff0000
jne 0x40687c
movzx edi, di
call fcn.00402ee0
test eax, eax
je 0x4068a1
push eax
mov eax, edi
lea edi, [esp + 0x1c]
call fcn.004034e0
jmp 0x40689d
xor eax, eax
jmp 0x406890
mov eax, edi
lea edx, [eax + 2]
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x406881
sub eax, edx
sar eax, 1
push edi
lea ecx, [esp + 0x1c]
push ecx
mov ebx, eax
call fcn.00403580
mov esi, dword [esp + 0x18]
push 0x4cb8ec
push esi
call fcn.00425106
add esp, 8
test eax, eax
je 0x406d60
sub eax, esi
sar eax, 1
mov dword [esp + 0x30], eax
cmp eax, 0xffffffff
je 0x406d60
mov ebx, eax
test eax, eax
jns 0x4068d0
xor ebx, ebx
lea eax, [esi - 0x10]
mov dword [esp + 0x18], eax
cmp ebx, dword [esi - 0xc]
jl 0x4068e6
call fcn.004043b0
lea edi, [eax + 0x10]
jmp 0x40694e
mov ecx, dword [eax]
test ecx, ecx
je 0x4068f7
mov edx, dword [ecx]
mov eax, dword [edx + 0x10]
call eax
test eax, eax
jne 0x40690f
mov edx, dword [0x4f36ec]
mov eax, dword [edx + 0x10]
mov ecx, 0x4f36ec
call eax
test eax, eax
je 0x406e8e
mov edx, dword [eax]
push 2
mov ecx, eax
mov eax, dword [edx]
push ebx
call eax
test eax, eax
je 0x406e98
lea edi, [eax + 0x10]
test ebx, ebx
js 0x406e9d
cmp ebx, dword [edi - 8]
jg 0x406e9d
lea eax, [ebx + ebx]
push eax
push esi
push eax
xor ecx, ecx
mov dword [edi - 0xc], ebx
push edi
mov word [eax + edi], cx
call fcn.004236df
add esp, 0x10
mov eax, dword [esp + 0x14]
lea ebx, [edi - 0x10]
add eax, 0xfffffff0
mov dword [esp + 0x2c], ebx
mov dword [esp + 0x1c], eax
cmp ebx, eax
je 0x4069b5
cmp dword [eax + 0xc], 0
jl 0x4069a3
mov edx, dword [ebx]
cmp edx, dword [eax]
jne 0x4069a3
mov eax, ebx
call fcn.004043b0
mov edi, eax
mov eax, dword [esp + 0x1c]
add eax, 0xc
or ecx, 0xffffffff
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x40699a
mov eax, dword [esp + 0x1c]
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
add edi, 0x10
mov dword [esp + 0x14], edi
jmp 0x4069b5
mov ebx, dword [edi - 0xc]
push edi
lea ecx, [esp + 0x18]
push ecx
call fcn.00403580
mov ebx, dword [esp + 0x2c]
lea edx, [ebx + 0xc]
or eax, 0xffffffff
lock xadd dword [edx], eax
dec eax
test eax, eax
jg 0x4069ce
mov ecx, dword [ebx]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push ebx
call eax
lea ebx, [esp + 0x14]
call fcn.00407a00
call fcn.00407980
mov ebx, dword [esi - 0xc]
mov edi, ebx
sub edi, dword [esp + 0x30]
dec edi
jns 0x4069ea
xor edi, edi
cmp edi, ebx
jl 0x4069fc
mov eax, dword [esp + 0x18]
call fcn.004043b0
lea ebx, [eax + 0x10]
jmp 0x406a78
mov ecx, dword [esp + 0x18]
mov ecx, dword [ecx]
test ecx, ecx
je 0x406a11
mov edx, dword [ecx]
mov eax, dword [edx + 0x10]
call eax
test eax, eax
jne 0x406a21
mov edx, dword [0x4f36ec]
mov eax, dword [edx + 0x10]
mov ecx, 0x4f36ec
call eax
sub ebx, edi
lea esi, [esi + ebx*2]
test eax, eax
je 0x406e8e
test esi, esi
jne 0x406a3a
test edi, edi
jne 0x406e9d
mov edx, dword [eax]
push 2
mov ecx, eax
mov eax, dword [edx]
push edi
call eax
test eax, eax
je 0x406e98
lea ebx, [eax + 0x10]
test edi, edi
js 0x406e9d
cmp edi, dword [ebx - 8]
jg 0x406e9d
mov dword [ebx - 0xc], edi
add edi, edi
push edi
push esi
xor ecx, ecx
push edi
push ebx
mov word [edi + ebx], cx
call fcn.004236df
add esp, 0x10
mov esi, dword [esp + 0x10]
lea edi, [ebx - 0x10]
add esi, 0xfffffff0
cmp edi, esi
je 0x406acb
cmp dword [esi + 0xc], 0
jl 0x406abd
mov edx, dword [edi]
cmp edx, dword [esi]
jne 0x406abd
mov eax, edi
call fcn.004043b0
mov ebx, eax
lea eax, [esi + 0xc]
or ecx, 0xffffffff
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x406ab4
mov ecx, dword [esi]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push esi
call eax
add ebx, 0x10
mov dword [esp + 0x10], ebx
jmp 0x406acb
push ebx
mov ebx, dword [ebx - 0xc]
lea ecx, [esp + 0x14]
push ecx
call fcn.00403580
lea edx, [edi + 0xc]
or eax, 0xffffffff
lock xadd dword [edx], eax
dec eax
test eax, eax
jg 0x406ae4
mov ecx, dword [edi]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push edi
call eax
lea ebx, [esp + 0x10]
call fcn.00407a00
call fcn.00407980
mov esi, dword [esp + 0x10]
cmp dword [esi - 0xc], 1
jg 0x406b09
lea eax, [esi - 0x10]
call fcn.004043b0
lea edi, [eax + 0x10]
jmp 0x406b6f
mov ecx, dword [esi - 0x10]
test ecx, ecx
je 0x406b1b
mov edx, dword [ecx]
mov eax, dword [edx + 0x10]
call eax
test eax, eax
jne 0x406b33
mov edx, dword [0x4f36ec]
mov eax, dword [edx + 0x10]
mov ecx, 0x4f36ec
call eax
test eax, eax
je 0x406e8e
mov edx, dword [eax]
push 2
mov ecx, eax
mov eax, dword [edx]
push 1
call eax
test eax, eax
je 0x406e98
lea edi, [eax + 0x10]
mov eax, 1
cmp dword [edi - 8], eax
jl 0x406e9d
push 2
push esi
xor ecx, ecx
push 2
mov dword [edi - 0xc], eax
push edi
mov word [edi + 2], cx
call fcn.004236df
add esp, 0x10
cmp dword [edi - 0xc], 1
jne 0x406b7f
cmp word [edi], 0x22
jne 0x406b7f
mov bl, 1
jmp 0x406b81
xor bl, bl
add edi, 0xfffffff0
lea edx, [edi + 0xc]
or eax, 0xffffffff
lock xadd dword [edx], eax
dec eax
test eax, eax
jg 0x406b9d
mov ecx, dword [edi]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push edi
call eax
test bl, bl
je 0x406be0
mov eax, dword [esi - 0xc]
lea ecx, [esp + 0x10]
push ecx
dec eax
lea ecx, [esp + 0x38]
call fcn.00407b30
lea edi, [esp + 0x10]
call fcn.00404050
mov eax, dword [esp + 0x34]
add eax, 0xfffffff0
lea edx, [eax + 0xc]
or ecx, 0xffffffff
lock xadd dword [edx], ecx
dec ecx
test ecx, ecx
jg 0x406bdc
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov esi, dword [esp + 0x10]
mov edi, dword [esi - 0xc]
lea eax, [esi - 0x10]
mov dword [esp + 0x1c], eax
cmp edi, 1
jg 0x406bf9
call fcn.004043b0
lea edi, [eax + 0x10]
jmp 0x406c6a
mov ecx, dword [eax]
test ecx, ecx
je 0x406c0a
mov edx, dword [ecx]
mov eax, dword [edx + 0x10]
call eax
test eax, eax
jne 0x406c1a
mov edx, dword [0x4f36ec]
mov eax, dword [edx + 0x10]
mov ecx, 0x4f36ec
call eax
lea ebx, [esi + edi*2 - 2]
test eax, eax
je 0x406e8e
test ebx, ebx
je 0x406e9d
mov edx, dword [eax]
push 2
mov ecx, eax
mov eax, dword [edx]
push 1
call eax
test eax, eax
je 0x406e98
cmp dword [eax + 8], 1
lea edi, [eax + 0x10]
jl 0x406e9d
push 2
push ebx
xor ecx, ecx
push 2
mov dword [edi - 0xc], 1
push edi
mov word [edi + 2], cx
call fcn.004236df
add esp, 0x10
cmp dword [edi - 0xc], 1
jne 0x406c7a
cmp word [edi], 0x22
jne 0x406c7a
mov bl, 1
jmp 0x406c7c
xor bl, bl
add edi, 0xfffffff0
lea edx, [edi + 0xc]
or eax, 0xffffffff
lock xadd dword [edx], eax
dec eax
test eax, eax
jg 0x406c98
mov ecx, dword [edi]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push edi
call eax
test bl, bl
je 0x406dd4
mov eax, dword [esi - 0xc]
lea edi, [eax - 1]
test edi, edi
jns 0x406cac
xor edi, edi
cmp edi, eax
jl 0x406cc2
mov eax, dword [esp + 0x1c]
call fcn.004043b0
lea ebx, [eax + 0x10]
mov dword [esp + 0x1c], ebx
jmp 0x406d31
mov ecx, dword [esp + 0x1c]
mov ecx, dword [ecx]
test ecx, ecx
je 0x406cd7
mov edx, dword [ecx]
mov eax, dword [edx + 0x10]
call eax
test eax, eax
jne 0x406cef
mov edx, dword [0x4f36ec]
mov eax, dword [edx + 0x10]
mov ecx, 0x4f36ec
call eax
test eax, eax
je 0x406e8e
mov edx, dword [eax]
push 2
mov ecx, eax
mov eax, dword [edx]
push edi
call eax
test eax, eax
je 0x406e98
lea ebx, [eax + 0x10]
mov dword [esp + 0x1c], ebx
test edi, edi
js 0x406e9d
cmp edi, dword [ebx - 8]
jg 0x406e9d
mov dword [ebx - 0xc], edi
add edi, edi
push edi
push esi
xor ecx, ecx
push edi
push ebx
mov word [edi + ebx], cx
call fcn.004236df
add esp, 0x10
lea eax, [esp + 0x1c]
lea edi, [esp + 0x10]
call fcn.00404050
add ebx, 0xfffffff0
lea edx, [ebx + 0xc]
or eax, 0xffffffff
lock xadd dword [edx], eax
dec eax
test eax, eax
jg 0x406dd4
mov ecx, dword [ebx]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push ebx
call eax
jmp 0x406dd4
mov edi, dword [esp + 0x14]
lea eax, [esi - 0x10]
add edi, 0xfffffff0
mov dword [esp + 0x18], eax
cmp eax, edi
je 0x406db5
cmp dword [edi + 0xc], 0
lea ebx, [edi + 0xc]
jl 0x406da7
mov ecx, dword [eax]
cmp ecx, dword [edi]
jne 0x406da7
call fcn.004043b0
mov esi, eax
or edx, 0xffffffff
lock xadd dword [ebx], edx
dec edx
test edx, edx
jg 0x406d9e
mov ecx, dword [edi]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push edi
call edx
add esi, 0x10
mov dword [esp + 0x14], esi
jmp 0x406db5
mov ebx, dword [esi - 0xc]
push esi
lea eax, [esp + 0x18]
push eax
call fcn.00403580
lea ebx, [esp + 0x14]
call fcn.00407a00
call fcn.00407980
push 0x4cb44c
lea ecx, [esp + 0x14]
push ecx
xor ebx, ebx
call fcn.00403580
mov eax, dword [ebp + 8]
lea edx, [esp + 0x10]
push edx
push eax
lea eax, [esp + 0x1c]
call fcn.00406fc0
mov eax, dword [esp + 0x18]
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x406e03
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, dword [esp + 0x20]
inc eax
mov dword [esp + 0x20], eax
cmp eax, dword [esp + 0x24]
jl 0x406830
mov ebx, dword [esp + 0x14]
mov esi, dword [esp + 0x28]
mov edi, dword [esp + 0x10]
push esi
call dword [sym.imp.KERNEL32.dll_LocalFree]
add edi, 0xfffffff0
lea ecx, [edi + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x406e45
mov ecx, dword [edi]
mov eax, dword [ecx]
mov edx, dword [eax + 4]
push edi
call edx
add ebx, 0xfffffff0
lea eax, [ebx + 0xc]
or ecx, 0xffffffff
lock xadd dword [eax], ecx
dec ecx
test ecx, ecx
jg 0x406e61
mov ecx, dword [ebx]
mov edx, dword [ecx]
mov eax, dword [edx + 4]
push ebx
call eax
mov eax, dword [ebp + 0xc]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x406e80
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
mov eax, 1
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 8
push 0x80004005
call fcn.00402e50
call fcn.00403750
push 0x80070057
call fcn.00402e50
mov eax, dword [ebp + 0xc]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x406ec6
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
pop edi
pop esi
xor eax, eax
pop ebx
mov esp, ebp
pop ebp
ret 8