jinvoke CreateFont,16,8,0,0,600,0,0,DEFAULT_CHARSET,OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS,PROOF_QUALITY,FF_DONTCARE, Chr$("fixedsys"), 0
Note the extra 0 at the end - my macro complained that there are not enough parameters, so I arbitrarily added a 0
No idea how reliable jinvoke is, though, so please count yourself *) ::)
Under the hood:
53 | push rbx |
53 | push rbx |
6A 00 | push 0 |
4C 8D 15 48 0F 00 00 | lea r10, qword ptr ds:[140002075] | 140002075:"fixedsys"
41 52 | push r10 |
6A 00 | push 0 |
6A 02 | push 2 |
6A 00 | push 0 |
6A 00 | push 0 |
6A 01 | push 1 |
6A 00 | push 0 |
6A 00 | push 0 |
68 58 02 00 00 | push 258 |
6A 00 | push 0 |
4C 8B 0C 24 | mov r9, qword ptr ss:[rsp] |
6A 00 | push 0 |
4C 8B 04 24 | mov r8, qword ptr ss:[rsp] |
6A 08 | push 8 |
48 8B 14 24 | mov rdx, qword ptr ss:[rsp] |
6A 10 | push 10 |
48 8B 0C 24 | mov rcx, qword ptr ss:[rsp] |
FF 15 80 12 00 00 | call qword ptr ds:[<&CreateFontA>] |
48 81 C4 80 00 00 00 | add rsp, 80 |
90 | nop |
Project is attached.
@Mikl: the xor r8, r8 -> push r8 doesn't save bytes, as push r8 is a two-byte instruction, same as push 0
maybe the stack needs to be adjusted after the call;
@Hutch: I'm not sure if it's properly aligned on entry to CreateFont:
0000000140001193 | 48 83 EC 20 | sub rsp, 20 | ???
0000000140001197 | CC | int3 | stack is 12FE98
0000000140001198 | FF 15 72 12 00 00 | call qword ptr ds:[<&CreateFontA>] |...
000007FEFDCD9A38 | 48 83 EC 78 | sub rsp, 78 | CreateFontA
000007FEFDCD9A3C | 48 8B 05 25 26 05 00 | mov rax, qword ptr ds:[7FEFDD2C068 | stack is 12FE18 now
000007FEFDCD9A43 | 48 33 C4 | xor rax, rsp | rax:"fixedsys"
*) P.S.: Perhaps it's better to move the trailing zero before the DEFAULT_CHARSET :icon_mrgreen: