Function at 0x4045b0
Capabilities:
Accept command line arguments
Copy file
Delete file

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
lea edi, [ebp - 0x11c]
lea esi, [ebp - 0x11c]
push ebx
sub esp, 0x24c
call dword [sym.imp.KERNEL32.dll_GetCommandLineA]
mov ecx, 0x41
mov ebx, eax
xor eax, eax
rep stosd dword es:[edi], eax
mov dword [esp + 8], 0x104
mov dword [esp + 4], esi
mov dword [esp], 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
sub esp, 0xc
mov dword [esp + 4], str.__new
mov dword [esp], ebx
call sym._strstr
test eax, eax
je 0x404aa0
mov dword [esp + 4], ebx
mov dword [esp], str._Check_Patcher__Command_Line:__s
call sym.Log_char_const__..._
mov dword [esp + 4], esi
mov dword [esp], str._Check_Patcher__FileName:__s
call sym.Log_char_const__..._
mov dword [ebp - 0x22c], 1
lea ebx, [ebp - 0x1e4]
mov dword [ebp - 0x1ec], ebx
mov dword [esp], esi
call sym._strlen
mov dword [ebp - 0x230], eax
cmp eax, 0xf
ja 0x404b68
cmp dword [ebp - 0x230], 1
je 0x404b50
mov eax, dword [ebp - 0x230]
test eax, eax
jne 0x404f10
mov eax, ebx
mov edi, dword [ebp - 0x230]
mov dword [ebp - 0x1e8], edi
mov byte [eax + edi], 0
lea eax, [ebp - 0x1ec]
mov dword [esp], eax
call sym.CalculateChecksumFile_std::__cxx11::basic_string_char__std::char_traits_char___std::allocator_char____
mov edx, dword [ebp - 0x1ec]
mov edi, eax
cmp edx, ebx
je 0x4046b6
mov eax, dword [ebp - 0x1e4]
mov dword [esp], edx
add eax, 1
mov dword [esp + 4], eax
call sym.operator_delete_void__unsigned_int_
lea ecx, [ebp - 0x1a4]
call fcn.004f0d60
xor eax, eax
mov esi, dword [0x542c6c]
mov dword [ebp - fcn.004f2350], 0x544aac
mov word [ebp - 0x130], ax
mov eax, dword [0x542c68]
lea ecx, [ebp - 0x1ec]
mov dword [ebp - 0x134], 0
mov dword [ebp - 0x1ec], eax
mov eax, dword [eax - 0xc]
mov dword [ebp - 0x12c], 0
mov dword [ebp - 0x128], 0
mov dword [ebp - 0x124], 0
mov dword [ebp - 0x120], 0
mov dword [ebp + eax - 0x1ec], esi
mov eax, dword [0x542c68]
mov dword [ebp - 0x1e8], 0
add ecx, dword [eax - 0xc]
mov dword [esp], 0
call method.std::basic_ios_char__std::char_traits_char___.init_std::basic_streambuf_char__std::char_traits_char____
mov eax, dword [0x542c70]
sub esp, 4
mov ecx, dword [eax - 0xc]
mov dword [ebp - 0x1e4], eax
mov eax, dword [0x542c74]
add ecx, ebx
mov dword [ecx], eax
mov dword [esp], 0
call method.std::basic_ios_char__std::char_traits_char___.init_std::basic_streambuf_char__std::char_traits_char____
mov eax, dword [0x542c64]
mov edx, dword [0x542c78]
sub esp, 4
lea ecx, [ebp - 0x1c4]
mov eax, dword [eax - 0xc]
mov dword [ebp + eax - 0x1ec], edx
mov dword [ebp - fcn.004e5410], 0x5437cc
mov dword [ebp - method.virtual_thunk_to_std::__cxx11::basic_stringstream_char__std::char_traits_char___std::allocator_char___.basic_stringstream__], 0x5437f4
mov dword [ebp - fcn.00500b30], 0x5437e0
mov dword [ebp - fcn.004c73f0], vtable.c_streambufIwSt11char_traitsIwEE.0
mov dword [ebp - 0x1dc], 0
mov dword [ebp - 0x1d8], 0
mov dword [ebp - 0x1d4], 0
mov dword [ebp - 0x1d0], 0
mov dword [ebp - 0x1cc], 0
mov dword [ebp - 0x1c8], 0
call method.std::locale.locale__
lea eax, [ebp - 0x1b4]
mov dword [ebp - fcn.004dfe70], 0x5435a0
lea ecx, [ebp - 0x1a4]
mov dword [ebp - 0x1bc], eax
lea eax, [ebp - 0x1e0]
mov dword [ebp - 0x1c0], 0x18
mov dword [ebp - 0x1b8], 0
mov byte [ebp - 0x1b4], 0
mov dword [esp], eax
call method.std::basic_ios_char__std::char_traits_char___.init_std::basic_streambuf_char__std::char_traits_char____
mov eax, dword [ebp - 0x1e4]
sub esp, 4
mov esi, dword [eax - 0xc]
add esi, ebx
cmp byte [esi + 0x75], 0
mov edx, esi
je 0x404bd0
mov byte [esi + 0x74], 0x30
mov ecx, ebx
mov dword [edx + 8], 8
mov edx, dword [eax - 0xc]
add edx, ebx
mov eax, dword [edx + 0xc]
and eax, 0xffffffb5
or eax, 0x4008
mov dword [edx + 0xc], eax
mov dword [esp], edi
call method.std::ostream_std::ostream._M_insert_unsigned_long__unsigned_long_
mov ebx, dword [ebp - 0x1cc]
lea esi, [ebp - 0x214]
sub esp, 4
mov dword [ebp - 0x218], 0
mov dword [ebp - 0x21c], esi
mov byte [ebp - 0x214], 0
test ebx, ebx
je 0x404d50
mov eax, dword [ebp - 0x1d4]
mov edx, ebx
mov edi, dword [ebp - 0x1d0]
cmp eax, ebx
cmovae ebx, eax
test eax, eax
cmove ebx, edx
sub ebx, edi
js 0x404f72
cmp ebx, 0xf
ja 0x404d98
lea eax, [ebp - 0x21c]
mov dword [ebp - 0x230], eax
cmp edi, esi
je sym.checkPatcher____clone_.cold_
test ebx, ebx
jne 0x404b30
mov ecx, esi
mov dword [ebp - 0x218], ebx
mov byte [ecx + ebx], 0
lea ebx, [ebp - 0x204]
mov dword [esp], ebx
call sym.downloadPatcherInfo_abi:cxx11___
mov eax, dword [ebp - 0x204]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x21c]
mov dword [esp], str._Check_Patcher__File:_0x_s__Online:_0x_s
mov dword [esp + 4], eax
call sym.Log_char_const__..._
mov eax, dword [ebp - 0x200]
cmp eax, dword [ebp - 0x218]
je 0x404bf8
mov dword [esp], str._Check_Patcher__Checksums_do_not_match
call sym.Log_char_const__..._
mov eax, dword [ebp - 0x22c]
test eax, eax
jne 0x404cf0
call sym.downloadPatcher__
test eax, eax
je 0x404e58
mov dword [esp + 4], str.__new
mov dword [esp], str.NewPatcher.exe
call sym.StartProcess_char__char_
mov dword [ebp - 0x22c], 1
mov edi, dword [ebp - 0x204]
lea esi, [esi]
nop
lea eax, [ebp - 0x1fc]
cmp edi, eax
je 0x4049a7
mov eax, dword [ebp - 0x1fc]
mov dword [esp], edi
add eax, 1
mov dword [esp + 4], eax
call sym.operator_delete_void__unsigned_int_
mov edx, dword [ebp - 0x21c]
cmp edx, esi
je 0x4049c6
mov eax, dword [ebp - 0x214]
mov dword [esp], edx
add eax, 1
mov dword [esp + 4], eax
call sym.operator_delete_void__unsigned_int_
mov edx, dword [ebp - 0x1bc]
lea eax, [ebp - 0x1b4]
mov dword [ebp - fcn.004e5410], 0x5437cc
mov dword [ebp - method.virtual_thunk_to_std::__cxx11::basic_stringstream_char__std::char_traits_char___std::allocator_char___.basic_stringstream__], 0x5437f4
mov dword [ebp - fcn.00500b30], 0x5437e0
mov dword [ebp - fcn.004dfe70], 0x5435a0
cmp edx, eax
je 0x404a13
mov eax, dword [ebp - 0x1b4]
mov dword [esp], edx
add eax, 1
mov dword [esp + 4], eax
call sym.operator_delete_void__unsigned_int_
mov dword [ebp - fcn.004c73f0], vtable.c_streambufIwSt11char_traitsIwEE.0
lea ecx, [ebp - 0x1c4]
call fcn.004d3bc0
mov eax, dword [0x542c64]
mov edi, dword [0x542c78]
lea ecx, [ebp - 0x1a4]
mov esi, dword [0x542c74]
mov eax, dword [eax - 0xc]
mov dword [ebp + eax - 0x1ec], edi
mov eax, dword [0x542c70]
mov edi, dword [0x542c6c]
mov dword [ebp - 0x1e4], eax
mov eax, dword [eax - 0xc]
mov dword [ebp + eax - 0x1e4], esi
mov eax, dword [0x542c68]
mov dword [ebp - 0x1ec], eax
mov eax, dword [eax - 0xc]
mov dword [ebp + eax - 0x1ec], edi
mov dword [ebp - 0x1e8], 0
mov dword [ebp - fcn.004f2350], 0x544aac
call method.std::ios_base.ios_base__
mov eax, dword [ebp - 0x22c]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp], str.NewPatcher.exe
call dword [sym.imp.KERNEL32.dll_DeleteFileA]
sub esp, 4
mov dword [esp + 4], ebx
mov dword [esp], str._Check_Patcher__Command_Line:__s
call sym.Log_char_const__..._
mov dword [esp + 4], esi
mov dword [esp], str._Check_Patcher__FileName:__s
call sym.Log_char_const__..._
mov dword [esp + 4], str.Patcher.exe
mov dword [esp], esi
call sym._strstr
mov dword [ebp - 0x22c], 0
test eax, eax
jne 0x404637
mov dword [esp + 0xc], 0x30
mov dword [esp + 8], 0x514c97
mov dword [esp + 4], str.Rename_to_Patcher.exe_n
mov dword [esp], 0
call dword [sym.imp.USER32.dll_MessageBoxA]
mov dword [ebp - 0x22c], 1
sub esp, 0x10
jmp 0x404a92
cmp ebx, 1
je 0x404d40
mov dword [esp + 8], ebx
mov dword [esp + 4], edi
mov dword [esp], esi
call sym._memcpy
jmp 0x4048ec
movzx eax, byte [ebp - 0x11c]
mov byte [ebp - 0x1e4], al
jmp 0x404675
mov edi, eax
lea eax, [eax + 1]
mov dword [esp], eax
call sym.operator_new_unsigned_int_
mov dword [ebp - 0x1e4], edi
mov dword [ebp - 0x1ec], eax
mov ecx, eax
mov edx, dword [ebp - 0x230]
cmp edx, 4
jb 0x404c80
mov eax, dword [ebp - 0x11c]
lea edi, [ecx + 4]
and edi, 0xfffffffc
mov dword [ecx], eax
mov edx, dword [ebp - 0x230]
mov eax, dword [ebp + edx - 0x120]
mov dword [ecx + edx - 4], eax
sub ecx, edi
sub esi, ecx
add ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov eax, dword [ebp - 0x1ec]
jmp 0x404677
mov ecx, dword [esi + 0x7c]
mov dword [ebp - 0x230], ecx
test ecx, ecx
je 0x404f8a
cmp byte [ecx + 0x1c], 0
je 0x404cb8
mov byte [esi + 0x75], 1
jmp 0x404851
mov edx, dword [ebp - 0x21c]
mov edi, dword [ebp - 0x204]
test eax, eax
je 0x404c20
mov dword [esp + 8], eax
mov dword [esp + 4], edx
mov dword [esp], edi
call sym._memcmp
test eax, eax
jne 0x404938
mov edx, dword [ebp - 0x22c]
test edx, edx
je 0x404988
mov dword [esp], str._Check_Patcher__Updating_Patcher.exe
call sym.Log_char_const__..._
mov dword [esp + 8], 0
mov dword [esp + 4], str.Patcher.exe
mov dword [esp], str.NewPatcher.exe
call dword [sym.imp.KERNEL32.dll_CopyFileA]
mov edi, dword [sym.imp.KERNEL32.dll_GetLastError]
sub esp, 0xc
call edi
test eax, eax
jne 0x404d28
mov dword [ebp - 0x22c], 0
mov edi, dword [ebp - 0x204]
jmp 0x404988
test edx, edx
je 0x404bbc
movzx eax, byte [ebp - 0x11c]
and edx, 2
mov byte [ecx], al
je 0x404bbc
mov esi, dword [ebp - 0x230]
movzx eax, word [ebp + esi - 0x11e]
mov word [ecx + esi - 2], ax
jmp 0x404bbc
call method.std::ctype_char_._M_widen_init___const
mov ecx, dword [ebp - 0x230]
mov eax, dword [ecx]
mov eax, dword [eax + 0x18]
cmp eax, method.std::ctype_char_.do_widen_char__const
jne 0x404f50
mov eax, dword [ebp - 0x1e4]
mov edx, dword [eax - 0xc]
mov byte [esi + 0x75], 1
add edx, ebx
jmp 0x404851
mov dword [esp + 0xc], 0x30
mov dword [esp + 8], 0x514c97
mov dword [esp + 4], str.Corrupted_New_Patcher_n
mov dword [esp], 0
call dword [sym.imp.USER32.dll_MessageBoxA]
sub esp, 0x10
mov edi, dword [ebp - 0x204]
jmp 0x404988
call edi
mov dword [esp + 4], eax
mov dword [esp], str._Check_Patcher__Patcher_Copy_Error__d
call sym.Log_char_const__..._
jmp 0x404d18
movzx eax, byte [edi]
mov byte [ebp - 0x214], al
jmp 0x4048ec
mov ebx, dword [ebp - 0x1b8]
cmp ebx, 0xf
ja 0x404e98
test ebx, ebx
jne 0x404d78
mov eax, esi
mov dword [ebp - 0x218], ebx
mov byte [eax + ebx], 0
jmp 0x4048f8
mov eax, dword [ebp - 0x1bc]
cmp ebx, 1
jne 0x404f20
movzx eax, byte [eax]
mov byte [ebp - 0x214], al
jmp 0x404d63
cmp ebx, 0x1d
ja 0x404e30
mov dword [ebp - 0x234], 0x1e
mov eax, 0x1f
mov dword [esp], eax
lea eax, [ebp - 0x21c]
mov dword [ebp - 0x230], eax
call sym.operator_new_unsigned_int_
mov ecx, eax
test edi, edi
je 0x404de6
mov dword [esp + 8], ebx
mov dword [esp + 4], edi
mov dword [esp], eax
mov dword [ebp - 0x230], eax
call sym._memcpy
mov ecx, dword [ebp - 0x230]
mov edx, dword [ebp - 0x21c]
cmp edx, esi
je 0x404e11
mov eax, dword [ebp - 0x214]
mov dword [ebp - 0x230], ecx
mov dword [esp], edx
add eax, 1
mov dword [esp + 4], eax
call sym.operator_delete_void__unsigned_int_
mov ecx, dword [ebp - 0x230]
mov eax, dword [ebp - 0x234]
mov dword [ebp - 0x21c], ecx
mov dword [ebp - 0x214], eax
jmp 0x4048ee
mov eax, ebx
mov dword [ebp - 0x234], ebx
add eax, 1
jns 0x404db0
lea eax, [ebp - 0x21c]
mov dword [ebp - 0x230], eax
call method.std.__throw_bad_alloc__
lea esi, [esi]
mov dword [esp + 0xc], 0x30
mov dword [esp + 8], 0x514c97
mov dword [esp + 4], str.Failed_to_update_patcher_n
mov dword [esp], 0
call dword [sym.imp.USER32.dll_MessageBoxA]
mov dword [ebp - 0x22c], 1
mov edi, dword [ebp - 0x204]
sub esp, 0x10
jmp 0x404988
test ebx, ebx
js 0x404f8f
cmp ebx, 0x1d
jbe 0x404f40
mov eax, ebx
mov edi, ebx
add eax, 1
js 0x404f61
mov dword [esp], eax
lea eax, [ebp - 0x21c]
mov dword [ebp - 0x230], eax
call sym.operator_new_unsigned_int_
mov edx, dword [ebp - 0x21c]
mov ecx, eax
cmp edx, esi
je 0x404ef7
mov dword [ebp - 0x230], eax
mov eax, dword [ebp - 0x214]
mov dword [esp], edx
add eax, 1
mov dword [esp + 4], eax
call sym.operator_delete_void__unsigned_int_
mov ecx, dword [ebp - 0x230]
mov dword [ebp - 0x21c], ecx
mov eax, dword [ebp - 0x1bc]
mov dword [ebp - 0x214], edi
jmp 0x404f22
mov ecx, ebx
jmp 0x404b83
mov ecx, esi
mov dword [esp + 8], ebx
mov dword [esp + 4], eax
mov dword [esp], ecx
call sym._memcpy
mov eax, dword [ebp - 0x21c]
jmp 0x404d65
mov edi, 0x1e
mov eax, 0x1f
jmp 0x404eb6
mov dword [esp], 0x20
call eax
sub esp, 4
jmp 0x404cd3
lea eax, [ebp - 0x21c]
mov dword [ebp - 0x230], eax
call method.std.__throw_bad_alloc__
lea eax, [ebp - 0x21c]
mov dword [esp], 0x5141ca
mov dword [ebp - 0x230], eax
call method.std.__throw_length_error_char_const_
call method.std.__throw_bad_cast__
lea eax, [ebp - 0x21c]
mov dword [esp], 0x514195
mov dword [ebp - 0x230], eax
call method.std.__throw_length_error_char_const_
mov ebx, eax
jmp 0x503039
mov dword [ebp - fcn.004f2350], 0x544aac
lea ecx, [ebp - 0x1a4]
call method.std::ios_base.ios_base__
mov dword [esp], ebx
call sym.__Unwind_Resume
mov ecx, dword [ebp - 0x230]
mov ebx, eax
call method.std::__cxx11::basic_string_char__std::char_traits_char___std::allocator_char___._M_dispose__
lea ecx, [ebp - 0x1ec]
call fcn.004e5410
mov dword [esp], ebx
call sym.__Unwind_Resume
lea ecx, [ebp - 0x1ec]
call method.std::__cxx11::basic_string_char__std::char_traits_char___std::allocator_char___._M_dispose__
mov dword [esp], ebx
call sym.__Unwind_Resume
mov ecx, ebx
mov ebx, esi
call method.std::__cxx11::basic_string_char__std::char_traits_char___std::allocator_char___._M_dispose__
lea ecx, [ebp - 0x21c]
call method.std::__cxx11::basic_string_char__std::char_traits_char___std::allocator_char___._M_dispose__
jmp 0x503063