Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; static structs ;
- statfs:
- .f_type: dd 00h
- .f_bsize: dd 00h
- .f_blocks: dd 00h
- .f_bfree: dd 00h
- .f_bavail: dd 00h
- .f_files: dd 00h
- .f_free: dd 00h
- .f_fsid: dq 00h
- .f_namelen: dd 00h
- .f_frsize: dd 00h ; since linux 2.6
- .f_flags: dd 00h ; since linux 2.6.36
- mov [statfs.f_type], dword 2
- mov eax, [statfs.f_bsize]
- ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
- ; Dynamic structs ;
- f_type: equ 0
- f_bsize: equ f_type+4
- f_blocks: equ f_bsize+4
- f_bfree: equ f_blocks+4
- f_bavail: equ f_bfree+4
- f_files: equ f_bavail+4
- f_ffree: equ f_files+4
- f_fsid: equ f_ffree+4
- f_namelen: equ f_fsid+8
- f_frsize: equ f_namelen+4
- f_flags: equ f_frsize+4
- ; OR we can do it like so:
- %define f_type 0
- %define f_bsize 4
- %define f_blocks 8
- %define f_bfree 12
- %define f_bavail 16
- %define f_files 20
- %define f_ffree 24
- %define f_fsid 28
- %define f_namelen 36
- %define f_frsize 40
- %define f_flags 44
- mov [edi+f_type], dword 12
- mov [myStruct+f_type, dword 12
- mov eax, [myStruct+f_bsize]
- mov eax, [esi+f_bsize]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement