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

Disassembly:
sub esp, 0x530
lea eax, [esp + 4]
push ebx
push ebp
push esi
push edi
push eax
push 0x404564
call fcn.004016e0
add esp, 8
test eax, eax
jne 0x40147c
push 0x10
push str.Self_Executing_MPQ
jmp 0x4016b6
lea edx, [esp + 0x120]
push 0x104
lea ecx, [esp + 0x124]
push edx
push 0
mov dword [esp + 0x1c], ecx
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea eax, [esp + 0x18]
push eax
call fcn.00401780
add esp, 4
test eax, eax
jne 0x4014fd
mov ecx, dword [0x404564]
lea edx, [esp + 0x228]
add ecx, 0x88
push ecx
push str.Unable_to_locate__s_to_patch.
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
mov eax, dword [0x404564]
add esp, 0xc
add eax, 0x18
lea ecx, [esp + 0x228]
push 0x10
push eax
push ecx
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x530
ret 0x10
mov edx, dword [0x404564]
lea eax, [esp + 0x18]
add edx, 0x190
lea ecx, [esp + 0x438]
push edx
push eax
push str.__s___s
push ecx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
lea edx, [esp + 0x120]
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 0x40169b
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 [0x40456c], eax
call dword [sym.imp.KERNEL32.dll_CreateFileMappingA]
mov ebp, eax
cmp ebp, 0xffffffff
je 0x401694
push 0
push 0
push 0
push 4
push ebp
call dword [sym.imp.KERNEL32.dll_MapViewOfFile]
test eax, eax
mov dword [0x404568], eax
je 0x40168d
call fcn.004020e0
mov eax, dword [0x40456c]
mov ecx, dword [0x404568]
push eax
push ecx
call fcn.00402270
test eax, eax
mov dword [0x404570], eax
je 0x4016aa
push eax
call fcn.00402550
mov esi, eax
test esi, esi
je 0x4016aa
lea eax, [esi + esi*2]
shl eax, 3
sub eax, esi
lea edx, [eax + eax*2]
shl edx, 2
push edx
call sub.MSVCRT.dll_void____cdecl_operator_new_unsigned_int_
mov edi, eax
add esp, 4
test edi, edi
jne 0x4015f6
pop edi
pop esi
pop ebp
mov eax, 1
pop ebx
add esp, 0x530
ret 0x10
push esi
lea eax, [esp + 0x334]
push edi
push eax
call fcn.00401810
add esp, 0xc
test eax, eax
je 0x401655
mov ecx, dword [0x404564]
push 1
lea eax, [esp + 0x14]
mov edx, dword [ecx + 8]
lea ecx, [esp + 0x334]
push edx
push esi
push edi
push 1
push eax
lea edx, [esp + 0x450]
push ecx
lea eax, [esp + 0x34]
push edx
push eax
call section..text
add esp, 0x24
test eax, eax
jne 0x40166e
mov ecx, dword [0x404564]
push 0x30
add ecx, 0x18
push ecx
push str.The_patch_was_unsuccessful.
jmp 0x401666
mov edx, dword [0x404564]
push 0x30
add edx, 0x18
push edx
push str.Unable_to_perform_the_patch._This_SEMPQ_is_corrupted.
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
call fcn.00402140
call fcn.004020f0
push edi
call sub.MSVCRT.dll_void___cdecl_operator_delete_void__
mov eax, dword [0x404568]
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, 0x530
ret 0x10
mov ecx, dword [0x404564]
push 0x10
add ecx, 0x18
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, 0x530
ret 0x10