Function at 0x401d50
Capabilities:
Get file size
Read file via mapping

Disassembly:
sub esp, 0x740
lea edx, [esp + 4]
mov ecx, 0x40cfc4
push ebx
push ebp
push esi
push edi
call fcn.00402010
test eax, eax
jne 0x401d78
push 0x10
push str.Self_Executing_MPQ
jmp 0x401ff1
mov esi, dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea ecx, [esp + 0x228]
push 0x104
lea eax, [esp + 0x22c]
push ecx
push 0
mov dword [esp + 0x1c], eax
call esi
lea edx, [esp + 0x18]
push 0x104
push edx
push 0
call esi
lea eax, [esp + 0x18]
push eax
call dword [sym.imp.SHLWAPI.dll_PathRemoveFileSpecA]
mov eax, dword [0x40cfc4]
lea ecx, [esp + 0x120]
push ecx
lea edx, [esp + 0x64c]
lea ecx, [eax + 0x28]
call fcn.004019d0
test eax, eax
jne 0x401e16
lea ecx, [esp + 0x330]
push str.Unable_to_locate_the_target_to_patch.
push ecx
call fcn.00404ea7
mov edx, dword [0x40cfc4]
add esp, 8
add edx, 8
lea eax, [esp + 0x330]
push 0x10
push edx
push eax
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x740
ret 0x10
mov ecx, dword [0x40cfc4]
lea eax, [esp + 0x120]
mov edx, dword [ecx + 0x48]
lea ecx, [esp + 0x438]
push edx
push eax
push str.__s___s
push ecx
call fcn.00404ea7
add esp, 0x10
lea edx, [esp + 0x228]
push 0
push 0
push 3
push 0
push 1
push 0x80000000
push edx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x401fd6
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_GetFileSize]
push 0
push 0
push 0
push 2
push 0
push ebx
mov dword [0x40cfcc], eax
call dword [sym.imp.KERNEL32.dll_CreateFileMappingA]
mov ebp, eax
cmp ebp, 0xffffffff
je 0x401fcf
push 0
push 0
push 0
push 4
push ebp
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
test eax, eax
mov dword [0x40cfc8], eax
je 0x401fc8
call fcn.00404850
mov eax, dword [0x40cfcc]
mov ecx, dword [0x40cfc8]
push eax
push ecx
call fcn.004049d0
test eax, eax
mov dword [0x40cfd0], eax
je 0x401fe5
push eax
call fcn.00404cb0
mov esi, eax
test esi, esi
je 0x401fe5
lea eax, [esi + esi*2]
shl eax, 3
sub eax, esi
lea edx, [eax + eax*2]
shl edx, 2
push edx
call fcn.00404e99
mov edi, eax
add esp, 4
test edi, edi
jne 0x401f0e
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x740
ret 0x10
push esi
mov edx, edi
lea ecx, [esp + 0x544]
call fcn.00402110
test eax, eax
je 0x401f90
push 1
lea eax, [esp + 0x14]
push edi
push eax
mov eax, dword [0x40cfc4]
push esi
push 1
lea edx, [esp + 0x134]
mov ecx, dword [eax + 0x44]
push ecx
push edx
mov edx, dword [eax + 0x50]
lea ecx, [esp + 0x34]
push 0
push ecx
push edx
push 0
push 0
lea eax, [esp + 0x570]
push 0
push eax
push 0
push 0
push 0
push 0
push 0
push 0
push 0
push 0
lea edx, [esp + 0x490]
lea ecx, [esp + 0x6a0]
call section..text
test eax, eax
jne 0x401fa9
mov ecx, dword [0x40cfc4]
push 0x30
add ecx, 8
push ecx
push str.The_patch_was_unsuccessful.
jmp 0x401fa1
mov edx, dword [0x40cfc4]
push 0x30
add edx, 8
push edx
push str.Unable_to_perform_the_patch._This_SEMPQ_is_corrupted.
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
call fcn.004048a0
call fcn.00404860
push edi
call fcn.00404e8e
mov eax, dword [0x40cfc8]
add esp, 4
push eax
call dword [sym.imp.KERNEL32.dll_UnmapViewOfFile]
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
pop edi
pop esi
pop ebp
xor eax, eax
pop ebx
add esp, 0x740
ret 0x10
mov ecx, dword [0x40cfc4]
push 0x10
add ecx, 8
push ecx
push str.Unable_to_perform_the_patch._This_SEMPQ_is_corrupted.
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x740
ret 0x10