Function at 0x402040
Capabilities:
Accept command line arguments

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x4c
test byte [0x40b004], 2
je 0x402340
call sym._GetCommandLineA_0
mov dword [ebp - 0x3c], esp
mov dword [esp], eax
mov esi, eax
call sym._strlen
lea eax, [eax + eax + 0x11]
shr eax, 4
shl eax, 4
call fcn.00402bc0
sub esp, eax
mov dword [ebp - 0x1c], 0
mov dword [ebp - 0x2c], 0
lea eax, [esp + 0x10]
mov dword [ebp - 0x30], 0
mov edx, eax
mov dword [ebp - 0x34], eax
mov eax, dword [0x40b004]
and eax, 0x4400
or eax, 0x10
mov dword [ebp - 0x38], eax
xor eax, eax
lea esi, [esi]
add esi, 1
movsx ecx, byte [esi - 1]
test ecx, ecx
mov ebx, ecx
je 0x402130
cmp bl, 0x3f
je 0x402253
jg 0x402180
cmp bl, 0x27
je 0x402285
cmp bl, 0x2a
je 0x402253
cmp bl, 0x22
jne 0x4021f0
mov ecx, eax
sar ecx, 1
je 0x4023ca
add ecx, edx
add edx, 1
mov byte [edx - 1], 0x5c
cmp edx, ecx
jne 0x4020f3
cmp dword [ebp - 0x2c], 0x27
je 0x4022d1
test al, 1
jne 0x4022d1
add esi, 1
mov edx, ecx
xor dword [ebp - 0x2c], 0x22
movsx ecx, byte [esi - 1]
xor eax, eax
mov dword [ebp - 0x30], 1
test ecx, ecx
mov ebx, ecx
jne 0x4020bd
lea esi, [esi]
test eax, eax
je 0x4023d1
add eax, edx
lea esi, [esi]
add edx, 1
mov byte [edx - 1], 0x5c
cmp edx, eax
jne 0x402140
cmp dword [ebp - 0x34], eax
jb 0x402312
mov edx, dword [ebp - 0x30]
test edx, edx
jne 0x402312
mov eax, dword [ebp - 0x24]
mov dword [0x40f004], eax
mov eax, dword [ebp - 0x20]
mov dword [section..bss], eax
mov esp, dword [ebp - 0x3c]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
cmp bl, 0x5c
je 0x402273
cmp bl, 0x7f
je 0x402253
cmp bl, 0x5b
jne 0x4021f0
test byte [0x40b004], 0x20
jne 0x402253
test eax, eax
lea edi, [eax - 1]
mov ecx, 1
je 0x4021e2
lea edi, [edx + edi + 1]
mov eax, edx
lea esi, [esi]
lea edi, [edi]
add eax, 1
mov byte [eax - 1], 0x5c
cmp eax, edi
jne 0x4021c0
test cl, cl
jne 0x4021e0
lea edx, [eax + 1]
mov byte [eax], bl
xor eax, eax
jmp 0x4020b0
mov edx, eax
lea eax, [edx + 1]
mov byte [edx], 0x7f
jmp 0x4021cf
test eax, eax
lea edi, [edx + eax]
je 0x4023c3
nop
lea esi, [esi]
add edx, 1
mov byte [edx - 1], 0x5c
cmp edx, edi
jne 0x402200
mov eax, dword [ebp - 0x2c]
test eax, eax
jne 0x402247
mov eax, dword [sym.imp.msvcrt.dll___mb_cur_max]
cmp dword [eax], 1
je 0x4022e5
mov dword [esp + 4], 0x40
mov dword [esp], ecx
mov dword [ebp - 0x40], ecx
call sym.__isctype
test eax, eax
jne 0x4022f6
mov ecx, dword [ebp - 0x40]
cmp ecx, 9
je 0x4022f6
lea edx, [edi + 1]
mov byte [edi], bl
xor eax, eax
jmp 0x4020b0
test eax, eax
lea edi, [eax - 1]
je 0x4023ac
mov eax, dword [ebp - 0x2c]
cmp ecx, 0x7f
sete cl
test eax, eax
setne al
or ecx, eax
jmp 0x4021b0
cmp dword [ebp - 0x2c], 0x27
je 0x402361
add eax, 1
jmp 0x4020b0
test byte [0x40b004], 0x10
je 0x4021f0
mov ecx, eax
sar ecx, 1
je 0x4023d8
add ecx, edx
nop
add edx, 1
mov byte [edx - 1], 0x5c
cmp edx, ecx
jne 0x4022a0
cmp dword [ebp - 0x2c], 0x22
je 0x40234d
test al, 1
jne 0x40234d
xor dword [ebp - 0x2c], 0x27
mov edx, ecx
xor eax, eax
mov dword [ebp - 0x30], 1
jmp 0x4020b0
lea edx, [ecx + 1]
mov byte [ecx], 0x22
xor eax, eax
mov dword [ebp - 0x30], 1
jmp 0x4020b0
mov eax, dword [sym.imp.msvcrt.dll__pctype]
mov eax, dword [eax]
test byte [eax + ecx*2], 0x40
je 0x40223e
cmp dword [ebp - 0x34], edi
jb 0x402370
mov eax, dword [ebp - 0x30]
test eax, eax
jne 0x402370
mov edx, edi
xor eax, eax
mov dword [ebp - 0x30], 0
jmp 0x4020b0
mov byte [eax], 0
lea eax, [ebp - 0x28]
mov dword [esp + 8], 0
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x38]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x34]
mov dword [esp], eax
call sym.___mingw_glob
jmp 0x40215f
call sym.__mingw32_init_mainargs
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
lea edx, [ecx + 1]
mov byte [ecx], 0x27
xor eax, eax
mov dword [ebp - 0x30], 1
jmp 0x4020b0
mov byte [edx], 0x5c
add edx, 1
jmp 0x4020b0
lea eax, [ebp - 0x28]
mov byte [edi], 0
mov dword [esp + 8], 0
mov dword [esp + 0xc], eax
mov ebx, dword [ebp - 0x38]
mov dword [esp + 4], ebx
mov edi, dword [ebp - 0x34]
mov dword [esp], edi
call sym.___mingw_glob
mov eax, ebx
mov edx, edi
mov dword [ebp - 0x30], 0
or eax, 1
mov dword [ebp - 0x38], eax
xor eax, eax
jmp 0x4020b0
mov eax, dword [ebp - 0x2c]
test eax, eax
setne al
cmp ecx, 0x7f
sete cl
or ecx, eax
mov eax, edx
jmp 0x4021cb
mov edi, edx
jmp 0x40220b
mov ecx, edx
jmp 0x4020fe
mov eax, edx
jmp 0x40214b
mov ecx, edx
jmp 0x4022ab