Advertisement
Anders

NSIS Instfiles page _click_ on "headers" PoC using the Butto

Sep 22nd, 2011
341
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Instfiles page _click_ on "headers" PoC using the ButtonEvent plug-in
  2.  
  3. Outfile "test.exe"
  4. RequestExecutionLevel user
  5. ShowInstDetails nevershow
  6.  
  7. !addplugindir ".\" ;a neat trick so we don't have to "install" the plugin
  8.  
  9. !include nsDialogs.nsh
  10.  
  11. Page Instfiles "" InstPageShow
  12.  
  13. !define IDC_THING1 6001
  14. !define IDC_THING2 6002
  15.  
  16. Function ClickedThing
  17. ButtonEvent::WhichButtonId
  18. Pop $0
  19. IntOp $0 $0 - 6000
  20. DetailPrint "Thing$0!"
  21. FunctionEnd
  22.  
  23. Function InstPageShow
  24. FindWindow $9 "#32770" "" $HWNDPARENT
  25. CreateFont $8 "Arial" 12 800
  26. GetFunctionAddress $7 ClickedThing
  27.  
  28. System::Call 'USER32::CreateWindowEx(i ${__NSD_Label_EXSTYLE},t "Static",t "Thing1",i ${__NSD_Label_STYLE},i 10,i 100,i 70,i 20,i $9,i ${IDC_THING1},i,i)i.r0'
  29. SendMessage $0 ${WM_SETFONT} $8 1
  30. ButtonEvent::AddEventHandler ${IDC_THING1} $7
  31.  
  32. System::Call 'USER32::CreateWindowEx(i ${__NSD_Label_EXSTYLE},t "Static",t "Thing2",i ${__NSD_Label_STYLE},i 110,i 100,i 70,i 20,i $9,i ${IDC_THING2},i,i)i.r0'
  33. SendMessage $0 ${WM_SETFONT} $8 1
  34. ButtonEvent::AddEventHandler ${IDC_THING2} $7
  35. FunctionEnd
  36.  
  37. Section
  38. Nop
  39. SectionEnd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement