Function at 0x401640
Capabilities:
Accept command line arguments
Resolve path using msvcrt

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x14c
test byte [0x405004], 2
jne 0x401668
call sym.__mingw32_init_mainargs
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
call sym._GetCommandLineA_0
mov dword [ebp - 0x140], esp
mov dword [esp], eax
mov ebx, eax
call sym._strlen
lea eax, [eax + eax + 0x11]
shr eax, 4
shl eax, 4
call fcn.00404030
mov dword [ebp - 0x110], 0
sub esp, eax
movsx edi, byte [ebx]
mov eax, dword [0x405004]
lea esi, [esp + 0x10]
mov dword [ebp - 0x138], esi
and eax, 0x4400
or eax, 0x10
mov dword [ebp - 0x13c], eax
lea eax, [ebx + 1]
mov ebx, edi
mov dword [ebp - 0x12c], eax
test edi, edi
je 0x4017af
mov dword [ebp - 0x134], 0
mov eax, esi
xor edx, edx
mov dword [ebp - 0x130], 0
lea esi, [esi]
nop
cmp bl, 0x3f
jg 0x4019d8
cmp bl, 0x21
jg 0x4018e0
lea esi, [eax + edx]
test edx, edx
je 0x401a75
lea esi, [esi]
add eax, 1
mov byte [eax - 1], 0x5c
cmp eax, esi
jne 0x401708
mov eax, dword [ebp - 0x130]
test eax, eax
jne 0x401848
mov eax, dword [sym.imp.msvcrt.dll___mb_cur_max]
cmp dword [eax], 1
jne 0x401820
mov eax, dword [sym.imp.msvcrt.dll__pctype]
mov eax, dword [eax]
test byte [eax + edi*2], 0x40
je 0x401838
cmp dword [ebp - 0x138], esi
jb 0x401890
mov ebx, dword [ebp - 0x134]
test ebx, ebx
jne 0x401890
mov dword [ebp - 0x134], 0
mov eax, esi
xor edx, edx
jmp 0x40184f
mov edx, eax
nop
cmp dword [ebp - 0x138], edx
jb 0x401782
mov ecx, dword [ebp - 0x134]
test ecx, ecx
je 0x4017af
lea eax, [ebp - 0x11c]
mov byte [edx], 0
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0
mov eax, dword [ebp - 0x13c]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x138]
mov dword [esp], eax
call sym.___mingw_glob
mov eax, dword [ebp - 0x118]
mov dword [0x408004], eax
mov eax, dword [ebp - 0x114]
mov dword [section..bss], eax
mov esp, dword [ebp - 0x140]
call sym.___p__pgmptr
mov eax, dword [eax]
test eax, eax
jne 0x40165a
lea ebx, [ebp - 0x11c]
mov dword [esp + 8], 0x104
mov dword [esp + 4], ebx
mov dword [esp], 0
call sym._GetModuleFileNameA_12
sub eax, 1
sub esp, 0xc
cmp eax, 0x102
ja 0x40165a
call sym.___p__pgmptr
mov dword [esp], ebx
mov esi, eax
call sym._strdup
mov dword [esi], eax
jmp 0x40165a
mov dword [esp + 4], 0x40
mov dword [esp], edi
call sym.__isctype
test eax, eax
jne 0x401740
cmp edi, 9
je 0x401740
lea esi, [esi]
mov byte [esi], bl
lea eax, [esi + 1]
xor edx, edx
add dword [ebp - 0x12c], 1
mov edi, dword [ebp - 0x12c]
movsx edi, byte [edi - 1]
mov ebx, edi
test edi, edi
jne 0x4016e8
test edx, edx
je 0x40176d
add edx, eax
lea esi, [esi]
add eax, 1
mov byte [eax - 1], 0x5c
cmp eax, edx
jne 0x401878
jmp 0x401770
lea eax, [ebp - 0x11c]
mov byte [esi], 0
mov dword [esp + 0xc], eax
mov dword [esp + 8], 0
mov esi, dword [ebp - 0x13c]
mov dword [esp + 4], esi
mov edi, dword [ebp - 0x138]
or esi, 1
mov dword [esp], edi
call sym.___mingw_glob
mov dword [ebp - 0x13c], esi
mov eax, edi
xor edx, edx
mov dword [ebp - 0x134], 0
jmp 0x40184f
lea ecx, [ebx - 0x22]
cmp cl, 0x1d
ja case.0x4019f0.2
movzx ecx, cl
jmp dword [ecx*4 + 0x406074]
lea esi, [edx - 1]
cmp edi, 0x7f
sete cl
mov edi, ecx
mov ecx, dword [ebp - 0x130]
test ecx, ecx
setne cl
or ecx, edi
test edx, edx
je 0x401a7c
lea edx, [eax + esi + 1]
lea esi, [esi]
add eax, 1
mov byte [eax - 1], 0x5c
cmp eax, edx
jne 0x401920
mov esi, edx
test cl, cl
je 0x401848
mov byte [edx], 0x7f
lea esi, [edx + 1]
jmp 0x401848
test byte [0x405004], 0x10
je case.0x4019f0.2
mov ecx, edx
sar ecx, 1
je 0x401a8a
add ecx, eax
lea esi, [esi]
add eax, 1
mov byte [eax - 1], 0x5c
cmp eax, ecx
jne 0x401960
cmp dword [ebp - 0x130], 0x22
je 0x40197d
and edx, 1
je 0x401a5b
mov byte [ecx], 0x27
lea eax, [ecx + 1]
xor edx, edx
mov dword [ebp - 0x134], 1
jmp 0x40184f
mov ecx, edx
sar ecx, 1
je 0x401a83
add ecx, eax
add eax, 1
mov byte [eax - 1], 0x5c
cmp eax, ecx
jne 0x4019a0
cmp dword [ebp - 0x130], 0x27
je 0x401a30
and edx, 1
jne 0x401a30
xor dword [ebp - 0x130], 0x22
mov eax, ecx
xor edx, edx
mov dword [ebp - 0x134], 1
jmp 0x40184f
cmp bl, 0x5a
jle case.0x4019f0.2
lea ecx, [ebx - 0x5b]
cmp cl, 0x24
ja case.0x4019f0.2
movzx ecx, cl
jmp dword [ecx*4 + 0x4060ec]
cmp dword [ebp - 0x130], 0x27
je 0x401a50
add edx, 1
jmp 0x40184f
lea esi, [edx - 1]
test byte [0x405004], 0x20
jne 0x4018f9
mov ecx, 1
test edx, edx
jne 0x401916
mov edx, eax
jmp 0x401935
mov byte [ecx], 0x22
lea eax, [ecx + 1]
xor edx, edx
mov dword [ebp - 0x134], 1
jmp 0x40184f
mov byte [eax], 0x5c
add eax, 1
jmp 0x40184f
xor dword [ebp - 0x130], 0x27
mov eax, ecx
xor edx, edx
mov dword [ebp - 0x134], 1
jmp 0x40184f
mov esi, eax
jmp 0x401713
mov edx, eax
jmp 0x40192b
mov ecx, eax
jmp 0x4019ab
mov ecx, eax
jmp 0x40196b