Function at 0x412560
Capabilities:
Hide graphical window
Log keystrokes via polling

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x60
push edi
push esi
push ebx
mov ebx, dword [ebp + 0xc]
mov edi, dword [ebp + 0x14]
push 0
mov ecx, dword [ebp + 8]
push ecx
call sub.user32.dll_GetWindowLongA
mov esi, eax
cmp ebx, 0xa1
je 0x412924
ja 0x4125c4
cmp ebx, 0xf
je 0x4127ba
ja 0x4125ac
cmp ebx, 1
je 0x412724
cmp ebx, 5
je 0x41272b
jmp 0x41295a
cmp ebx, 0x24
je 0x41262a
cmp ebx, 0x81
je 0x412614
jmp 0x41295a
cmp ebx, 0x104
je 0x4127e4
ja 0x4125f4
cmp ebx, 0x100
je 0x4127e4
cmp ebx, 0x102
je 0x4128b4
jmp 0x41295a
cmp ebx, 0x30f
je 0x4128d0
cmp ebx, 0x311
je 0x4128c4
jmp 0x41295a
mov eax, dword [0x41d940]
push eax
push 0
mov ecx, dword [ebp + 8]
push ecx
call sub.user32.dll_SetWindowLongA
jmp 0x41295a
test esi, esi
je 0x41273e
mov dword [ebp - 0xc], 0
mov dword [ebp - 0x10], 0
mov ecx, dword [esi + 0xb8]
lea eax, [ecx*8]
add eax, dword [esi + 0x90]
add eax, dword [esi + 0x98]
mov dword [ebp - 8], eax
mov ecx, dword [esi + 0xbc]
mov eax, ecx
add eax, ecx
add eax, dword [esi + 0x94]
add eax, dword [esi + 0x9c]
mov dword [ebp - 4], eax
mov eax, dword [esi + 0x68]
push eax
push 1
mov eax, dword [esi + 0x64]
push eax
lea ebx, [ebp - 0x10]
push ebx
call sub.user32.dll_AdjustWindowRectEx
mov eax, dword [ebp - 0x10]
mov ecx, dword [ebp - 8]
sub ecx, eax
mov dword [edi + 0x18], ecx
mov eax, dword [ebp - 0xc]
mov ecx, dword [ebp - 4]
sub ecx, eax
mov dword [edi + 0x1c], ecx
mov dword [ebp - 0xc], 0
mov dword [ebp - 0x10], 0
mov edx, dword [esi + 0xb8]
lea edx, [edx + edx*4]
shl edx, 4
add edx, dword [esi + 0x90]
add edx, dword [esi + 0x98]
mov dword [ebp - 8], edx
mov eax, dword [esi + 0xbc]
mov ecx, dword [esi + 0x94]
lea eax, [eax + eax*2]
lea eax, [ecx + eax*8]
add eax, dword [esi + 0x9c]
mov dword [ebp - 4], eax
add edx, dword [esi + 0xb8]
dec edx
mov dword [ebp - 8], edx
add eax, dword [esi + 0xbc]
dec eax
mov dword [ebp - 4], eax
mov eax, dword [esi + 0x68]
push eax
push 1
mov eax, dword [esi + 0x64]
push eax
push ebx
call sub.user32.dll_AdjustWindowRectEx
mov eax, dword [ebp - 0x10]
mov edx, dword [ebp - 8]
sub edx, eax
mov dword [edi + 8], edx
mov eax, dword [ebp - 0xc]
mov ecx, dword [ebp - 4]
sub ecx, eax
mov eax, ecx
mov dword [edi + 0xc], eax
mov dword [edi + 0x20], edx
mov dword [edi + 0x24], eax
xor eax, eax
jmp 0x412969
test esi, esi
je 0x41273e
cmp dword [esi + 0x60], 0
je 0x41273e
cmp byte [esi + 0xa1], 0
je 0x412748
mov eax, 1
jmp 0x412969
xor eax, eax
mov ax, di
sub eax, dword [esi + 0x90]
sub eax, dword [esi + 0x98]
xor edx, edx
div dword [esi + 0xb8]
shr edi, 0x10
sub edi, dword [esi + 0x94]
sub edi, dword [esi + 0x9c]
mov dword [esi + 0x74], eax
mov eax, edi
xor edx, edx
div dword [esi + 0xbc]
mov byte [esi + 0xa1], 1
mov dword [esi + 0x70], eax
push esi
call sym._term_getsize
push 1
mov eax, dword [esi + 0x84]
push eax
mov eax, dword [esi + 0x80]
push eax
mov eax, dword [esi + 0x7c]
push eax
mov eax, dword [esi + 0x78]
push eax
mov ecx, dword [ebp + 8]
push ecx
call sub.user32.dll_MoveWindow
mov byte [esi + 0xa1], 0
jmp 0x412724
lea ebx, [ebp - 0x50]
push ebx
mov ecx, dword [ebp + 8]
push ecx
call sub.user32.dll_BeginPaint
test esi, esi
je 0x4127d4
push esi
call sym._term_data_redraw
add esp, 4
push ebx
mov ecx, dword [ebp + 8]
push ecx
call sub.user32.dll_EndPaint
jmp 0x412724
push 0x11
call sub.user32.dll_GetKeyState
test ax, ax
setl byte [ebp - 0x51]
push 0x10
call sub.user32.dll_GetKeyState
test ax, ax
setl byte [ebp - 0x52]
push 0x12
call sub.user32.dll_GetKeyState
test ax, ax
setl byte [ebp - 0x53]
mov eax, dword [ebp + 0x10]
add eax, 0xffffffdf
cmp eax, 7
setbe dl
mov eax, dword [ebp + 0x10]
add eax, 0xffffff90
cmp eax, 0xb
ja 0x412827
mov dl, 1
mov eax, dword [ebp + 0x10]
add eax, 0xffffffd3
cmp eax, 1
ja 0x412834
mov dl, 1
test dl, dl
je 0x41295a
push 0x1f
call sym._Term_keypress
add esp, 4
cmp byte [ebp - 0x51], 0
je 0x412856
push 0x43
call sym._Term_keypress
add esp, 4
cmp byte [ebp - 0x52], 0
je 0x412866
push 0x53
call sym._Term_keypress
add esp, 4
cmp byte [ebp - 0x53], 0
je 0x412876
push 0x41
call sym._Term_keypress
add esp, 4
shr edi, 0x10
mov ecx, edi
mov edi, ecx
and edi, 0xff
push 0x78
call sym._Term_keypress
mov eax, edi
mov ebx, eax
sar ebx, 4
mov esi, str.0123456789ABCDEF
movsx eax, byte [ebx + esi]
push eax
call sym._Term_keypress
shl ebx, 4
sub edi, ebx
movsx eax, byte [edi + esi]
push eax
call sym._Term_keypress
push 0xd
jmp 0x4128b8
mov ecx, dword [ebp + 0x10]
push ecx
call sym._Term_keypress
jmp 0x412724
mov ecx, dword [ebp + 8]
cmp dword [ebp + 0x10], ecx
je 0x412724
cmp byte [0x41c886], 0
je 0x412724
mov ecx, dword [ebp + 8]
push ecx
call sub.user32.dll_GetDC
push 0
mov ebx, eax
mov eax, dword [0x41d980]
push eax
push ebx
call sub.gdi32.dll_SelectPalette
push ebx
call sub.gdi32.dll_RealizePalette
mov edi, eax
test edi, edi
je 0x41290f
push 1
push 0
mov ecx, dword [ebp + 8]
push ecx
call sub.user32.dll_InvalidateRect
push ebx
mov ecx, dword [ebp + 8]
push ecx
call sub.user32.dll_ReleaseDC
jmp 0x412724
cmp dword [ebp + 0x10], 3
jne 0x41295a
cmp esi, 0x41d340
je 0x412724
cmp byte [esi + 0xa0], 0
je 0x412724
mov byte [esi + 0xa0], 0
push 0
mov eax, dword [esi + 0x60]
push eax
call sub.user32.dll_ShowWindow
jmp 0x412724
push edi
mov ecx, dword [ebp + 0x10]
push ecx
push ebx
mov ecx, dword [ebp + 8]
push ecx
call sub.user32.dll_DefWindowProcA
lea esp, [ebp - 0x6c]
pop ebx
pop esi
pop edi
mov esp, ebp
pop ebp
ret 0x10