Function at 0x477400
Capabilities:
Print debug messages
Read .ini file
Terminate process
Write file on windows

Disassembly:
mov eax, dword fs:[0]
mov ecx, dword [esp + 4]
push 0xffffffffffffffff
push 0x72aff1
push eax
mov dword fs:[0], esp
sub esp, 0x548
push ebx
push ebp
push esi
push edi
lea eax, [esp + 0x56c]
push eax
push ecx
lea edx, [esp + 0x4c]
push edx
call dword [sym.imp.MSVCRT.dll_vsprintf]
or ebp, 0xffffffff
xor eax, eax
add esp, 0xc
lea edi, [esp + 0x44]
mov ecx, ebp
repne scasb al, byte es:[edi]
not ecx
dec ecx
lea eax, [esp + ecx + 0x44]
cmp byte [eax - 2], 0xd
jne 0x47745a
cmp byte [eax - 1], 0xa
je 0x477486
xor eax, eax
mov edi, 0x776ca0
mov ecx, ebp
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov ebx, ecx
mov esi, edi
lea edx, [esp + 0x44]
mov edi, edx
mov ecx, ebp
repne scasb al, byte es:[edi]
mov ecx, ebx
shr ecx, 2
dec edi
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
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
cmp esi, ebp
je 0x4774de
push 2
push 0
push 0
push esi
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 0
lea eax, [esp + 0x28]
push eax
xor eax, eax
lea edi, [esp + 0x4c]
mov ecx, ebp
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
lea ecx, [esp + 0x50]
push ecx
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push esi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
lea edx, [esp + 0x44]
push edx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov eax, dword [0x7c67e0]
test eax, eax
mov byte [esp + 0x12], 1
je 0x477522
mov cl, byte [eax + 0xb4dd]
test cl, cl
jne 0x477522
push str..Morrowind.ini
push 0
push str.AllowYesToAll
push str.General
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileIntA]
cmp eax, 1
je 0x477522
mov byte [esp + 0x12], 0
mov eax, dword [0x7c67e0]
xor bl, bl
test eax, eax
je 0x4775a7
mov eax, dword [0x7c67dc]
test eax, eax
je 0x4775a7
mov ecx, dword [eax + 0x30]
test ecx, ecx
je 0x4775a7
mov ecx, dword [eax + 0x2e4]
test ecx, ecx
je 0x4775a7
mov ecx, dword [eax + 0x40]
test ecx, ecx
je 0x4775a7
push 0
lea ecx, [esp + 0x24]
push ecx
mov ecx, dword [eax + 0x50]
call fcn.004773d0
mov esi, dword [eax]
mov eax, dword [esp + 0x20]
test eax, eax
je 0x477582
mov edi, dword [eax + 4]
mov ecx, eax
add eax, 4
dec edi
mov edx, edi
test edx, edx
mov dword [eax], edi
jne 0x477582
test ecx, ecx
je 0x477582
mov edx, dword [ecx]
push 1
call dword [edx]
test esi, esi
je 0x4775a7
mov eax, dword [0x7c67dc]
mov eax, dword [eax + 0xc0]
test eax, eax
je 0x4775a5
fld dword [eax + 0x34]
fcomp dword [0x746468]
fnstsw ax
test ah, 0x40
jne 0x4775a7
mov bl, 1
call fcn.00476cf0
xor eax, eax
mov edi, 0x776ca0
mov ecx, ebp
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
lea edx, [esp + 0x44]
mov edi, edx
mov edx, ecx
mov ecx, ebp
repne scasb al, byte es:[edi]
mov al, byte [esp + 0x12]
mov ecx, edx
shr ecx, 2
dec edi
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
test al, al
rep movsb byte es:[edi], byte [esi]
je 0x47761b
test bl, bl
lea edx, [esp + 0x44]
mov edi, 0x7c8d14
mov ecx, ebp
jne 0x477626
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
mov ecx, ebp
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edx, [esp + 0x44]
mov edi, str._Cancel_is__Yes_To_All_.
jmp 0x477624
lea edx, [esp + 0x44]
mov edi, 0x7c8d14
mov ecx, ebp
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
mov ecx, ebp
repne scasb al, byte es:[edi]
mov al, byte [0x7c8f71]
mov ecx, edx
shr ecx, 2
dec edi
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
test al, al
rep movsb byte es:[edi], byte [esi]
jne 0x477aed
mov al, byte [0x7c8f72]
test al, al
jne 0x477aed
test bl, bl
mov dword [esp + 0x1c], 0
je 0x477a9a
mov eax, dword [0x7c67e0]
mov esi, dword [eax + 0xb4fc]
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
cmp eax, esi
je 0x477a9a
mov ecx, dword [0x7c67dc]
mov edx, dword [ecx + 0x4c]
mov edi, dword [edx]
mov eax, dword [0x7c6cdc]
shr edi, 3
and edi, 1
test eax, eax
mov dword [esp + 0x24], edi
mov byte [esp + 0x13], 0
mov dword [esp + 0x20], 0
je 0x477713
mov esi, dword [eax + 0x108]
test esi, esi
je 0x477713
mov ecx, dword [esi + 4]
test ecx, ecx
je 0x4776e2
call fcn.006b6e20
cmp eax, 2
je 0x4776ed
mov ecx, dword [esi + 4]
call fcn.006b6e20
cmp eax, 3
je 0x4776ed
mov eax, dword [0x7c6cdc]
mov eax, dword [eax + 0x108]
cmp dword [eax], 2
jne 0x477713
mov eax, dword [0x7c67dc]
test eax, eax
je 0x477713
mov eax, dword [eax + 0xc0]
test eax, eax
je 0x477713
mov ecx, dword [eax + 0x34]
mov byte [esp + 0x13], 1
mov dword [esp + 0x20], ecx
mov dword [eax + 0x34], 0
test edi, edi
jne 0x477727
mov edx, dword [0x7c67dc]
mov ecx, dword [edx + 0x4c]
push 1
call fcn.00406ba0
mov ecx, dword [0x7c67dc]
mov ecx, dword [ecx + 0x50]
lea eax, [esp + 0x14]
push eax
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 0x477767
mov esi, dword [eax + 4]
mov ecx, eax
add eax, 4
dec esi
mov edx, esi
test edx, edx
mov dword [eax], esi
jne 0x477767
test ecx, ecx
je 0x477767
mov edx, dword [ecx]
push 1
call dword [edx]
test bl, bl
je 0x47786e
mov ecx, dword [0x7c67dc]
mov ecx, dword [ecx + 0x50]
lea eax, [esp + 0x14]
push eax
call fcn.004090e0
mov edx, dword [0x7c67dc]
mov eax, dword [eax]
mov ecx, dword [edx + 0x188]
mov edx, dword [ecx]
push 0
push eax
mov dword [esp + 0x568], 0
call dword [edx + 0x94]
mov eax, dword [esp + 0x14]
test eax, eax
mov dword [esp + 0x560], ebp
je 0x4777d0
mov esi, dword [eax + 4]
mov ecx, eax
add eax, 4
dec esi
mov edx, esi
test edx, edx
mov dword [eax], esi
jne 0x4777d0
test ecx, ecx
je 0x4777d0
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 + 0x560], 1
call fcn.006eb0e0
mov eax, dword [esp + 0x14]
test eax, eax
mov dword [esp + 0x560], ebp
je 0x47781f
mov esi, dword [eax + 4]
mov ecx, eax
add eax, 4
dec esi
mov edx, esi
test edx, edx
mov dword [eax], esi
jne 0x47781f
test ecx, ecx
je 0x47781f
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 + 0x560], 2
call fcn.006eb380
mov eax, dword [esp + 0x14]
test eax, eax
mov dword [esp + 0x560], ebp
je 0x47786e
mov esi, dword [eax + 4]
mov ecx, eax
add eax, 4
dec esi
mov edx, esi
test edx, edx
mov dword [eax], esi
jne 0x47786e
test ecx, ecx
je 0x47786e
mov eax, dword [ecx]
push 1
call dword [eax]
push 0x40
call dword [sym.imp.USER32.dll_MessageBeep]
mov al, byte [esp + 0x12]
test al, al
push 0
je 0x47789e
push str.Yes_To_All
push 0x7c8e58
lea ecx, [esp + 0x50]
push 0x7c8b7c
push ecx
call fcn.005f1aa0
add esp, 0x14
jmp 0x4778b5
push 0x7c8e58
lea edx, [esp + 0x4c]
push 0x7c8b7c
push edx
call fcn.005f1aa0
add esp, 0x10
mov eax, dword [0x7c67dc]
mov bl, byte [eax + 0xd6]
test bl, bl
mov cl, byte [eax + 0xd4]
mov dl, byte [eax + 0xd5]
mov byte [esp + 0x12], cl
mov byte [esp + 0x1b], dl
jne 0x4778fe
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 eax, dword [eax + 0x50]
mov ecx, dword [eax + 0x14]
mov dword [esp + 0x14], ecx
mov ecx, eax
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 0x477955
mov ecx, dword [eax + 0x28]
push 0
push ecx
mov ecx, eax
call fcn.00583300
call fcn.005f2160
cmp eax, ebp
jne 0x4779e7
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 0x477991
call fcn.004065e0
push 1
push 0
push 0
push 0
lea eax, [esp + 0x38]
push eax
call esi
test eax, eax
je 0x4779b2
lea ecx, [esp + 0x28]
push ecx
call edi
lea edx, [esp + 0x28]
push edx
call ebp
mov eax, dword [0x7c67dc]
mov ecx, dword [eax + 0x2e4]
mov ecx, dword [ecx + 0x10]
push 1
call fcn.0058e190
call fcn.00594d80
mov ecx, dword [0x7c6cdc]
push 2
call fcn.0041be90
call fcn.005f2160
cmp eax, 0xffffffff
je 0x477974
mov edi, dword [esp + 0x24]
call fcn.005f2160
sub eax, 0
je 0x477a0b
dec eax
je 0x477a01
dec eax
jne 0x477a13
mov dword [esp + 0x1c], 2
jmp 0x477a13
mov dword [esp + 0x1c], 7
jmp 0x477a13
mov dword [esp + 0x1c], 6
call fcn.005f2170
call fcn.005f1f90
test bl, bl
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 + 0x1b]
mov byte [edx + 0xd5], al
jne 0x477a56
push 0
call fcn.00595270
add esp, 4
mov ecx, dword [esp + 0x14]
mov edx, dword [0x7c67dc]
push 0
push ecx
mov ecx, dword [edx + 0x50]
call fcn.00408620
test edi, edi
jne 0x477a7d
mov eax, dword [0x7c67dc]
mov ecx, dword [eax + 0x4c]
push edi
call fcn.00406ba0
mov al, byte [esp + 0x13]
test al, al
je 0x477ace
mov ecx, dword [0x7c67dc]
mov edx, dword [ecx + 0xc0]
mov eax, dword [esp + 0x20]
mov dword [edx + 0x34], eax
jmp 0x477ace
mov al, byte [esp + 0x12]
test al, al
je 0x477ab3
push 0x1033
push str.Warning
lea ecx, [esp + 0x4c]
push ecx
jmp 0x477ac2
push 0x1034
push str.Warning
lea edx, [esp + 0x4c]
push edx
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
mov dword [esp + 0x1c], eax
mov eax, dword [esp + 0x1c]
cmp eax, 7
jne 0x477ae1
push 0
call dword [sym.imp.KERNEL32.dll_ExitProcess]
cmp eax, 2
jne 0x477aed
mov byte [0x7c8f72], 1
mov ecx, dword [esp + 0x558]
pop edi
pop esi
pop ebp
pop ebx
mov dword fs:[0], ecx
add esp, 0x554
ret