Function at 0x401070
Capabilities:
Read file on windows
Read pipe

Disassembly:
push ebp
mov ebp, esp
sub esp, 8
mov ecx, dword [0x416be0]
push 0
lea eax, [ebp - 4]
push eax
push 0
push 0
push 0
push ecx
call dword [sym.imp.KERNEL32.dll_PeekNamedPipe]
mov eax, dword [ebp - 4]
test eax, eax
je 0x4013bc
push esi
lea esi, [eax + 1]
push edi
push esi
call fcn.00404622
mov edi, eax
add esp, 4
test edi, edi
je 0x4010bc
push esi
push 0
push edi
call fcn.0040abe0
add esp, 0xc
jmp 0x4010be
xor edi, edi
mov eax, dword [ebp - 4]
mov ecx, dword [0x416be0]
push ebx
push 0
lea edx, [ebp - 8]
push edx
push eax
push edi
push ecx
call dword [sym.imp.KERNEL32.dll_ReadFile]
mov ebx, 1
cmp dword [ebp - 4], ebx
jbe 0x4010fc
lea edx, [ebx + edi]
push str.score_cp
push edx
call fcn.004046b0
add esp, 8
test eax, eax
je 0x4010fc
inc ebx
cmp ebx, dword [ebp - 4]
jb 0x4010e1
push str.bestmove
push edi
call fcn.004046b0
mov esi, eax
lea eax, [ebx + edi - 1]
push str.score_cp
push eax
call fcn.004046b0
push str.score_mate
push edi
mov ebx, eax
call fcn.004046b0
add esp, 0x18
mov edi, eax
test ebx, ebx
je 0x401141
push 0x418108
push str.score_cp__d
push ebx
call fcn.004047a4
add esp, 0xc
test edi, edi
je 0x401158
push 0x418108
push str.score_mate__d
push edi
call fcn.004047a4
add esp, 0xc
test esi, esi
je 0x4013b6
movzx ecx, byte [esi + 9]
movzx edx, byte [esi + 0xa]
mov al, byte [esi + 0xb]
push 1
mov byte [0x4180dc], cl
movzx ecx, byte [esi + 0xc]
mov byte [0x4180db], dl
movzx edx, byte [esi + 0xd]
mov byte [0x4180da], al
mov eax, dword [0x416bec]
push 0
push eax
mov byte [0x4180d9], cl
mov byte [0x4180d8], dl
mov dword [0x4180e4], 0
mov dword [0x4180e0], 1
call dword [sym.imp.USER32.dll_InvalidateRect]
mov eax, dword [0x41810c]
cmp eax, 1
jne 0x401207
movsx edx, byte [0x4180db]
movsx ecx, byte [0x4180dc]
movsx eax, byte [0x4180da]
movsx edi, byte [0x4180d9]
mov esi, 0x38
sub esi, edx
sub ecx, 0x61
sub eax, 0x61
mov edx, 0x38
sub edx, edi
mov dword [0x41811c], ecx
mov dword [0x418118], esi
mov dword [0x418114], eax
mov dword [0x418110], edx
jmp 0x40126b
test eax, eax
jne 0x401254
movsx eax, byte [0x4180dc]
movsx edx, byte [0x4180da]
movsx esi, byte [0x4180db]
mov ecx, 0x68
sub ecx, eax
mov eax, 0x68
sub eax, edx
movsx edx, byte [0x4180d9]
sub esi, 0x31
sub edx, 0x31
mov dword [0x41811c], ecx
mov dword [0x418118], esi
mov dword [0x418114], eax
mov dword [0x418110], edx
jmp 0x40126b
mov ecx, dword [0x41811c]
mov esi, dword [0x418118]
mov eax, dword [0x418114]
mov edx, dword [0x418110]
lea esi, [ecx + esi*8]
add esi, esi
add esi, esi
mov ebx, 6
cmp dword [esi + 0x418120], ebx
jne 0x4012bd
lea edi, [ecx - 2]
cmp eax, edi
jne 0x40129a
mov dword [0x418200], 0
mov dword [esi + 0x41811c], 5
cmp dword [esi + 0x418120], ebx
jne 0x4012bd
lea edi, [ecx + 2]
cmp eax, edi
jne 0x4012bd
mov dword [0x41821c], 0
mov dword [esi + 0x418124], 5
cmp dword [esi + 0x418120], 4
jne 0x4012f3
lea edi, [eax + edx*8]
add edi, edi
add edi, edi
cmp dword [edi + 0x418120], 0
jne 0x4012f3
lea ebx, [eax - 1]
cmp ecx, ebx
je 0x4012e4
lea ebx, [eax + 1]
cmp ecx, ebx
jne 0x4012ee
mov dword [edi + 0x418140], 0
mov ebx, 6
mov edi, 4
cmp dword [esi + 0x418120], edi
jne 0x40130e
test edx, edx
je 0x40130e
lea ecx, [eax + edx*8]
mov dword [ecx*4 + 0x418120], edi
cmp dword [esi + 0x418120], ebx
jne 0x401320
lea ecx, [eax + edx*8]
mov dword [ecx*4 + 0x418120], ebx
lea eax, [eax + edx*8]
mov dword [esi + 0x418120], 0
mov ecx, dword [eax*4 + 0x418120]
cmp ecx, edi
je 0x401347
cmp ecx, ebx
je 0x401347
mov dword [eax*4 + 0x418120], 5
movsx edx, byte [0x4180d9]
movsx eax, byte [0x4180da]
movsx ecx, byte [0x4180db]
push edx
movsx edx, byte [0x4180dc]
push eax
push ecx
push edx
push 0x4170d8
push str._s__c_c_c_c
push 0x4170d8
call fcn.004047c6
mov al, byte [0x4180d8]
add esp, 0x1c
cmp al, 0x71
je 0x401393
cmp al, 0x72
je 0x401393
cmp al, 0x62
je 0x401393
cmp al, 0x6e
jne 0x4013b6
push 0x413260
push 0x4170d8
push str._s_s
push 0x4170d8
mov byte [0x4180d8], 0x71
call fcn.004047c6
add esp, 0x10
mov eax, dword [ebp - 4]
pop ebx
pop edi
pop esi
mov esp, ebp
pop ebp
ret