Results 1 to 1 of 1

Thread: The Simple Client :}... very basic..

  1. #1
    |< x != '+' BanMe's Avatar
    Join Date
    Oct 2008
    Location
    Farmington NH
    Posts
    510
    Blog Entries
    4

    The Simple Client :}... very basic..

    Code:
    #define PORTNAME L"\\LpcInterceptPort"
    DWORD WINAPI ModuleConnectClientServer(LPVOID)
    {
        SECURITY_QUALITY_OF_SERVICE SecurityQos;
        REMOTE_PORT_VIEW ServerView;
        UNICODE_STRING PortName;
        LARGE_INTEGER SectionSize = {LARGE_MESSAGE_SIZE};
        PORT_MESSAGE MessageHeader;
        PORT_VIEW ClientView;
        NTSTATUS Status = STATUS_SUCCESS;
        HANDLE SectionHandle = NULL;
        HANDLE PortHandle = NULL;
    
        __try
        {
            Status = NtCreateSection(&SectionHandle,
                                      SECTION_ALL_ACCESS,
                                      NULL,         // Backed by the pagefile
                                     &SectionSize,
                                      PAGE_EXECUTE_READWRITE,
                                      SEC_COMMIT,
                                      NULL);
            if(!NT_SUCCESS(Status))
                __leave;
            RtlInitUnicodeString(&PortName, LpcPortName);
            SecurityQos.Length = sizeof(SECURITY_QUALITY_OF_SERVICE);
            SecurityQos.ImpersonationLevel = SecurityImpersonation;
            SecurityQos.EffectiveOnly = FALSE;
            SecurityQos.ContextTrackingMode = SECURITY_DYNAMIC_TRACKING;
    
            ClientView.Length        = sizeof(PORT_VIEW);
            ClientView.SectionHandle = SectionHandle;
            ClientView.SectionOffset = 0;
            ClientView.ViewSize      = LARGE_MESSAGE_SIZE;
            ServerView.Length        = sizeof(REMOTE_PORT_VIEW);
    
            Status = NtConnectPort(&PortHandle,
                                   &PortName,
                                   &SecurityQos,
                                   &ClientView,
                                   &ServerView,
                                    0,
                                    NULL,
                                    NULL);
            if(!NT_SUCCESS(Status))
                __leave;
            InitializeMessageHeader(&MessageHeader, sizeof(PORT_MESSAGE), LPC_NEW_MESSAGE);
    		wcscpy((PWSTR)ServerView.ViewBase, L"Hello System...");
    
             Status = NtRequestWaitReplyPort(PortHandle, &MessageHeader, &MessageHeader);
        }
        __finally
        {
            if(PortHandle != NULL)
                NtClose(PortHandle);
            if(SectionHandle != NULL)
                NtClose(SectionHandle);
        }
        return 0;
    }
    this is gonna be updated frequently, hopefully I can get some tester/experimentors opions and ideas with this one again this is just a basic test of communication :}

    this basic client is simply slightly modified stripped down version of lad client..
    found here:http://www.zezula.net/en/prog/lpc.html

    LARGE_MESSAGE_SIZE = some arbitrary size.. :]

    regards BanMe
    Last edited by BanMe; June 14th, 2009 at 21:20.

Similar Threads

  1. softice and visual basic
    By qmark in forum Tools of Our Trade (TOT) Messageboard
    Replies: 4
    Last Post: October 23rd, 2013, 02:02
  2. basic ollyDBG qyestions
    By undream in forum OllyDbg Support Forums
    Replies: 1
    Last Post: July 4th, 2009, 21:27
  3. Very basic Olly question
    By Streebgreebling in forum OllyDbg Support Forums
    Replies: 2
    Last Post: November 25th, 2005, 19:58
  4. visual basic debugging
    By Anonymous in forum OllyDbg Support Forums
    Replies: 1
    Last Post: August 10th, 2003, 15:34
  5. I know, VERY basic, but ... How do you identify a VB app?
    By zeeman in forum Malware Analysis and Unpacking Forum
    Replies: 6
    Last Post: March 1st, 2001, 15:36

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •