Function at 0x401983
Capabilities:
Manipulate console buffer
Read file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x38
mov dword [ebp - 0x24], 0
mov word [ebp - 0x28], 0
mov word [ebp - 0x26], 0
mov dword [ebp - 0xc], 0
call dbg.ClearScreen
mov eax, dword [0x40f070]
mov edx, dword [ebp - 0x28]
mov dword [esp + 4], edx
mov dword [esp], eax
call sym._SetConsoleCursorPosition_8
sub esp, 8
mov eax, dword [str.coal.dat]
mov dword [esp + 4], 0x40d1ea
mov dword [esp], eax
call sym._fopen
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jne 0x4019f1
mov dword [esp], 0x40d1f0
call sym._puts
mov eax, dword [ebp - 0xc]
jmp 0x401d61
mov dword [esp], 0x40d214
call sym._puts
jmp 0x401a5c
mov dword [esp], 0x94
call sym._malloc
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x14]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 1
mov dword [esp + 4], 0x94
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call sym._fread
mov eax, dword [ebp - 0x14]
mov eax, dword [eax + 0xc]
and eax, 0x10
test eax, eax
jne 0x401a5c
mov eax, dword [ebp - 0x20]
mov dword [eax + 0x8c], 0
mov eax, dword [ebp - 0x20]
mov edx, dword [ebp - 0x24]
mov dword [eax + 0x90], edx
mov eax, dword [ebp - 0x20]
mov dword [ebp - 0x24], eax
mov eax, dword [ebp - 0x14]
mov eax, dword [eax + 0xc]
and eax, 0x10
test eax, eax
je 0x4019ff
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call sym._fclose
cmp dword [ebp - 0x24], 0
jne 0x401a8e
mov dword [esp], 0x40d238
call sym._puts
mov eax, dword [ebp - 0xc]
jmp 0x401d61
mov dword [esp], 0x40d25c
call sym._puts
mov eax, dword [ebp + 8]
mov edx, dword [ebp - 0x24]
mov dword [eax], edx
add dword [ebp - 0xc], 4
mov eax, dword [str.prov.dat]
mov dword [esp + 4], 0x40d1ea
mov dword [esp], eax
call sym._fopen
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jne 0x401ad8
mov dword [esp], 0x40d280
call sym._puts
mov eax, dword [ebp - 0xc]
jmp 0x401d61
mov dword [esp], 0x40d2a4
call sym._puts
add dword [ebp - 0xc], 8
jmp 0x401b96
mov dword [esp], 0x40
call sym._malloc
mov dword [ebp - 0x1c], eax
mov eax, dword [ebp - 0x14]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 1
mov dword [esp + 4], 0x40
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._fread
mov eax, dword [ebp - 0x14]
mov eax, dword [eax + 0xc]
and eax, 0x10
test eax, eax
jne 0x401b96
mov eax, dword [ebp - 0x1c]
mov dword [eax + 0x38], 0
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x20], eax
jmp 0x401b49
mov eax, dword [ebp - 0x20]
mov eax, dword [eax + 0x90]
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0
je 0x401b68
mov eax, dword [ebp - 0x1c]
lea edx, [eax + 0x17]
mov eax, dword [ebp - 0x20]
mov dword [esp + 4], edx
mov dword [esp], eax
call sym._strcmp
test eax, eax
jne 0x401b3d
cmp dword [ebp - 0x20], 0
je 0x401b8b
mov eax, dword [ebp - 0x20]
mov edx, dword [eax + 0x8c]
mov eax, dword [ebp - 0x1c]
mov dword [eax + 0x3c], edx
mov eax, dword [ebp - 0x20]
mov edx, dword [ebp - 0x1c]
mov dword [eax + 0x8c], edx
jmp 0x401b96
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._free
mov eax, dword [ebp - 0x14]
mov eax, dword [eax + 0xc]
and eax, 0x10
test eax, eax
je 0x401aed
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call sym._fclose
mov eax, dword [str.gnrt.dat]
mov dword [esp + 4], 0x40d1ea
mov dword [esp], eax
call sym._fopen
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jne 0x401be4
mov dword [esp], 0x40d2c8
call sym._puts
mov eax, dword [ebp - 0xc]
jmp 0x401d61
mov dword [esp], 0x40d2e8
call sym._puts
add dword [ebp - 0xc], 0x10
jmp 0x401ccf
mov dword [esp], 0x50
call sym._malloc
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x14]
mov dword [esp + 0xc], eax
mov dword [esp + 8], 1
mov dword [esp + 4], 0x50
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
call sym._fread
mov eax, dword [ebp - 0x14]
mov eax, dword [eax + 0xc]
and eax, 0x10
test eax, eax
jne 0x401ccf
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x10], 0
jmp 0x401c9b
mov eax, dword [ebp - 0x20]
mov eax, dword [eax + 0x8c]
mov dword [ebp - 0x1c], eax
jmp 0x401c83
mov eax, dword [ebp - 0x18]
lea edx, [eax + 0x23]
mov eax, dword [ebp - 0x1c]
mov dword [esp + 4], edx
mov dword [esp], eax
call sym._strcmp
test eax, eax
jne 0x401c7a
mov dword [ebp - 0x10], 1
jmp 0x401c8f
mov eax, dword [ebp - 0x1c]
mov eax, dword [eax + 0x3c]
mov dword [ebp - 0x1c], eax
cmp dword [ebp - 0x1c], 0
je 0x401c8f
cmp dword [ebp - 0x10], 0
je 0x401c58
mov eax, dword [ebp - 0x20]
mov eax, dword [eax + 0x90]
mov dword [ebp - 0x20], eax
cmp dword [ebp - 0x20], 0
je 0x401ca7
cmp dword [ebp - 0x10], 0
je 0x401c4a
cmp dword [ebp - 0x10], 0
je 0x401cc4
mov eax, dword [ebp - 0x1c]
mov edx, dword [eax + 0x38]
mov eax, dword [ebp - 0x18]
mov dword [eax + 0x4c], edx
mov eax, dword [ebp - 0x1c]
mov edx, dword [ebp - 0x18]
mov dword [eax + 0x38], edx
jmp 0x401ccf
mov eax, dword [ebp - 0x18]
mov dword [esp], eax
call sym._free
mov eax, dword [ebp - 0x14]
mov eax, dword [eax + 0xc]
and eax, 0x10
test eax, eax
je 0x401bf9
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call sym._fclose
mov eax, dword [ebp - 0xc]
mov dl, al
mov al, byte [0x40f020]
or eax, edx
mov byte [0x40f020], al
mov eax, dword [ebp - 0xc]
mov dl, 0x1c
mov cl, dl
sub cl, al
mov al, cl
mov dl, al
not edx
mov al, byte [0x40f020]
and eax, edx
mov byte [0x40f020], al
mov al, byte [0x40f020]
cmp al, 0x1b
jg 0x401d3f
mov dword [esp], 0x40d307
call sym._puts
mov dword [esp], 0x40d31d
call sym._puts
call sym._getch
jmp 0x401d5c
mov dword [esp], 0x40d32e
call sym._puts
mov dword [esp], 0x40d31d
call sym._puts
call sym._getch
mov eax, 1
leave
ret