Function at 0x402142
Capabilities:
Read .ini file
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c0
push ebx
push esi
push edi
push 0x40
xor ebx, ebx
pop ecx
xor eax, eax
lea edi, [ebp - 0x1bb]
mov byte [ebp - 0x1bc], bl
push 0x40
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
pop ecx
xor eax, eax
lea edi, [ebp - 0x2bf]
mov byte [ebp - 0x2c0], bl
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
push 0x1f
xor eax, eax
pop ecx
lea edi, [ebp - 0xb7]
mov byte [ebp - 0xb8], bl
push dword [ebp + 8]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [ebp - 0x2c0]
push str._s007Patch.ini
push eax
mov dword [ebp - 0x14], ebx
mov dword [ebp - 0xc], ebx
mov dword [ebp - 0x10], ebx
mov dword [ebp - 0x18], ebx
call fcn.0041172e
add esp, 0xc
lea eax, [ebp - 0x2c0]
push eax
push ebx
push str.Patch1
push str.MAIN
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileIntA]
cmp eax, 1
je 0x40243c
push dword [ebp + 0xc]
lea eax, [ebp - 0x1bc]
push str._sMir3GMP.mpd
push eax
call fcn.0041172e
add esp, 0xc
lea eax, [ebp - 0x1bc]
push ebx
push 0x80
push 3
push ebx
push ebx
push SysReAllocString
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov edi, eax
cmp edi, 0xffffffff
mov dword [ebp + 0xc], edi
je 0x402449
mov esi, dword [sym.imp.KERNEL32.dll_ReadFile]
lea eax, [ebp - 0xc]
push ebx
push eax
lea eax, [ebp - 0xb8]
push 0x18
push eax
push edi
call esi
test eax, eax
jne 0x40223e
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x402449
push 0x18
lea eax, [ebp - 0xb8]
push str.007_Mir3_Map_Patch_File
push eax
call fcn.00411880
add esp, 0xc
test eax, eax
jne 0x402232
lea eax, [ebp - 0xc]
push ebx
push eax
lea eax, [ebp - 0x18]
push 2
push eax
push edi
call esi
test eax, eax
je 0x402232
cmp word [ebp - 0x18], 5
jne 0x402232
lea eax, [ebp - 0x24]
mov dword [ebp - 4], ebx
mov dword [ebp - 8], eax
lea edi, [ebp - 0x38]
lea eax, [ebp - 0xc]
push ebx
push eax
push 4
push edi
push dword [ebp + 0xc]
call esi
test eax, eax
je 0x4022f2
mov eax, dword [edi]
push ebx
add dword [ebp - 0x10], eax
lea eax, [ebp - 0xc]
push eax
push 2
push dword [ebp - 8]
push dword [ebp + 0xc]
call esi
test eax, eax
je 0x4022f2
inc dword [ebp - 4]
add dword [ebp - 8], 2
add edi, 4
cmp dword [ebp - 4], 5
jl 0x40227d
push dword [ebp + 8]
lea eax, [ebp - 0x1bc]
push str._smmap.wil
push eax
call fcn.0041172e
add esp, 0xc
mov edi, 0xc0000000
lea eax, [ebp - 0x1bc]
push ebx
push 0x80
push 3
push ebx
push ebx
push edi
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp - 4], eax
jne 0x4022fa
push dword [ebp + 0xc]
jmp 0x402233
mov eax, dword [ebp - 0x10]
inc eax
push eax
call fcn.00411622
cmp eax, ebx
pop ecx
mov dword [ebp - 8], eax
jne 0x40231f
push dword [ebp + 0xc]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push dword [ebp - 4]
jmp 0x402447
lea ecx, [ebp - 0xc]
push ebx
push ecx
push dword [ebp - 0x10]
push eax
push dword [ebp + 0xc]
call esi
test eax, eax
jne 0x40233c
push dword [ebp - 8]
call fcn.00411870
pop ecx
jmp 0x40230c
push dword [ebp + 0xc]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push 2
push ebx
push ebx
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [ebp - 0x14], eax
lea eax, [ebp - 0xc]
push ebx
push eax
push dword [ebp - 0x10]
push dword [ebp - 8]
push dword [ebp - 4]
call dword [sym.imp.KERNEL32.dll_WriteFile]
push dword [ebp - 8]
test eax, eax
jne 0x40237a
call fcn.00411870
pop ecx
jmp 0x402317
call fcn.00411870
pop ecx
push dword [ebp - 4]
call esi
push dword [ebp + 8]
lea eax, [ebp - 0x1bc]
push str._smmap.wix
push eax
call fcn.0041172e
add esp, 0xc
lea eax, [ebp - 0x1bc]
push ebx
push 0x80
push 3
push ebx
push ebx
push edi
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileA]
cmp eax, 0xffffffff
mov dword [ebp + 8], eax
je 0x402449
lea eax, [ebp - 0x24]
lea edi, [ebp - 0x38]
mov dword [ebp - 4], ebx
mov dword [ebp + 0xc], eax
sub edi, 4
mov eax, dword [ebp + 0xc]
push ebx
push ebx
movzx eax, word [eax]
lea eax, [eax*4 + 0x18]
push eax
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp dword [ebp - 4], 1
jl 0x4023f3
mov eax, dword [edi]
add dword [ebp - 0x14], eax
lea eax, [ebp - 0xc]
push ebx
push eax
lea eax, [ebp - 0x14]
push 4
push eax
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x402444
inc dword [ebp - 4]
add dword [ebp + 0xc], 2
add edi, 4
cmp dword [ebp - 4], 5
jl 0x4023cf
push dword [ebp + 8]
call esi
lea eax, [ebp - 0x2c0]
push eax
push 0x41e380
push str.Patch1
push str.MAIN
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringA]
push 1
pop eax
pop edi
pop esi
pop ebx
leave
ret
push dword [ebp + 8]
call esi
xor eax, eax
jmp 0x40243f