Rev 7323 | Rev 7327 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 7323 | Rev 7325 | ||
---|---|---|---|
Line 3... | Line 3... | ||
3 | ;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; |
3 | ;; Copyright (C) KolibriOS team 2004-2015. All rights reserved. ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
4 | ;; Distributed under terms of the GNU General Public License ;; |
5 | ;; ;; |
5 | ;; ;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
6 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
Line 7... | Line 7... | ||
7 | 7 | ||
Line 8... | Line 8... | ||
8 | $Revision: 7323 $ |
8 | $Revision: 7325 $ |
9 | 9 | ||
10 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
10 | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
11 | ;; ;; |
11 | ;; ;; |
Line 185... | Line 185... | ||
185 | dd sys_end ; -1-end application |
185 | dd sys_end ; -1-end application |
Line 186... | Line 186... | ||
186 | 186 | ||
Line 187... | Line 187... | ||
187 | endg |
187 | endg |
188 | - | ||
189 | ; Author Pavel Iakovlev |
- | |
190 | ; Return EAX = 0 security kernel, error set function |
188 | |
- | 189 | ; Author Pavel Iakovlev |
|
- | 190 | align 32 |
|
- | 191 | callSet0x40: |
|
- | 192 | shl eax, 2 |
|
- | 193 | push dword [memNewFunctionTable + eax] |
|
- | 194 | pop dword [tempPointerAlloc] |
|
- | 195 | mov eax, dword [memOldFunctionTable + eax] |
|
- | 196 | call dword [tempPointerAlloc] |
|
191 | ; Return Else EAX > 0 success set function |
197 | ret |
Line 192... | Line -... | ||
192 | align 32 |
- | |
193 | setInt0x40: |
198 | align 4 |
194 | - | ||
195 | ; !!! kernel security !!! |
- | |
196 | and ebx, 0FFh |
199 | setInt0x40: |
197 | mov eax, dword [servetable2 + ebx * 4] |
200 | |
Line 198... | Line 201... | ||
198 | ; cmp eax, undefined_syscall |
201 | and ebx, 0FFh |
- | 202 | shl ebx, 2 |
|
199 | ; jne errorSet0x40 |
203 | mov eax, dword [servetable2 + ebx] |
200 | ; ----------------------- |
204 | |
201 | - | ||
202 | pushad |
205 | pushad |
203 | add edx, 16 |
206 | sub esi, edx |
Line 204... | Line -... | ||
204 | stdcall kernel_alloc, edx |
- | |
205 | push eax |
207 | add esi, 16 |
206 | pop dword[tempPointerAlloc] |
208 | stdcall kernel_alloc, esi |
207 | popad |
- | |
208 | 209 | mov dword [tempPointerAlloc], eax |
|
209 | 210 | popad |
|
210 | push ebx |
- | |
211 | push dword[tempPointerAlloc] |
- | |
212 | pop eax |
- | |
213 | mov ebx, eax |
211 | |
214 | add eax, edx |
- | |
Line -... | Line 212... | ||
- | 212 | push ebx |
|
- | 213 | mov eax, dword [tempPointerAlloc] |
|
215 | 214 | mov ebx, eax |
|
216 | ; push 0 |
- | |
217 | ; pop dword[hashDataFunction1] |
- | |
218 | ; push 1 |
- | |
219 | ; pop dword[hashDataFunction2] |
- | |
220 | - | ||
221 | loopCopyMemory: |
- | |
222 | xor edx, edx |
- | |
223 | - | ||
224 | mov dl, byte[ecx] |
- | |
225 | mov byte[ebx], dl |
- | |
Line -... | Line 215... | ||
- | 215 | add eax, esi |
|
- | 216 | sub eax, edx |
|
226 | 217 | ||
227 | ; hash security function |
218 | push edx |
228 | ; add dword[hashDataFunction1], edx |
219 | push ecx |
229 | ; mov edx, dword[hashDataFunction1] |
220 | loopCopyMemory: |
Line -... | Line 221... | ||
- | 221 | ||
- | 222 | mov cl, byte[edx] |
|
230 | ; add dword[hashDataFunction2], edx |
223 | mov byte[ebx], cl |
Line 231... | Line -... | ||
231 | ; ----------------------------- |
- | |
232 | - | ||
233 | inc ebx |
- | |
234 | inc ecx |
- | |
235 | cmp ebx, eax |
- | |
236 | jne loopCopyMemory |
- | |
237 | - | ||
238 | pop ebx |
224 | inc ebx |
239 | 225 | inc edx |
|
- | 226 | cmp ebx, eax |
|
240 | ; check hash security data |
227 | jne loopCopyMemory |
241 | ; cmp edi, dword[hashDataFunction1] |
- | |
242 | ; jne errorSet0x40 |
228 | |
243 | ; cmp esi, dword[hashDataFunction2] |
229 | pop ecx |
- | 230 | pop edx |
|
244 | ; jne errorSet0x40 |
231 | pop ebx |
- | 232 | ||
- | 233 | mov eax, dword [tempPointerAlloc] |
|
245 | ; ------------------------------- |
234 | mov esi, dword [servetable2 + ebx] |
- | 235 | cmp esi, undefined_syscall |
|
- | 236 | jne .step1 |
|
- | 237 | sub ecx, edx |
|
246 | 238 | add eax, ecx |
|
Line -... | Line 239... | ||
- | 239 | mov dword [servetable2 + ebx], eax |
|
247 | mov eax, dword[tempPointerAlloc] |
240 | ret |
248 | mov dword [servetable2 + ebx * 4], eax |
241 | .step1: |
249 | jmp successSet0x40 |
242 | mov dword [memOldFunctionTable + ebx], esi |
250 | 243 | sub ecx, edx |
|
251 | errorSet0x40: |
244 | add eax, ecx |