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:13

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

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