Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

What lang is this?

Name: Anonymous 2011-10-23 4:01


#define REMOVE_FROM_ZONE(zone, ret, type)                   \
MACRO_BEGIN                                 \
    (ret) = (type) (zone)->free_elements;                   \
    if ((ret) != (type) 0) {                        \
        if (check_freed_element) {                  \
            if (!is_kernel_data_addr(((vm_offset_t *)(ret))[0]) ||  \
                ((zone)->elem_size >= (2 * sizeof(vm_offset_t)) &&  \
                ((vm_offset_t *)(ret))[((zone)->elem_size/sizeof(vm_offset_t))-1] != \
                ((vm_offset_t *)(ret))[0]))             \
                panic("a freed zone element has been modified");\
            if (zfree_clear) {                  \
                unsigned int ii;                \
                for (ii = sizeof(vm_offset_t) / sizeof(uint32_t); \
                     ii < zone->elem_size/sizeof(uint32_t) - sizeof(vm_offset_t) / sizeof(uint32_t); \
                     ii++)                  \
                    if (((uint32_t *)(ret))[ii] != (uint32_t)0xdeadbeef) \
                        panic("a freed zone element has been modified");\
            }                           \
        }                               \
        (zone)->count++;                        \
        (zone)->free_elements = *((vm_offset_t *)(ret));        \
    }                                   \
MACRO_END

I think its python, not sure. Ignore all the random \

Name: Anonymous 2011-10-23 4:08

One word C thread over.

Name: Anonymous 2011-10-23 4:13

A bit of Googling reveals, this is a listing from a book called "A Guide to Kernel Exploitation: Attacking the Core". Wannabe-hacker?

Name: Anonymous 2011-10-23 4:30

>>3
right you are, thats what its from.
And no im not a wannabe. Its just an interesting read.

Name: Anonymous 2011-10-23 4:50

>Attacking the Core
F0r m4ssive DMG

Name: Anonymous 2011-10-23 6:11

>sizeof(uint32_t)
>0xdeadbeef
Enterprise Cee

Name: Anonymous 2011-10-23 6:52

I saw "zone" and thought you found this in BIND or some other DNS-related software.

Name: Anonymous 2011-10-23 7:21

Name: Anonymous 2011-10-23 10:40

C + C macros.

Name: Anonymous 2011-10-23 12:05

File:    kern/zalloc.c
 *    Author:    Avadis Tevanian, Jr.
 *
 *    Zone-based memory allocator.  A zone is a collection of fixed size
 *    data blocks for which quick allocation/deallocation is possible.

Name: FrozenVoid 2011-10-23 12:14

>>10
>fixed size data blocks
I call them arrays and i don't see any need for expensive malloc calls to manage them.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List