Function at 0x404682
Capabilities:
Manipulate console buffer
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x48
mov word [ebp - 0x1e], 0x24
mov word [ebp - 0x1c], 0xb
mov word [ebp - 0x1a], 0xd4
mov eax, dword [str.coal.dat]
mov dword [esp + 4], 0x40d4d6
mov dword [esp], eax
call sym._fopen
mov dword [ebp - 0xc], eax
mov eax, dword [ebp + 8]
mov dword [ebp - 0x18], eax
jmp 0x4046e8
mov eax, dword [ebp - 0xc]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 1
mov dword [esp + 4], 0x94
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
call sym._fwrite
mov eax, dword [ebp - 0x18]
mov eax, dword [eax + 0x90]
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
jne 0x4046ba
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call sym._fclose
mov eax, dword [str.prov.dat]
mov dword [esp + 4], 0x40d4d6
mov dword [esp], eax
call sym._fopen
mov dword [ebp - 0xc], eax
mov eax, dword [ebp + 8]
mov dword [ebp - 0x18], eax
jmp 0x404764
mov eax, dword [ebp - 0x18]
mov eax, dword [eax + 0x8c]
mov dword [ebp - 0x14], eax
jmp 0x404752
mov eax, dword [ebp - 0xc]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 1
mov dword [esp + 4], 0x40
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call sym._fwrite
mov eax, dword [ebp - 0x14]
mov eax, dword [eax + 0x3c]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jne 0x404727
mov eax, dword [ebp - 0x18]
mov eax, dword [eax + 0x90]
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
jne 0x404719
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call sym._fclose
mov eax, dword [str.gnrt.dat]
mov dword [esp + 4], 0x40d4d6
mov dword [esp], eax
call sym._fopen
mov dword [ebp - 0xc], eax
mov eax, dword [ebp + 8]
mov dword [ebp - 0x18], eax
jmp 0x4047fa
mov eax, dword [ebp - 0x18]
mov eax, dword [eax + 0x8c]
mov dword [ebp - 0x14], eax
jmp 0x4047e8
mov eax, dword [ebp - 0x14]
mov eax, dword [eax + 0x38]
mov dword [ebp - 0x10], eax
jmp 0x4047d9
mov eax, dword [ebp - 0xc]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 1
mov dword [esp + 4], 0x50
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call sym._fwrite
mov eax, dword [ebp - 0x10]
mov eax, dword [eax + 0x4c]
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jne 0x4047ae
mov eax, dword [ebp - 0x14]
mov eax, dword [eax + 0x3c]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jne 0x4047a3
mov eax, dword [ebp - 0x18]
mov eax, dword [eax + 0x90]
mov dword [ebp - 0x18], eax
cmp dword [ebp - 0x18], 0
jne 0x404795
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call sym._fclose
call dbg.DrawFrame
mov eax, dword [0x40f070]
mov edx, dword [ebp - 0x1e]
mov dword [esp + 4], edx
mov dword [esp], eax
call sym._SetConsoleCursorPosition_8
sub esp, 8
mov dword [esp], 0x40d4d9
call sym._printf
movzx edx, word [ebp - 0x1a]
mov eax, dword [0x40f070]
lea ecx, [ebp - 0x24]
mov dword [esp + 0x10], ecx
mov ecx, dword [ebp - 0x1e]
mov dword [esp + 0xc], ecx
mov dword [esp + 8], 0xa
mov dword [esp + 4], edx
mov dword [esp], eax
call sym._FillConsoleOutputAttribute_20
sub esp, 0x14
mov word [ebp - 0x1e], 0x22
mov word [ebp - 0x1c], 0xf
mov eax, dword [0x40f070]
mov edx, dword [ebp - 0x1e]
mov dword [esp + 4], edx
mov dword [esp], eax
call sym._SetConsoleCursorPosition_8
sub esp, 8
mov dword [esp], 0x40d4e4
call sym._printf
call sym._getch
call dbg.ClearWorkArea
mov eax, 1
leave
ret