-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathasmgrm.asm
More file actions
49 lines (39 loc) · 785 Bytes
/
asmgrm.asm
File metadata and controls
49 lines (39 loc) · 785 Bytes
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
; AsmGrm
;
; Copyright (C) 2014 Rob Hardwick
; fcgiapp.h
extern FCGX_Accept
; response.asm
extern asmgrm_response
; Stack
%define start_in 0 ; FCGX_Stream *
%define start_out 8 ; FCGX_Stream *
%define start_err 16 ; FCGX_Stream *
%define start_envp 24 ; FCGX_ParamArray
%define start_stack 32
;
; Code
;
section .text
global _start
_start:
sub rsp, start_stack
; Start accept loop
.accept:
lea rcx, [rsp+start_envp]
lea rdx, [rsp+start_err]
lea rsi, [rsp+start_out]
lea rdi, [rsp+start_in]
call FCGX_Accept
test eax, eax
js .quit
; Ouput response
mov rsi, qword[rsp+start_envp]
mov rdi, qword[rsp+start_out]
call asmgrm_response
jmp .accept
; Exit app
.quit:
xor eax, eax
add rsp, start_stack
ret