GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — linux_syscall_hook/assembler/links.txt at main · 3intermute/linux_syscall_hook

This repository was archived by the owner on Mar 19, 2023. It is now read-only.

Expand file tree

/

links.txt

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
126 lines (88 loc) · 3.63 KB
/

links.txt

Copy path

File metadata and controls

126 lines (88 loc) · 3.63 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
https://developer.arm.com/documentation/ddi0596/2021-12/Base-Instructions/MOV--bitmask-immediate---Move--bitmask-immediate---an-alias-of-ORR--immediate--?lang=en
http://shell-storm.org/online/Online-Assembler-and-Disassembler/?inst=mov+w0%2C+0x5678%0D%0Amovk+w0%2C+0x1234%2C+lsl+16+&arch=arm64&as_format=inline#assembly
11110010100000000000000000000000
00000|0000000000000000|00|101001111
f2800520
movk 0, 0x29
"\x20\x05\x80\xf2"
111100101|0000|00000000101001|00000
movk x29, 0x29
"\x3d\x05\x80\xf2"
f280053d
111100101|0000|00000000101001|11101
111100101|0000|00000000000000|11101
//
// uint32_t assemble_movk(uint32_t imm16, uint32_t hw, uint32_t rd) {
// return 0xf2800000 | (imm16 << 5) | (hw << 21) | rd;
// }
//
// uint32_t assemble_movz(uint32_t imm16, uint32_t hw, uint32_t rd) {
// return 0xa5000000 | (imm16 << 5) | (hw << 21) | rd;
// }
//
// // https://stackoverflow.com/questions/53268118/whats-the-difference-between-mov-movz-movn-and-movk-in-armv8-assembly
// uint32_t assemble_movn() {
//
// }
//
// unsigned char *assemble_absolute_load(uint32_t rd, uintptr_t addr) {
// unsigned char *code = vmalloc(ASM_ABS_LOAD_SIZE); // 3 insts needed, insts 4 bytes
// // code[0] = assemble_movz(addr & 0xffffffff, 0b1, rd);
// // use movn or movz depending on size
// code[4] = assemble_movk(addr & 0xffff00000000, 0b10, rd);
// code[8] = assemble_movk(addr & 0xffff000000000000, 0b11, rd);
// return code;
// }
9df9b3d2
movz x29, #0x9fcc, lsl #16
0xffffd8589fcc0000
10100101000000000000000000000000
movk x0, #0x0000
movk x0, #0x9fcc, lsl #16
movk x0, #0xd858, lsl #32
movk x0, #0xffff, lsl #48
000080f2
1D 00 80 F2
0000a0fb
111110111|01000000000000000000000
9D F9 B3 F2
111100101|011001111111001100|11101
0000c0f2
0000e0f2
#define ABS_LOAD_INS_COUNT 4
// https://developer.arm.com/documentation/ddi0596/2021-12/Base-Instructions/MOVK--Move-wide-with-keep-?lang=en
// movk encoding:
// 0 | 1 1 1 0 0 1 0 1 | 0 0 | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | 0 0 0 0 0
//------------------------------------------------------------------------
// sf|opc |hw |imm16 |rd
uint32_t assemble_movk(uint32_t imm16, uint32_t hw, uint32_t rd) {
return 0xf2800000 | (imm16 << 5) | (hw << 21) | rd;
}
void assemble_absolute_load(uint32_t rd, uintptr_t addr, uint32_t *arr) {
arr[0] = cpu_to_le32(assemble_movk(addr & 0xffff, 0b0, rd));
arr[1] = cpu_to_le32(assemble_movk((addr & 0xffff0000) >> 16, 0b1, rd));
arr[2] = cpu_to_le32(assemble_movk((addr & 0xffff00000000) >> 32, 0b10, rd));
arr[3] = cpu_to_le32(assemble_movk((addr & 0xffff000000000000) >> 48, 0b11, rd));
}
10111101101111110010
// movz encoding:
// 0 | 1 0 1 0 0 1 0 1 | 0 0 | 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 | 0 0 0 0 0
//------------------------------------------------------------------------
// sf|opc |hw |imm16 |rd
uint32_t assemble_movz(uint32_t imm16, uint32_t hw, uint32_t rd) {
return 0xa5000000 | (imm16 << 5) | (hw << 21) | rd;
}
uint32_t assemble_movk(uint32_t imm16, uint32_t hw, uint32_t rd) {
return 0xf2800000 | (imm16 << 5) | (hw << 21) | rd;
}
uint32_t assemble_movz(uint32_t imm16, uint32_t hw, uint32_t rd) {
return 0xa5000000 | (imm16 << 5) | (hw << 21) | rd;
}
unsigned char *assemble_absolute_load(uint32_t rd, uintptr_t addr) {
unsigned char *code = vmalloc(12); // 3 insts needed, insts 4 bytes
code[0] = assemble_movz(addr & 0xffffffff, 0b1, rd);
code[4] = assemble_movk(addr & 0xffff00000000, 0b10, rd);
code[8] = assemble_movk(addr & 0xffff000000000000, 0b11, rd);
return code;
}
"\x80\xf9\xb3\xd2\x00\x0b\xdb\xf2\xe0\xff\xff\xf2"
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.