Function at 0x4010c0
Capabilities:
Accept command line arguments
Check if file exists
Get file attributes
Set current directory

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34c
mov eax, dword [0x52b004]
xor eax, ebp
mov dword [ebp - 4], eax
push esi
push edi
push str._n
call fcn.00401020
push str.______________Patch_Program_for_EX_Commander_____________n
call fcn.00401020
push str.______C__Nuvoton_Technology_Corporation_Japan_2022_______n
call fcn.00401020
push str._n_n
call fcn.00401020
add esp, 0x10
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
mov esi, eax
test esi, esi
je 0x40116c
mov al, byte [esi]
mov edi, esi
test al, al
je 0x40113d
lea edi, [edi + 1]
cmp al, 0x2f
jne 0x40112b
movsx eax, byte [edi]
push eax
call fcn.00409e0e
add esp, 4
cmp al, 0x75
je 0x401133
mov al, byte [edi]
test al, al
jne 0x401114
jmp 0x40113d
mov dword [0x52c3e4], 1
mov al, byte [esi]
test al, al
je 0x40116c
lea esi, [esi + 1]
cmp al, 0x2f
jne 0x40115a
movsx eax, byte [esi]
push eax
call fcn.00409e0e
add esp, 4
cmp al, 0x69
je 0x401162
mov al, byte [esi]
test al, al
jne 0x401143
jmp 0x40116c
mov dword [0x52c4ec], 1
push 0x104
lea eax, [ebp - 0x348]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea eax, [ebp - 0x348]
push 0x5c
push eax
call fcn.004088b0
add esp, 8
mov byte [eax], 0
lea eax, [ebp - 0x348]
push eax
call dword [sym.imp.KERNEL32.dll_SetCurrentDirectoryA]
lea ecx, [ebp - 0x34c]
call fcn.004017c0
mov edi, dword [sym.imp.USER32.dll_MessageBoxA]
mov esi, eax
test esi, esi
jne 0x40132b
mov ecx, str.PATCH_DATA_TAG:
mov edx, 0x425240
mov edi, 0xc
nop dword [eax + eax]
mov eax, dword [ecx]
cmp eax, dword [edx]
jne 0x40153c
add ecx, 4
add edx, 4
sub edi, 4
jae 0x4011d0
cmp dword [0x52c4ec], 1
mov eax, dword [0x425646]
mov ecx, dword [0x425640]
mov edx, dword [0x425642]
mov edi, dword [0x425644]
mov word [0x52c600], ax
mov eax, dword [0x425648]
mov word [0x52c602], ax
mov eax, dword [0x42564a]
mov word [0x52c5f8], cx
mov word [0x52c5fa], dx
mov word [0x52c5fe], di
mov word [0x52c604], ax
jne 0x401265
movzx eax, ax
push eax
mov eax, dword [0x425648]
movzx eax, ax
push eax
mov eax, dword [0x425646]
movzx eax, ax
push eax
movzx eax, di
push eax
movzx eax, dx
push eax
movzx eax, cx
push eax
push str.Patch_Date__:__04d__02d__02d___02d:_02d:_02d_n
call fcn.00401020
add esp, 0x1c
push 0x104
lea eax, [ebp - 0x348]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea eax, [ebp - 0x348]
push 0x5c
push eax
call fcn.004088b0
inc eax
push eax
push 0x40
push 0x52c608
call fcn.0040bb18
mov eax, dword [0x52c4ec]
add esp, 0x14
cmp eax, 1
jne 0x4012b9
push 0x52c608
push str.Patch_Name__:__s_n
call fcn.00401020
mov eax, dword [0x52c4ec]
add esp, 8
mov edi, dword [0x425690]
mov dword [0x52c688], edi
cmp eax, 1
jne 0x401312
push str.EXC_Version_:
call fcn.00401020
add esp, 4
test edi, edi
je 0x40135f
movzx eax, byte [0x52c688]
push eax
mov eax, dword [0x52c688]
sar eax, 8
movzx eax, al
push eax
movsx eax, word [0x52c68a]
movzx eax, al
push eax
push str._d._d._d_n
call fcn.00401020
mov eax, dword [0x52c4ec]
add esp, 0x10
jmp 0x401316
test edi, edi
je 0x40135f
test eax, eax
jne 0x40135f
cmp edi, dword [ebp - 0x34c]
je 0x40135f
lea esi, [eax + 0xf]
mov edi, dword [sym.imp.USER32.dll_MessageBoxA]
xor ecx, ecx
call fcn.00401680
push 0x200
lea eax, [ebp - 0x244]
push 0
push eax
call fcn.00408ce0
add esp, 0xc
cmp esi, 0x14
ja case.0x401358.2
movzx eax, byte [esi + 0x40165c]
jmp dword [eax*4 + 0x401630]
push 0x5c
push 0x52c608
call fcn.004088b0
add esp, 8
test eax, eax
jne 0x401379
mov eax, 0x52c608
jmp 0x40137a
inc eax
push eax
lea eax, [ebp - 0x44]
push 0x40
push eax
call fcn.0040bb18
lea eax, [ebp - 0x44]
push str..exe
push eax
call fcn.00408640
add esp, 0x14
test eax, eax
je 0x40139e
mov byte [eax], 0
lea eax, [ebp - 0x44]
push eax
push 0x80
push 0x52c3e8
call fcn.0040bd11
push 0x425590
push 0x80
push 0x52c3e8
call fcn.0040bd11
add esp, 0x18
push 0x52c3e8
call dword [sym.imp.KERNEL32.dll_GetFileAttributesA]
xor ecx, ecx
cmp eax, 0xffffffff
push 0x200
lea eax, [ebp - 0x244]
setne cl
push 0
push eax
mov dword [ebp - 0x34c], ecx
call fcn.00408ce0
cmp dword [0x52c3e4], 0
lea eax, [ebp - 0x244]
push 0x52c608
jne 0x4014c8
push str.Install_the_following_program__n_____s
push 0x200
push eax
call fcn.00401060
mov edi, dword [sym.imp.USER32.dll_MessageBoxA]
lea eax, [ebp - 0x244]
add esp, 0x1c
push 4
push str.EXCPatch
push eax
push 0
call edi
cmp eax, 7
jne 0x401444
lea ecx, [eax - 6]
jmp 0x40132d
cmp dword [ebp - 0x34c], 1
jne 0x4014a9
push 0x200
lea eax, [ebp - 0x244]
push 0
push eax
call fcn.00408ce0
push str.Backeup_files_with_the_same_name_already_exists._nOverwrite_
lea eax, [ebp - 0x244]
push 0x200
push eax
call fcn.0040bb18
add esp, 0x18
lea eax, [ebp - 0x244]
push 3
push str.EXCPatch
push eax
push 0
call edi
cmp eax, 2
jne 0x401498
lea ecx, [eax - 1]
jmp 0x40132d
cmp eax, 7
jne 0x4014b2
mov dword [0x52b8b0], 0
jmp 0x4014b2
cmp eax, 2
je 0x40132b
mov ecx, 0x4256a4
mov dword [ebp - 0x34c], 6
call fcn.00401b70
jmp 0x401527
push str.Uninstall_the_following_program__n_____s
push 0x200
push eax
call fcn.00401060
mov edi, dword [sym.imp.USER32.dll_MessageBoxA]
lea eax, [ebp - 0x244]
add esp, 0x1c
push 4
push str.EXCPatch
push eax
push 0
call edi
cmp eax, 7
jne 0x401500
lea ecx, [eax - 6]
jmp 0x40132d
cmp dword [ebp - 0x34c], 0
jne 0x401513
mov esi, 0x12
jmp 0x40132b
mov ecx, 0x4256a4
mov dword [ebp - 0x34c], 7
call fcn.00401fd0
mov esi, eax
test esi, esi
jne 0x40132b
mov ecx, dword [ebp - 0x34c]
jmp 0x40132d
mov esi, 0xd
jmp 0x401325
push str.Initialize_zlib_failed.
jmp 0x4015dc
push str.File_decompression_failed.
jmp 0x4015dc
push str.Update_data_not_found.
jmp 0x4015dc
push str.EX_Commander_is_not_installed.
jmp 0x4015dc
movzx eax, byte [0x52c688]
push eax
mov eax, dword [0x52c688]
sar eax, 8
movzx eax, al
push eax
movsx eax, word [0x52c68a]
movzx eax, al
push eax
push str.This_patch_program_can_be_installed_for__n__EX_Commander_Version__d._d._d.
lea eax, [ebp - 0x244]
push 0x200
push eax
call fcn.00401060
add esp, 0x18
jmp 0x4015f0
push str.Directory_creation_failed.
jmp 0x4015dc
push str.Directory_creation_for_backup_failed.
jmp 0x4015dc
push str.Backup_file_does_not_exist.
jmp 0x4015dc
push 0x52c8a0
push str.File_output_failed._n_____s
lea eax, [ebp - 0x244]
push 0x200
push eax
call fcn.00401060
add esp, 0x10
jmp 0x4015f0
push str.System_Error
lea eax, [ebp - 0x244]
push 0x200
push eax
call fcn.0040bb18
add esp, 0xc
lea eax, [ebp - 0x244]
push eax
call fcn.00401020
push 0x425398
call fcn.00401020
add esp, 8
lea eax, [ebp - 0x244]
push 0
push str.EXCPatch
push eax
push 0
call edi
mov ecx, dword [ebp - 4]
xor eax, eax
pop edi
xor ecx, ebp
pop esi
call fcn.00407a00
mov esp, ebp
pop ebp
ret 0x10