How do you guys know?

Author Message
nicklas

  • Total Posts : 3
  • Scores: 0
  • Reward points : 0
  • Joined: 3/7/2006
  • Status: offline
How do you guys know? Saturday, April 08, 2006 4:47 AM (permalink)
0
I've been searching around in this forum for some scripts that im might able to learn from.
 
But I find it impossible!
 
Do you use logic do get scripts? I mean seriously, look these scripts:
 




Const SHUTDOWN = 8
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate,(Shutdown)}!\\" & _
strComputer & "\root\cimv2")
Set colOperatingSystems = objWMIService.ExecQuery _
("SELECT * FROM Win32_OperatingSystem")
For Each objOperatingSystem in colOperatingSystems
ObjOperatingSystem.Win32Shutdown(SHUTDOWN)
Next




Set objExplorer = CreateObject("InternetExplorer.Application")
objExplorer.Navigate "about:blank"
objExplorer.ToolBar = 1
objExplorer.StatusBar = 1
objExplorer.Width = 5000 
objExplorer.Height = 5000
objExplorer.Visible = 1




How do people come up with this stuff?!
 
 
 
#1
    Cybex

    • Total Posts : 415
    • Scores: 0
    • Reward points : 0
    • Joined: 9/14/2005
    • Location: Florida
    • Status: offline
    RE: How do you guys know? Saturday, April 08, 2006 5:47 AM (permalink)
    0
    Google...

    Just a basic understanding of the language and how logic can be applied to accomplich a certain task.


    Cybex
    Common sense is not so common.
     
    #2
      DiGiTAL.SkReAM

      • Total Posts : 1259
      • Scores: 7
      • Reward points : 0
      • Joined: 9/7/2005
      • Location: Clearwater, FL, USA
      • Status: offline
      RE: How do you guys know? Saturday, April 08, 2006 3:46 PM (permalink)
      0
      When I joined this board in Sept. of 2005, I knew very little about VBScripting.  Ok, I still don't know a lot, BUT... I'm able to get doen pretty much anything that i want to get done - it might not be the best or slickest way of doing it, but it *works*.  The point is, nobody just *knows* this stuff... it all comes from experience.  For me, the best thing I could have done is join this board.  It's awfully hard to sit there looking at a blank screen saying "I wonder what I should try to write to learn this language?" - for me, it's MUCh easier to have well-defined goals.  Therefore, i'd browse the posts here where folks were asking questions "How do you get a script to write to a text file?", or "How do you get vbs to copy a file?" for example.  I'd think "yeah, how *do* you do that?" and then I'd hit google with "vbscript copy a file" or "vbscript output text file".  And I wouldn't stop until I had the answer.
      Now, granted, by that time, someone else had already answered the question about 99% of the time, but... I had still learned something. 
       
      My point: It made things much easier for me to learn vbs to try answering some of the questions that people asked here.  And when I coulnd't get the answer - to read what other folks had replied with.
       
      Either way, you win.
      "Would you like to touch my monkey?" - Dieter (Mike Meyers)

      "It is better to die like a tiger, than to live like a pussy."
      -Master Wong, from Balls of Fury
       
      #3
        Snipah

        • Total Posts : 1339
        • Scores: 8
        • Reward points : 0
        • Joined: 11/1/2004
        • Location: Scotland
        • Status: offline
        RE: How do you guys know? Saturday, April 08, 2006 9:41 PM (permalink)
        0
        It is the same like, looking under the hood of your car...It doesn't make sense at first sight, only after a little more experience and repetition, you find the logic hidden in that code....
         
        Isn't it fun to program? hahaha
         
        It took a while, but nowadays i know enough about i.e. HTML/VBScript/C++/PHP/CSS/Java/JavaScript/Pascal/BASIC/Batch/etc...and it wasn't easy to get there...
        For more information, please see the "Read me First" topic.

        http://www.visualbasicscript.com
         
        #4
          mcds99

          • Total Posts : 519
          • Scores: 4
          • Reward points : 0
          • Joined: 2/28/2006
          • Status: offline
          RE: How do you guys know? Tuesday, April 11, 2006 9:15 AM (permalink)
          0
          It's Magic, we work in the technology industry, scripting for years, all of a sudden we can type gibberish ;-D
           
          #5
            daluu

            • Total Posts : 53
            • Scores: 0
            • Reward points : 0
            • Joined: 4/17/2006
            • Status: offline
            RE: How do you guys know? Friday, April 28, 2006 10:54 AM (permalink)
            0
            that sample looks benign compared to truly cryptic programs, like some complex ones written in Perl and C, etc. VBScript is pretty English-like if you have good English skills.
             
            #6
              TNO

              • Total Posts : 2094
              • Scores: 36
              • Reward points : 0
              • Joined: 12/18/2004
              • Location: Earth
              • Status: offline
              RE: How do you guys know? Monday, May 15, 2006 5:46 AM (permalink)
              0
               Posting the most cryptic program I can come up with:

              In a PDF document this simply prints "Hello World"

               %PDF-1.0
               1 0 obj
               <<
               /Type /Catalog
               /Pages 3 0 R
               /Outlines 2 0 R
               >>
               endobj
               2 0 obj
               <<
               /Type /Outlines
               /Count 0
               >>
               endobj
               3 0 obj
               <<
               /Type /Pages
               /Count 1
               /Kids [4 0 R]
               >>
               endobj
               4 0 obj
               <<
               /Type /Page
               /Parent 3 0 R
               /Resources << /Font << /F1 7 0 R >>/ProcSet 6 0 R
               >>
               /MediaBox [0 0 612 792]
               /Contents 5 0 R
               >>
               endobj
               5 0 obj
               << /Length 44 >>
               stream
               BT
               /F1 24 Tf
               100 100 Td (Hello World) Tj
               ET
               endstream
               endobj
               6 0 obj
               [/PDF /Text]
               endobj
               7 0 obj
               <<
               /Type /Font
               /Subtype /Type1
               /Name /F1
               /BaseFont /Helvetica
               /Encoding /MacRomanEncoding
               >>
               endobj
               xref
               0 8
               0000000000 65535 f
               0000000009 00000 n
               0000000074 00000 n
               0000000120 00000 n
               0000000179 00000 n
               0000000322 00000 n
               0000000415 00000 n
               0000000445 00000 n
               trailer
               <<
               /Size 8
               /Root 1 0 R
               >>
               startxref
               553
               %%EOF
               
               

               
              ooo...or even better, in C
               
                #include <windows.h>
               
               LRESULT CALLBACK WindowProcedure(HWND, UINT, WPARAM, LPARAM);
               
               char szClassName[] = "MainWnd";
               
               int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine,
                                  int nCmdShow)
               {
                 HWND hwnd;
                 MSG msg;
                 WNDCLASSEX wincl;
               
                 wincl.cbSize = sizeof(WNDCLASSEX);
                 wincl.cbClsExtra = 0;
                 wincl.cbWndExtra = 0;
                 wincl.style = 0;
                 wincl.hInstance = hInstance;
                 wincl.lpszClassName = szClassName;
                 wincl.lpszMenuName = NULL; //No menu
                 wincl.lpfnWndProc = WindowProcedure;
                 wincl.hbrBackground = (HBRUSH)(COLOR_WINDOW + 1); //Color of the window
                 wincl.hIcon = LoadIcon(NULL, IDI_APPLICATION); //EXE icon
                 wincl.hIconSm = LoadIcon(NULL, IDI_APPLICATION); //Small program icon
                 wincl.hCursor = LoadCursor(NULL, IDC_ARROW); //Cursor
               
                 if (!RegisterClassEx(&wincl))
                       return 0;
               
                 hwnd = CreateWindowEx(0, //No extended window styles
                       szClassName, //Class name
                       "", //Window caption
                       WS_OVERLAPPEDWINDOW & ~WS_MAXIMIZEBOX,
                       CW_USEDEFAULT, CW_USEDEFAULT, //Let Windows decide the left and top
                                                     //positions of the window
                       120, 50, //Width and height of the window,
                       NULL, NULL, hInstance, NULL);
               
                 //Make the window visible on the screen
                 ShowWindow(hwnd, nCmdShow);
               
                 //Run the message loop
                 while (GetMessage(&msg, NULL, 0, 0)>0)
                 {
                       TranslateMessage(&msg);
                       DispatchMessage(&msg);
                 }
                 return msg.wParam;
               }
               
               LRESULT CALLBACK WindowProcedure(HWND hwnd, UINT message,
                                                WPARAM wParam, LPARAM lParam)
               {
                 PAINTSTRUCT ps;
                 HDC hdc;
                 switch (message)
                 {
                 case WM_PAINT:
                       hdc = BeginPaint(hwnd, &ps);
                       TextOut(hdc, 15, 3, "Hello, world!", 13);
                       EndPaint(hwnd, &ps);
                       break;
                 case WM_DESTROY:
                       PostQuitMessage(0);
                       break;
                 default:
                       return DefWindowProc(hwnd, message, wParam, lParam);
                 }
                 return 0;
               }
               

               

              <message edited by TNO on Monday, May 15, 2006 5:49 AM>
              To iterate is human, to recurse divine. -- L. Peter Deutsch
               
              #7

                Online Bookmarks Sharing: Share/Bookmark

                Jump to:

                Current active users

                There are 0 members and 1 guests.

                Icon Legend and Permission

                • New Messages
                • No New Messages
                • Hot Topic w/ New Messages
                • Hot Topic w/o New Messages
                • Locked w/ New Messages
                • Locked w/o New Messages
                • Read Message
                • Post New Thread
                • Reply to message
                • Post New Poll
                • Submit Vote
                • Post reward post
                • Delete my own posts
                • Delete my own threads
                • Rate post

                2000-2012 ASPPlayground.NET Forum Version 3.9