Function at 0x4021a0
Capabilities:
Check if file exists
Create process on windows
Delete file
Get file attributes
Hide graphical window
Query environment variable
Set file attributes

Disassembly:
push ebp
mov ebp, esp
add esp, 0xfffffff8
cmp byte [0x4044a4], 0
jne 0x4021c9
push 5
push dword [0x404460]
call sub.user32.dll_ShowWindow
push 0
push dword [0x404464]
call sub.user32.dll_ShowWindow
push 0
push 0
push 0x184
push dword [0x404460]
call sub.user32.dll_SendMessageA
push str.START_PATCHING
call fcn.00401330
push 0x404299
call fcn.00401330
call fcn.004011b0
push 1
push 3
call fcn.00401050
test eax, eax
je 0x4023a7
mov dword [ebp - 4], eax
jmp 0x402227
lea esp, [esp]
inc ecx
push ecx
push 3
call fcn.00401050
or eax, eax
je 0x402222
cmp eax, dword [ebp - 4]
jne 0x402227
jmp 0x4023a7
mov dword [ebp - 8], 0
mov ecx, dword [0x404424]
push ecx
mov esi, eax
lea eax, [esi + 0x22]
push str._OFFSET_PATCH_
call fcn.00401330
movzx ebx, byte [esi + 1]
push ebx
push dword [esi + 6]
push eax
call fcn.00401460
test eax, eax
je 0x40235d
mov eax, dword [esi + 2]
or eax, eax
je 0x402286
cmp dword [0x4048ad], eax
je 0x40227a
push str.Wrong_filesize_or_already_patched_
call fcn.00401330
jmp 0x40235d
push str.Filesize_OK_
call fcn.00401330
jmp 0x402290
push str.Filesize_check_skipped_
call fcn.00401330
cmp dword [esi + 0xa], 0
je 0x4022c9
push dword [0x4048b1]
push dword [0x4048ad]
call section..text
cmp dword [esi + 0xa], eax
je 0x4022bd
push str.CRC32_check_failed_
call fcn.00401330
jmp 0x40235d
push str.CRC32_check_OK_
call fcn.00401330
jmp 0x4022d3
push str.CRC32_check_skipped
call fcn.00401330
cmp byte [esi + 1], 1
jne 0x402322
mov eax, 0x22e
add eax, dword [0x404420]
push esi
push eax
push 3
push dword [0x4048b1]
call fcn.004026f0
or eax, eax
jne 0x40230f
push str.Inline_patch_failed_
call fcn.00401330
push dword [0x4048ad]
pop dword [0x4048b9]
jmp 0x402320
push str.Inline_patch_OK_
call fcn.00401330
mov dword [ebp - 8], 1
jmp 0x40235d
mov eax, dword [esi + 0x16]
lea esi, [eax + esi]
mov edi, dword [0x4048b1]
mov edi, edi
cmp dword [esi], 0
jne 0x40233c
cmp word [esi + 4], 0
je 0x40235d
lodsd eax, dword [esi]
xchg ecx, eax
lodsb al, byte [esi]
cmp byte [ecx + edi], al
je 0x402350
push str.Byte_not_found_File_is_already_patched_
call fcn.00401330
jmp 0x40235d
lodsb al, byte [esi]
mov byte [ecx + edi], al
mov dword [ebp - 8], 1
jmp 0x40232e
cmp dword [ebp - 8], 0
jne 0x40237b
push dword [0x4048ad]
pop dword [0x4048b9]
push str.nothing_patched_
call fcn.00401330
jmp 0x402385
push str.file_patched_
call fcn.00401330
push dword [ebp - 8]
call fcn.00401620
push str....done_
call fcn.00401330
push 0x404299
call fcn.00401330
pop ecx
jmp 0x40220c
push 1
push 4
call fcn.00401050
test eax, eax
je 0x4024f7
mov dword [ebp - 4], eax
jmp 0x4023d7
lea ecx, [ecx]
inc ecx
push ecx
push 4
call fcn.00401050
or eax, eax
je 0x4023d2
cmp eax, dword [ebp - 4]
jne 0x4023d7
jmp 0x4024f7
mov dword [ebp - 8], 0
mov ecx, dword [0x404424]
push ecx
mov esi, eax
lea eax, [esi + 0x22]
push str._SEARCH__REPLACE_PATCH_
call fcn.00401330
movzx ebx, byte [esi + 1]
push ebx
push dword [esi + 6]
push eax
call fcn.00401460
test eax, eax
je 0x4024b9
cmp byte [esi + 1], 1
jne 0x402459
mov eax, 0x22e
add eax, dword [0x404420]
push esi
push eax
push 4
push dword [0x4048b1]
call fcn.004026f0
or eax, eax
jne 0x402446
push str.Inline_patch_failed_
call fcn.00401330
push dword [0x4048ad]
pop dword [0x4048b9]
jmp 0x402457
push str.Inline_patch_OK_
call fcn.00401330
mov dword [ebp - 8], 1
jmp 0x4024b9
mov eax, dword [esi + 0x16]
lea esi, [eax + esi]
nop
mov ecx, dword [esi]
mov ebx, dword [esi + 4]
push ebx
push dword [0x4048ad]
push ecx
lea eax, [esi + ecx*2 + 8]
add eax, ecx
push eax
lea eax, [esi + ecx*2 + 8]
push eax
lea eax, [ecx + esi + 8]
push eax
lea eax, [esi + 8]
push eax
push dword [0x4048b1]
call fcn.00402830
pushal
test eax, eax
jne 0x4024a8
cmp dword [esi + ecx*4 + 8], 0
je 0x4024a5
push str.Cant_find_pattern_Trying_next_one...
call fcn.00401330
jmp 0x4024af
popal
jmp 0x4024b9
mov dword [ebp - 8], 1
popal
lea esi, [esi + ecx*4 + 8]
cmp dword [esi], 0
jne 0x40245f
cmp dword [ebp - 8], 0
jne 0x4024cb
push str.nothing_patched_
call fcn.00401330
jmp 0x4024d5
push str.file_patched_
call fcn.00401330
push dword [ebp - 8]
call fcn.00401620
push str....done_
call fcn.00401330
push 0x404299
call fcn.00401330
pop ecx
jmp 0x4023bd
push 1
push 5
call fcn.00401050
test eax, eax
je 0x4025b4
mov dword [ebp - 4], eax
xor esi, esi
jmp 0x402527
nop
inc ecx
push ecx
push 5
call fcn.00401050
or eax, eax
je 0x402522
cmp eax, dword [ebp - 4]
jne 0x402527
jmp 0x4025b4
mov ecx, dword [0x404424]
push ecx
mov esi, eax
lea eax, [esi + 9]
push str._REGISTRY_PATCH_
call fcn.00401330
push dword [esi + 1]
push eax
push str.c:_regpatch.reg
call fcn.00402c10
test eax, eax
je 0x40257a
mov edi, 0x4044a5
mov byte [edi], 0
push str.regedit.exe__s
push edi
call sub.kernel32.dll_lstrcatA
push str.c:_regpatch.reg
push edi
call sub.kernel32.dll_lstrcatA
push 0
push edi
call sub.kernel32.dll_WinExec
cmp eax, 0x1f
ja 0x402586
push str.Registry_patch_failed_
call fcn.00401330
jmp 0x402590
push str.Registry_patch_OK_
call fcn.00401330
push str.c:_regpatch.reg
call sub.kernel32.dll_DeleteFileA
push str....done_
call fcn.00401330
push 0x404299
call fcn.00401330
pop ecx
jmp 0x40250f
push 1
push 7
call fcn.00401050
test eax, eax
je 0x4026cc
mov dword [ebp - 4], eax
jmp 0x4025e7
lea ebx, [ebx]
inc ecx
push ecx
push 7
call fcn.00401050
or eax, eax
je 0x4025e2
cmp eax, dword [ebp - 4]
jne 0x4025e7
jmp 0x4026cc
mov ecx, dword [0x404424]
push ecx
mov esi, eax
lea edi, [esi + 0xd]
mov ebx, dword [esi + 5]
lea ebx, [ebx + esi]
push 0x200
push 0x4044a5
push edi
call sub.kernel32.dll_ExpandEnvironmentStringsA
mov edi, 0x4044a5
push str._EXPORT_FILE_
call fcn.00401330
push edi
call fcn.00401330
push edi
call sub.kernel32.dll_GetFileAttributesA
cmp eax, 0xffffffff
je 0x402671
cmp byte [0x404963], 0
jne 0x402647
push 0x24
push edi
push str.File_already_exist._Overwrite_
push dword [0x404444]
call sub.user32.dll_MessageBoxA
jmp 0x40265c
cmp byte [0x404965], 1
jne 0x402657
mov eax, 6
jmp 0x40265c
mov eax, 7
cmp eax, 6
jne 0x40266c
push 0x80
push edi
call sub.kernel32.dll_SetFileAttributesA
cmp eax, 7
je 0x4026b2
push dword [esi + 1]
push ebx
push edi
call fcn.00402c10
or eax, eax
jne 0x40268b
push str.Failed_to_export_file_
call fcn.00401330
jmp 0x4026b2
mov eax, dword [esi + 9]
or eax, eax
je 0x4026a8
push eax
push edi
call sub.kernel32.dll_SetFileAttributesA
cmp eax, 1
jne 0x4026a8
push str.set_file_attributes
call fcn.00401330
push str.File_export_OK_
call fcn.00401330
push str....done_
call fcn.00401330
push 0x404299
call fcn.00401330
pop ecx
jmp 0x4025ca
push str.PATCHING_DONE
call fcn.00401330
push 1
push 0
push 0
push dword [0x404444]
call sub.user32.dll_RedrawWindow
leave
ret