New version.
If a call was followed by a ret I replaced with :
add rsp,232
jmp DefWindowProcA
Optmized branch into Keyboard.dll (substract rather cmp)
Using register for unconditional jumps.
sub rax,WM_KEYDOWN
jz @1
sub rax,1
jz @2
jmp rbx
When creating a windows I replaced code that set the [rsp + xx] with movdqa
mov rdx,[hInstance+rip]
mov rax,rcx
xor rcx,rcx
xorpd xmm0,xmm0
shufpd xmm0,xmm0,0
movdqu [rsp + 32],xmm0
movdqu [rsp + 48],xmm0
movdqu [rsp + 64],xmm0
movdqu [rsp + 80],xmm0
mov [rsp + 80],rdx ; hInstance
mov [rsp + 64],rax ; hWndParent
mov rdx,OFFSET WC_LISTVIEW
mov r8,OFFSET szNullString
mov r9,WS_CHILD or LVS_NOSORTHEADER or LVS_SORTASCENDING or LVS_REPORT or LVS_SHOWSELALWAYS or LVS_SINGLESEL or WS_VISIBLE
call CreateWindowExA
Two or Three XOR are replaced by one XOR followed by two MOV.
mov rax,r9
shr rax,16
and rax,0000ffffh
mov [rsp + 32],rax
and r9,0000ffffh
mov rcx,[hKeyboardLowLevelListview+rip]
xor rdx,rdx
mov r8,rdx
mov QWORD PTR [rsp + 40],TRUE
call MoveWindow
Tryed to have a better aligment in the data segment.