Function at 0x41201c
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, 0x81
je 0x412115
ja 0x4120a4
cmp ebx, 0xf
je 0x412234
ja 0x412078
cmp ebx, 5
je 0x412375
ja 0x41206a
cmp ebx, 1
je 0x412226
jmp 0x412545
cmp ebx, 6
je 0x4124f4
jmp 0x412545
cmp ebx, 0x12
je 0x412354
ja 0x412094
cmp ebx, 0x10
je 0x412354
jmp 0x412545
cmp ebx, 0x24
je 0x41212b
jmp 0x412545
cmp ebx, 0x111
je 0x412364
ja 0x4120e5
cmp ebx, 0x102
je 0x412334
ja 0x4120d4
cmp ebx, 0x100
je 0x412265
jmp 0x412545
cmp ebx, 0x104
je 0x412265
jmp 0x412545
cmp ebx, 0x30f
je 0x4124a0
ja 0x412104
cmp ebx, 0x116
je 0x412344
jmp 0x412545
cmp ebx, 0x311
je 0x412494
jmp 0x412545
mov eax, dword [0x41d940]
push eax
push 0
mov ecx, dword [ebp + 8]
push ecx
call sub.user32.dll_SetWindowLongA
jmp 0x412545
test esi, esi
je 0x412388
mov dword [ebp - 0x4c], 0
mov dword [ebp - 0x50], 0
mov ecx, dword [esi + 0xb8]
lea eax, [ecx*8]
add eax, dword [esi + 0x90]
add eax, dword [esi + 0x98]
mov dword [ebp - 0x48], eax
mov ecx, dword [esi + 0xbc]
mov eax, ecx
add eax, ecx
add eax, dword [esi + 0x94]
add eax, dword [esi + 0x9c]
inc eax
mov dword [ebp - 0x44], eax
mov eax, dword [esi + 0x68]
push eax
push 1
mov eax, dword [esi + 0x64]
push eax
lea ebx, [ebp - 0x50]
push ebx
call sub.user32.dll_AdjustWindowRectEx
mov eax, dword [ebp - 0x50]
mov ecx, dword [ebp - 0x48]
sub ecx, eax
mov dword [edi + 0x18], ecx
mov eax, dword [ebp - 0x4c]
mov ecx, dword [ebp - 0x44]
sub ecx, eax
mov dword [edi + 0x1c], ecx
mov dword [ebp - 0x4c], 0
mov dword [ebp - 0x50], 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 - 0x48], 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 - 0x44], eax
add edx, dword [esi + 0xb8]
dec edx
mov dword [ebp - 0x48], edx
add eax, dword [esi + 0xbc]
dec eax
mov dword [ebp - 0x44], 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 - 0x50]
mov edx, dword [ebp - 0x48]
sub edx, eax
mov dword [edi + 8], edx
mov eax, dword [ebp - 0x4c]
mov ecx, dword [ebp - 0x44]
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 0x412554
lea ebx, [ebp - 0x40]
push ebx
mov ecx, dword [ebp + 8]
push ecx
call sub.user32.dll_BeginPaint
test esi, esi
je 0x41224e
push esi
call sym._term_data_redraw
add esp, 4
push ebx
mov ecx, dword [ebp + 8]
push ecx
call sub.user32.dll_EndPaint
push 0
mov ecx, dword [ebp + 8]
push ecx
call sub.user32.dll_ValidateRect
jmp 0x412226
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 0x4122a8
mov dl, 1
mov eax, dword [ebp + 0x10]
add eax, 0xffffffd3
cmp eax, 1
ja 0x4122b5
mov dl, 1
test dl, dl
je 0x412545
push 0x1f
call sym._Term_keypress
add esp, 4
cmp byte [ebp - 0x51], 0
je 0x4122d7
push 0x43
call sym._Term_keypress
add esp, 4
cmp byte [ebp - 0x52], 0
je 0x4122e7
push 0x53
call sym._Term_keypress
add esp, 4
cmp byte [ebp - 0x53], 0
je 0x4122f7
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 0x412338
mov ecx, dword [ebp + 0x10]
push ecx
call sym._Term_keypress
jmp 0x412226
call sym._setup_menus
jmp 0x412226
push 0
call sym._quit
jmp 0x412226
xor eax, eax
mov ax, word [ebp + 0x10]
push eax
call sym._process_menus
jmp 0x412226
test esi, esi
je 0x412388
cmp dword [esi + 0x60], 0
je 0x412388
cmp byte [esi + 0xa1], 0
je 0x412394
mov eax, 1
jmp 0x412554
cmp dword [ebp + 0x10], 1
je 0x4123a7
jb 0x4123e4
cmp dword [ebp + 0x10], 2
je 0x4123e4
jmp 0x412545
mov edi, 1
mov esi, 0x41d4a0
mov ebx, 0xc0
cmp byte [esi], 0
je 0x4123c9
push 0
mov eax, dword [ebx + 0x41d3a0]
push eax
call sub.user32.dll_ShowWindow
add esi, 0xc0
add ebx, 0xc0
inc edi
cmp edi, 7
jle 0x4123b6
jmp 0x412226
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
mov edi, 1
add esp, 4
mov esi, 0x41d4a0
mov ebx, 0xc0
nop
cmp byte [esi], 0
je 0x412477
push 4
mov eax, dword [ebx + 0x41d3a0]
push eax
call sub.user32.dll_ShowWindow
add esi, 0xc0
add ebx, 0xc0
inc edi
cmp edi, 7
jle 0x412464
jmp 0x412226
mov ecx, dword [ebp + 8]
cmp dword [ebp + 0x10], ecx
je 0x412226
cmp byte [0x41c886], 0
je 0x412226
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 0x4124df
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 0x412226
cmp dword [ebp + 0x10], 0
je 0x412545
mov eax, edi
shr eax, 0x10
test ax, ax
jne 0x412545
mov edi, 1
mov esi, 0x41d3a0
mov ebx, 0xc0
nop
push 0x13
push 0
push 0
push 0
push 0
mov ecx, dword [ebp + 8]
push ecx
mov eax, dword [esi + ebx]
push eax
call sub.user32.dll_SetWindowPos
add ebx, 0xc0
inc edi
cmp edi, 7
jle 0x412514
mov ecx, dword [ebp + 8]
push ecx
call sub.user32.dll_SetFocus
jmp 0x412226
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