Function at 0x476e20
Capabilities:
Read .ini file
Terminate process
Write file on windows

Disassembly:
mov eax, dword fs:[0]
mov ecx, dword [esp + 4]
push 0xffffffffffffffff
push 0x72afc1
push eax
mov dword fs:[0], esp
sub esp, 0x540
push ebp
push esi
push edi
lea eax, [esp + 0x560]
push eax
push ecx
lea edx, [esp + 0x40]
push edx
call dword [sym.imp.MSVCRT.dll_vsprintf]
add esp, 0xc
push 0
push 0x80
push 4
push 0
push 0
push 0xc0000000
push str.Warnings.txt
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov esi, eax
or ebp, 0xffffffff
cmp esi, ebp
je 0x476eb4
push 2
push 0
push 0
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea eax, [esp + 0x1c]
push eax
xor eax, eax
lea edi, [esp + 0x40]
mov ecx, ebp
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
lea ecx, [esp + 0x44]
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov ecx, dword [0x7c67e0]
test ecx, ecx
je 0x477398
mov edx, dword [0x7c67dc]
test edx, edx
je 0x476f69
mov esi, dword [ecx]
test esi, esi
je 0x476f69
mov eax, dword [edx + 0xc0]
test eax, eax
je 0x476f69
fld dword [eax + 0x34]
fcomp dword [0x7464b8]
fnstsw ax
test ah, 0x40
je 0x476f69
mov al, byte [esi + 0xb376]
test al, al
jne 0x476f69
mov al, byte [esi + 0xb375]
test al, al
jne 0x476f69
call fcn.0048e350
test eax, eax
je 0x476f5d
mov al, byte [0x7c8f70]
test al, al
jne 0x476f46
push str..Morrowind.ini
push 0x64
push 0x7c8b14
push str.Restore
push str.restore
push str.SaveNames
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringA]
mov byte [0x7c8f70], 1
mov edx, dword [0x7c67e0]
mov ecx, dword [edx]
push 0x7c8b14
push 0x7c8b14
call fcn.004c4250
mov ecx, dword [0x7c67e0]
mov edx, dword [0x7c67dc]
test ecx, ecx
je 0x477398
test edx, edx
je 0x477398
mov eax, dword [edx + 0x30]
test eax, eax
je 0x477398
mov eax, dword [edx + 0x2e4]
test eax, eax
je 0x477398
mov eax, dword [edx + 0x40]
test eax, eax
je 0x477398
mov ecx, dword [edx + 0x50]
push 0
lea eax, [esp + 0x18]
push eax
call fcn.004773d0
mov ecx, dword [esp + 0x14]
test ecx, ecx
mov esi, dword [eax]
je 0x476fbb
call fcn.00404630
test esi, esi
je 0x477398
mov ecx, dword [0x7c67dc]
mov eax, dword [ecx + 0xc0]
test eax, eax
je 0x476fe7
fld dword [eax + 0x34]
fcomp dword [0x746468]
fnstsw ax
test ah, 0x40
jne 0x477398
mov edx, dword [0x7c67e0]
mov esi, dword [edx + 0xb4fc]
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp eax, esi
je 0x477398
mov eax, dword [0x7c67dc]
mov ecx, dword [eax + 0x4c]
mov edi, dword [ecx]
mov eax, dword [0x7c6cdc]
shr edi, 3
and edi, 1
test eax, eax
mov dword [esp + 0x18], edi
mov byte [esp + 0xd], 0
mov dword [esp + 0x14], 0
je 0x477089
mov esi, dword [eax + 0x108]
test esi, esi
je 0x477089
mov ecx, dword [esi + 4]
test ecx, ecx
je 0x477058
call fcn.006b6e20
cmp eax, 2
je 0x477063
mov ecx, dword [esi + 4]
call fcn.006b6e20
cmp eax, 3
je 0x477063
mov eax, dword [0x7c6cdc]
mov eax, dword [eax + 0x108]
cmp dword [eax], 2
jne 0x477089
mov eax, dword [0x7c67dc]
test eax, eax
je 0x477089
mov eax, dword [eax + 0xc0]
test eax, eax
je 0x477089
mov edx, dword [eax + 0x34]
mov byte [esp + 0xd], 1
mov dword [esp + 0x14], edx
mov dword [eax + 0x34], 0
test edi, edi
jne 0x47709c
mov eax, dword [0x7c67dc]
mov ecx, dword [eax + 0x4c]
push 1
call fcn.00406ba0
mov edx, dword [0x7c67dc]
push ebx
lea ecx, [esp + 0x14]
push ecx
mov ecx, dword [edx + 0x50]
call fcn.004090e0
mov eax, dword [eax]
mov edx, dword [eax + 0x18]
mov eax, dword [esp + 0x14]
test edx, edx
sete bl
test eax, eax
je 0x4770dd
mov esi, dword [eax + 4]
mov ecx, eax
add eax, 4
dec esi
mov edx, esi
test edx, edx
mov dword [eax], esi
jne 0x4770dd
test ecx, ecx
je 0x4770dd
mov eax, dword [ecx]
push 1
call dword [eax]
test bl, bl
je 0x4771e4
mov edx, dword [0x7c67dc]
lea ecx, [esp + 0x14]
push ecx
mov ecx, dword [edx + 0x50]
call fcn.004090e0
mov ecx, dword [0x7c67dc]
mov eax, dword [eax]
mov ecx, dword [ecx + 0x188]
mov edx, dword [ecx]
push 0
push eax
mov dword [esp + 0x560], 0
call dword [edx + 0x94]
mov eax, dword [esp + 0x14]
test eax, eax
mov dword [esp + 0x558], ebp
je 0x477146
mov esi, dword [eax + 4]
mov ecx, eax
add eax, 4
dec esi
mov edx, esi
test edx, edx
mov dword [eax], esi
jne 0x477146
test ecx, ecx
je 0x477146
mov eax, dword [ecx]
push 1
call dword [eax]
mov edx, dword [0x7c67dc]
lea ecx, [esp + 0x14]
push ecx
mov ecx, dword [edx + 0x50]
call fcn.004090e0
mov ecx, dword [eax]
mov dword [esp + 0x558], 1
call fcn.006eb0e0
mov eax, dword [esp + 0x14]
test eax, eax
mov dword [esp + 0x558], ebp
je 0x477195
mov esi, dword [eax + 4]
mov ecx, eax
add eax, 4
dec esi
mov edx, esi
test edx, edx
mov dword [eax], esi
jne 0x477195
test ecx, ecx
je 0x477195
mov eax, dword [ecx]
push 1
call dword [eax]
mov edx, dword [0x7c67dc]
lea ecx, [esp + 0x14]
push ecx
mov ecx, dword [edx + 0x50]
call fcn.004090e0
mov ecx, dword [eax]
mov dword [esp + 0x558], 2
call fcn.006eb380
mov eax, dword [esp + 0x14]
test eax, eax
mov dword [esp + 0x558], ebp
je 0x4771e4
mov esi, dword [eax + 4]
mov ecx, eax
add eax, 4
dec esi
mov edx, esi
test edx, edx
mov dword [eax], esi
jne 0x4771e4
test ecx, ecx
je 0x4771e4
mov eax, dword [ecx]
push 1
call dword [eax]
push 0x40
call dword [sym.imp.USER32.dll_MessageBeep]
push 0
lea ecx, [esp + 0x40]
push 0x789a68
push ecx
call fcn.005f1aa0
mov eax, dword [0x7c67dc]
mov bl, byte [eax + 0xd6]
mov dl, byte [eax + 0xd4]
mov cl, byte [eax + 0xd5]
add esp, 0xc
test bl, bl
mov byte [esp + 0x12], dl
mov byte [esp + 0x13], cl
jne 0x477249
push 0
mov byte [eax + 0xd5], bl
call fcn.00595230
call fcn.00594d80
push 0
call fcn.00595230
add esp, 8
call fcn.00594d80
mov eax, dword [0x7c67dc]
mov ecx, dword [eax + 0x50]
call fcn.004088c0
mov edx, dword [0x7c67dc]
mov ecx, dword [edx + 0x50]
push 0
push 0
call fcn.00408620
mov eax, dword [0x7c67dc]
mov ecx, dword [eax + 0x2e4]
mov ecx, dword [ecx + 0x10]
push 1
call fcn.0058e190
movzx edx, word [0x7d492c]
push edx
call fcn.00595370
pop ecx
test eax, eax
je 0x477297
mov ecx, dword [eax + 0x28]
push 0
push ecx
mov ecx, eax
call fcn.00583300
call fcn.005f2160
cmp eax, ebp
jne 0x477329
mov esi, dword [sym.imp.USER32.dll_PeekMessageA]
mov edi, dword [sym.imp.USER32.dll_TranslateMessage]
mov ebp, dword [sym.imp.USER32.dll_DispatchMessageA]
mov ecx, dword [0x7c67dc]
call fcn.00453630
mov edx, dword [0x7c67dc]
mov ecx, dword [edx + 0x4c]
test ecx, ecx
je 0x4772d3
call fcn.004065e0
push 1
push 0
push 0
push 0
lea eax, [esp + 0x30]
push eax
call esi
test eax, eax
je 0x4772f4
lea ecx, [esp + 0x20]
push ecx
call edi
lea edx, [esp + 0x20]
push edx
call ebp
call fcn.00594d80
mov eax, dword [0x7c67dc]
mov ecx, dword [eax + 0x2e4]
mov ecx, dword [ecx + 0x10]
push 1
call fcn.0058e190
mov ecx, dword [0x7c6cdc]
push 2
call fcn.0041be90
call fcn.005f2160
cmp eax, 0xffffffff
je 0x4772b6
mov edi, dword [esp + 0x1c]
call fcn.005f1f90
mov edx, dword [0x7c67dc]
mov cl, byte [esp + 0x12]
mov byte [edx + 0xd6], bl
mov eax, dword [0x7c67dc]
mov byte [eax + 0xd4], cl
mov edx, dword [0x7c67dc]
mov al, byte [esp + 0x13]
test bl, bl
mov byte [edx + 0xd5], al
pop ebx
jne 0x477368
push 0
call fcn.00595270
add esp, 4
test edi, edi
jne 0x47737b
mov ecx, dword [0x7c67dc]
mov ecx, dword [ecx + 0x4c]
push edi
call fcn.00406ba0
mov al, byte [esp + 0xd]
test al, al
je 0x4773af
mov edx, dword [0x7c67dc]
mov eax, dword [edx + 0xc0]
mov ecx, dword [esp + 0x14]
mov dword [eax + 0x34], ecx
jmp 0x4773af
push 0x1010
push str.Error
lea edx, [esp + 0x40]
push edx
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
push 0
call dword [sym.imp.KERNEL32.dll_ExitProcess]