Page 3 of 5 FirstFirst 12345 LastLast
Results 51 to 75 of 106

Thread: ProSocks

  1. #51
    Join Date
    Jul 2009
    Posts
    166
    Mentioned
    5 Post(s)
    Quoted
    69 Post(s)

    Post

    Code:
    Program Server2;
    {$I Socks.Simba}
    
    var
    recv:String;
    info:SSLSocket;
    
    procedure Connect(Address: String;Port:Integer);
     begin
      info.port := Port;
      info.address := @Address[1];
      info.socktype := SSLSocketType.SSL23_SERVER_METHOD;
    
      Pro_CreateSocket(@info);
      Pro_ConnectSocket(@info);
      writeln(info);
    end;
    
    
    procedure Read();
    begin
      if Pro_IsPendingSocket(@info)then
      begin
      writeln('Data recived');
      end;
      Pro_ReadSocket(@info, @recv, 512);
    end;
    
    
    procedure Destroy();
    begin
      Pro_FreeSocket(@info);
    end;
    
    
     begin
     Connect('localhost',80);
     repeat
      Wait(500);
      Read();
       writeln(recv);
     until(false);
     Destroy();
     end.
    Code:
    Program Client2;
    {$I Socks.Simba}
    
    var
    recv:String;
    info:SSLSocket;
    
    procedure Connect(Address: String;Port:Integer);
     begin
      info.port := Port;
      info.address := @Address[1];
      info.socktype := SSLSocketType.SSL23_CLIENT_METHOD;
    
      Pro_CreateSocket(@info);
      Pro_ConnectSocket(@info);
      writeln(info);
    end;
    
    
    procedure Write();
    begin
      Pro_WriteSocket(@info, 'ppd', 512);
    end;
    
    
    procedure Destroy();
    begin
      Pro_FreeSocket(@info);
    end;
    
    
     begin
     Connect('localhost',80);
     repeat
      Wait(500);
      Write();
       //writeln(recv);
     until(false);
     Destroy();
     end.
    So they are on diffrent simbas.
    Server gives:
    {SOCK = 1140, SSL = 78072184, CTX = 78072872, ADDRESS = 0x7F24700 (l), PORT = 80, CONNECTED = True, SOCKTYPE = SSL23_SERVER_METHOD}
    Client gives:
    {SOCK = 576, SSL = 100356568, CTX = 59930872, ADDRESS = 0xBC705B8 (l), PORT = 80, CONNECTED = False, SOCKTYPE = SSL23_CLIENT_METHOD}

    They dosen't seem to be connected(false thing), socket and stuff have diffrent values. Help!!!

    Edit: Can we have without encryption choice, I just wanna send/receive data on localhost.
    Mainly I wanto set up cheat engine/simba.
    Last edited by alar82; 05-12-2014 at 10:59 PM.

  2. #52
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by alar82 View Post
    Edit: Can we have without encryption choice, I just wanna send/receive data on localhost.
    Mainly I wanto set up cheat engine/simba.

    Yes you can. On Simba, there is a function list on the left side. Click to expand the sockets section.
    Use those.

    Btw.. your server code is wrong.. You "never accepted" the client's connection. You need to call "acceptsocket" (Not sure if I exported that in this version of the plugin). However, even in Simba's regular sockets you need to accept each client.


    Example (see all of my posts here): http://villavu.com/forum/showthread.php?t=104517


    Another example is: http://paste.villavu.com/show/5957/
    Last edited by Brandon; 05-12-2014 at 11:27 PM.
    I am Ggzz..
    Hackintosher

  3. #53
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default



    Works perfectly, thank you.

  4. #54
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by Sin View Post


    Works perfectly, thank you.
    Now this is what I like to see! Creativity and good use! damn that looks nice. How'd you get such a weird number?
    I am Ggzz..
    Hackintosher

  5. #55
    Join Date
    Dec 2011
    Location
    Toronto, Ontario
    Posts
    6,424
    Mentioned
    84 Post(s)
    Quoted
    863 Post(s)

    Default

    http://www.emailtextmessages.com/

    Get your provider (mine is Telus) and add your number infront of it.
    So my telephone number would be 416*******@msg.telus.com.
    I get the alerts directly to my phone when i'm at the gym

  6. #56
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Update for pascal script.. Functions are the same.. @elfyyy;

    https://github.com/Brandon-T/ProSocks/releases/tag/v0.1


    Include (supports both Lape AND PascalScript):

    Simba Code:
    {$loadlib ProSocks}

    type
      SMTP = record
        {$IFNDEF CODEINSIGHT}
        Addr: String;
        User: String;
        EUser: String;
        EPass: String;
        Rec: String;
        FName: String;
        TName: String;
        Subj: String;
        Msg: String;
        BuffSize: Integer;
        Sock: SSLSocket;
        {$ENDIF}
      end;

    type
      HTTPS = record
        {$IFNDEF CODEINSIGHT}
        Hdrs: Array Of String;
        PKeys: Array Of String;
        PVals: Array Of String;
        Host: String;
        Addr: String;
        BuffSize: Integer;
        Sock: SSLSocket;
        {$ENDIF}
      end;

    {$IFNDEF CODEINSIGHT}
    Procedure MemSet(var Buffer: String; Value: Byte; Size: Cardinal);
    var
      I: Integer;
    Begin
      For I := 1 To Length(Buffer) Do
        Buffer[I] := Chr(Value);
    End;

    Procedure SMTP_PrintSocket(var this: SMTP);
    var
      Buffer: String;
      Bytes_Read: Integer;
    Begin
      SetLength(Buffer, this.buffsize);

      Repeat
        {$IFDEF LAPE}
        Bytes_Read := Pro_ReadSocket(this.sock, @buffer[1], this.buffsize);
        {$ELSE}
        Bytes_Read := Pro_ReadSocket(this.sock, buffer, this.buffsize);
        {$ENDIF}

        writeln(Trim(Buffer));
        MemSet(Buffer, 0, this.buffsize);
        If (Pro_BytesPendingSocket(this.sock) <= 0) Then
          break;
      Until(Bytes_Read <= 0);
    End;
    {$ENDIF}

    Function SMTP_Create(var this: SMTP; Address: String; Port: Word; Username, Password, MailTo, Subject: String): Boolean;
    {$IFNDEF LAPE}
    var
      PSDummy: SSLSocketType;
    {$ENDIF}
    begin
      this.Addr := Address;
      this.sock.port := Port;
      this.sock.blockmode := true;
      this.sock.timeout := 3000;
      {$IFDEF LAPE}
      this.sock.address := @this.Addr[1];
      this.sock.socktype := SSLSocketType.SSL23_CLIENT_METHOD;
      {$ELSE}
      PSDummy := SSL23_CLIENT_METHOD;
      this.sock.address := this.Addr;
      this.sock.socktype := Ord(PSDummy);
      {$ENDIF}

      this.EUser := Base64Encode(Username);
      this.EPass := Base64Encode(Password);

      this.User := Username;
      this.Rec := MailTo;
      this.Subj := Subject;
      this.BuffSize := 512;

      Pro_CreateSocket(this.sock);
      Result := Pro_ConnectSocket(this.sock);
    end;

    Procedure SMTP_Free(var this: SMTP);
    begin
      Pro_CloseSocket(this.sock);
      Pro_FreeSocket(this.sock);
    end;

    Function SMTP_SendMail(var this: SMTP): Boolean;
    var
      Str: String;
    Begin
      If (this.sock.connected) Then
      Begin
        Str := 'EHLO ' + this.Addr + #13#10;
        Pro_WriteSocket(this.sock, Str, Length(Str));
        SMTP_PrintSocket(this);

        Str := 'AUTH LOGIN' + #13#10;
        Pro_WriteSocket(this.sock, Str, Length(Str));
        SMTP_PrintSocket(this);
        SMTP_PrintSocket(this);

        Pro_WriteSocket(this.sock, this.EUser + #13#10, Length(this.EUser) + 2);
        SMTP_PrintSocket(this);

        Pro_WriteSocket(this.sock, this.EPass + #13#10, Length(this.EPass) + 2);
        SMTP_PrintSocket(this);
        SMTP_PrintSocket(this);

        Str := 'MAIL FROM: <' + this.User + '>' + #13#10;
        Pro_WriteSocket(this.sock, Str, Length(Str));
        SMTP_PrintSocket(this);

        Str := 'VRFY ' + this.User + #13#10;
        Pro_WriteSocket(this.sock, Str, Length(Str));
        SMTP_PrintSocket(this);

        Str := 'RCPT TO: <' + this.Rec + '>' + #13#10;
        Pro_WriteSocket(this.sock, Str, Length(Str));
        SMTP_PrintSocket(this);

        Pro_WriteSocket(this.sock, 'DATA' + #13#10, 6);
        SMTP_PrintSocket(this);

        Str := 'From: ' + this.FName + '<' + this.User + '>' + #13#10;
        Str := Str + 'To: ' + this.TName + '<' + this.Rec + '>' + #13#10;
        Str := Str + 'Subject: ' + this.Subj + #13#10#13#10;
        Pro_WriteSocket(this.sock, Str, Length(Str));

        Pro_WriteSocket(this.sock, this.Msg + #13#10 + '.' + #13#10, Length(this.Msg) + 5);
        SMTP_PrintSocket(this);
        Pro_WriteSocket(this.sock, 'QUIT' + #13#10, 6);
        SMTP_PrintSocket(this);
        Result := True;
      End;
      Result := False;
    End;



    {$IFNDEF CODEINSIGHT}
    Function HTTPS_HexToInt(Hex : String): Integer;
      var
        Str : String;
      Begin;
        Str := '$' + Trim(Hex);
        Result := StrToInt(Str);
        If (Pos('-', Hex) > 0) Then
          Result := -Result;
      End;

    Function HTTPS_GetHost(var this: HTTPS): String;
    var
      I: Integer;
    Begin
      Result := this.Addr;
      I := Pos('://', Result);
      if (I >= 0) then
        Result := Copy(Result, I + 3, Length(Result) - I);

      I := Pos('/', Result);
      if (I > 0) then
        Result := Copy(Result, 0, I - 1);
    End;

    Function HTTPS_GetLocation(var this: HTTPS): String;
    var
      I: Integer;
    Begin
      Result := this.Addr;
      I := Pos('://', Result);
      if (I >= 0) then
        Result := Copy(Result, I + 3, Length(Result) - I);

      I := Pos('/', Result);
      if (I > 0) then
        Result := Copy(Result, I + 1, Length(Result) - I);
    End;

    Function HTTPS_RecvLine(var this: HTTPS): String;
    var
      Line: String;
      C: String;
    Begin
      SetLength(C, 1);
      While(True) Do
      Begin
        {$IFDEF LAPE}
        Pro_ReadSocket(this.sock, @C[1], 1);
        {$ELSE}
        Pro_ReadSocket(this.sock, C, 1);
        {$ENDIF}

        If (C[1] = #13) Then
        Begin
          {$IFDEF LAPE}
          Pro_ReadSocket(this.sock, @C[1], 1);
          {$ELSE}
          Pro_ReadSocket(this.sock, C, 1);
          {$ENDIF}
          If (C[1] = #10) Then Break;

          Line := Line + #13;
        End Else
          If (C[1] = #10) Then Break;

        Line := Line + C[1];
      End;

      Result := Line;
    End;

    Function HTTPS_RecvHeader(var this: HTTPS): TStringArray;
    var
      I: Integer;
      Line: String;
    Begin
      While(True) Do
      Begin
        Line := HTTPS_RecvLine(this);
        If (Length(Line) = 0) Then Exit;

        SetLength(Result, Length(Result) + 1);
        Result[I] := Line;
        Inc(I);
      End;
    End;

    Function HTTPS_FindHeaderValue(var this: HTTPS; LineToFind: String): String;
    var
      I, H, Position: Integer;
    Begin
      H := High(this.Hdrs);

      For I := 0 To H Do
      Begin
        Position := Pos(':', this.Hdrs[I]);
        If ((Position > 0) And (Copy(this.Hdrs[I], 0, Position - 1) = LineToFind)) Then
        Begin
          Position := Pos(' ', this.Hdrs[I]);
          If (Position <> 0) Then
          Begin
            Result := Copy(this.Hdrs[I], Position + 1, Length(this.Hdrs[I]) - Position);
            Exit;
          End;
        End;
      End;
    End;

    Function HTTPS_GetHeader(var this: HTTPS; Key: String): String;
    Begin
      If (Length(this.hdrs) <= 0) Then
        this.hdrs := HTTPS_RecvHeader(this);

      Result := HTTPS_FindHeaderValue(this, Key);
    End;

    Function HTTPS_RecvChunkSize(var this: HTTPS): Integer;
    var
      Line: String;
      Position: Integer;
    Begin
      Line := HTTPS_RecvLine(this);
      Position := Pos(';', Line);
      If (Position <> 0) Then
        Delete(Line, Position, 1);

      Result := HTTPS_HexToInt(Line);
    End;

    Function HTTPS_ReadChunked(var this: HTTPS): String;
    var
      Encoding: String;
      ChunkLength: Integer;
      Buffer: String;
      Bytes_Read: Integer;
    Begin
      SetLength(Buffer, this.buffsize);
      MemSet(Buffer, 0, this.buffsize);

      ChunkLength := 0;
      Encoding := Lowercase(HTTPS_GetHeader(this, 'Transfer-Encoding'));

      If (Encoding = 'chunked') Then
      Begin
        ChunkLength := HTTPS_RecvChunkSize(this);
        While(ChunkLength <> 0) Do
        Begin
          {$IFDEF LAPE}
          Bytes_Read := Pro_ReadSocket(this.sock, @Buffer[1], ChunkLength);
          {$ELSE}
          Bytes_Read := Pro_ReadSocket(this.sock, Buffer, ChunkLength);
          {$ENDIF}
          Result := Result + Copy(Buffer, 0, Bytes_Read);
          MemSet(Buffer, 0, this.buffsize);
          HTTPS_RecvLine(this);
          ChunkLength := HTTPS_RecvChunkSize(this);
        End;
      End Else
        Begin
          Encoding := HTTPS_GetHeader(this, 'Content-Length');
          If (Length(Encoding) > 0) Then
          Begin
            ChunkLength := StrToIntDef(Encoding, -1);
            If (ChunkLength > 0) Then
            Begin
              Bytes_Read := 0;

              While(Bytes_Read < ChunkLength) Do
              Begin
                MemSet(Buffer, 0, this.buffsize);
                {$IFDEF LAPE}
                Bytes_Read := Bytes_Read + Pro_ReadSocket(this.sock, @Buffer[1], this.buffsize);
                {$ELSE}
                Bytes_Read := Bytes_Read + Pro_ReadSocket(this.sock, Buffer, this.buffsize);
                {$ENDIF}
                Result := Result + Copy(Buffer, 0, Bytes_Read);

                If ((Bytes_Read >= ChunkLength) or (Bytes_Read = 0)) Then
                  Break;
              End;
            End;
          End Else
            Begin
              While(True) Do
              Begin
                {$IFDEF LAPE}
                Bytes_Read := Pro_ReadSocket(this.sock, @Buffer[1], this.buffsize);
                {$ELSE}
                Bytes_Read := Pro_ReadSocket(this.sock, Buffer, this.buffsize);
                {$ENDIF}
                If (Bytes_Read = 0) Then
                  Break;
                Result := Result + Copy(Buffer, 0, Bytes_Read);
                MemSet(Buffer, 0, this.buffsize);
              End;
            End;
        End;
      Result := Trim(Replace(Result, #0, '', [rfReplaceAll]));
    End;

    Function HTTPS_KeyFound(var this: HTTPS; Generic_Key: String): Boolean;
    var
      I: Integer;
    Begin
      Result := False;
      For I := 0 To High(this.pkeys) Do
      Begin
        If (this.pkeys[I] = Lowercase(Generic_Key)) Then
        Begin
          Result := True;
          Exit;
        End;
      End;
    End;
    {$ENDIF}


    Function HTTPS_Create(var this: HTTPS; Address: String; Port: Word): Boolean;
    {$IFNDEF LAPE}
    var
      PSDummy: SSLSocketType;
    {$ENDIF}
    begin
      this.Addr := Address;
      this.sock.port := Port;
      this.sock.blockmode := true;
      this.sock.timeout := 3000;
      this.Addr := HTTPS_GetHost(this);

      {$IFDEF LAPE}
      this.sock.address := @this.Addr[1];
      this.sock.socktype := SSLSocketType.SSL23_CLIENT_METHOD;
      {$ELSE}
      PSDummy := SSL23_CLIENT_METHOD;
      this.sock.address := this.Addr;
      this.sock.socktype := Ord(PSDummy);
      {$ENDIF}

      this.Addr := Address;
      this.buffsize := 512;
      Pro_CreateSocket(this.sock);
      Result := Pro_ConnectSocket(this.sock);
    End;

    Procedure HTTPS_Free(var this: HTTPS);
    Begin
      Pro_CloseSocket(this.sock);
      Pro_FreeSocket(this.sock);
    End;

    Procedure HTTPS_ClearParameters(var this: HTTPS);
    Begin
      SetLength(this.pkeys, 0);
      SetLength(this.pvals, 0);
    End;

    Function HTTPS_GetParameter(var this: HTTPS; Parameter: String): String;
    var
      I: Integer;
    Begin
      For I := 0 To High(this.pkeys) Do
        If (this.pvals[I] = Lowercase(Parameter)) Then
        Begin
          Result := this.pvals[I];
          Break;
        End;
    End;

    Procedure HTTPS_SetParameter(var this: HTTPS; Parameter, Value: String);
    var
      I, L: Integer;
      Exists: Boolean;
    Begin
      Exists := False;
      L := Length(this.pvals);

      For I := 0 To L - 1 Do
        If (this.pvals[I] = Lowercase(Parameter)) Then
        Begin
          this.pvals[I] := Lowercase(Parameter);
          Exists := True;
          Break;
        End;

      If (Not Exists) Then
      Begin
        SetLength(this.pkeys, L + 1);
        SetLength(this.pvals, L + 1);
        this.pkeys[L] := Lowercase(Parameter);
        this.pvals[L] := Value;
      End;
    End;

    Function HTTPS_CreateGetHeader(var this: HTTPS): String;
    var
      I: Integer;
      Generic_Keys: Array of String;
      Generic_Values: Array of String;
    Begin
      Generic_Keys := ['Connection', 'User-Agent', 'Accept', 'Accept-Language', 'Accept-Charset', 'Cache-Control'];
      Generic_Values := ['close', 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.97 Safari/537.11',
                          'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8', 'en-US,en;q=0.8', 'ISO-8859-1,UTF-8;q=0.7,*;q=0.7',
                          'no-cache'];

      Result := 'GET /' + HTTPS_GetLocation(this) + ' HTTP/1.1' + #13#10;
      Result := Result + 'Host: ' + HTTPS_GetHost(this) + #13#10;

      For I := 0 To High(Generic_Keys) Do
      Begin
        If (HTTPS_KeyFound(this, Generic_Keys[I])) Then
          Result := Result + this.pkeys[I] + ': ' + this.pvals[I] + #13#10
        Else
          Result := Result + Generic_Keys[I] + ': ' + Generic_Values[I] + #13#10;
      End;

      Result := Result + #13#10;
    End;

    Function HTTPS_GetPage(var this: HTTPS): String;
    var
      Header: String;
    Begin
      Header := HTTPS_CreateGetHeader(this);
      Pro_WriteSocket(this.sock, Header, Length(Header));
      Result := HTTPS_ReadChunked(this);
    End;

    Function HTTPS_GetRawPage(var this: HTTPS): String;
    var
      Header: String;
      Buffer: String;
      Bytes_Read: Integer;
    Begin
      Header := HTTPS_CreateGetHeader(this);
      Pro_WriteSocket(this.sock, Header, Length(Header));
      HTTPS_RecvHeader(this);

      SetLength(Buffer, this.buffsize);
      MemSet(Buffer, 0, this.buffsize);

      Repeat
        {$IFDEF LAPE}
        Bytes_Read := Pro_ReadSocket(this.sock, @Buffer[1], this.buffsize);
        {$ELSE}
        Bytes_Read := Pro_ReadSocket(this.sock, Buffer, this.buffsize);
        {$ENDIF}
        Result := Result + Trim(Buffer);
        MemSet(Buffer, 0, this.buffsize);
      Until(Bytes_Read <= 0);
      Result := Trim(Replace(Result, #0, '', [rfReplaceAll]));
    End;
    I am Ggzz..
    Hackintosher

  7. #57
    Join Date
    Nov 2006
    Location
    'Pergamino, BA, Argentina';
    Posts
    473
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Hey guys, could anyone give me an example on how to send a POST request using this plugin? Great job on developing it by the way Brandon! I'm finding it really useful already

  8. #58
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by Shady? View Post
    Hey guys, could anyone give me an example on how to send a POST request using this plugin? Great job on developing it by the way Brandon! I'm finding it really useful already
    Give me a sec to deal with the other issues of the plugin such as some headers leaking through. This plugin uses raw BSD sockets so everything is done manually.. ={

    For posting, if the URL is right, all you do is set the header, set the parameters and write to the socket instead of reading. After writing, you can read the response. Example in Java: https://villavu.com/forum/showthread...81#post1275581


    You see how in:

    Simba Code:
    Function HTTPS_GetPage(var this: HTTPS): String;
    var
      Header: String;
    Begin
      Header := HTTPS_CreateGetHeader(this); //this line..
      Pro_WriteSocket(this.sock, Header, Length(Header));
      Result := HTTPS_ReadChunked(this);
    End;

    it creates the GET header first then writes to the socket. Instead you need to create a POST header then write to the socket.
    All parameters in a POST request have a key-value pair and each is separated by an ampersand sign.


    Give me a couple minutes and I'll see if I can simplify it greatly. I'll probably also patch the stupid get headers or use libcurl to do it.

    If I use libcurl, there'd probably never be any glitches or problems and things will be a ton easier but I'm a kind of DIY-er guy.. We'll see.
    Last edited by Brandon; 10-19-2014 at 08:01 PM.
    I am Ggzz..
    Hackintosher

  9. #59
    Join Date
    Nov 2006
    Location
    'Pergamino, BA, Argentina';
    Posts
    473
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    Give me a sec to deal with the other issues of the plugin such as some headers leaking through. This plugin uses raw BSD sockets so everything is done manually.. ={

    For posting, if the URL is right, all you do is set the header, set the parameters and write to the socket instead of reading. After writing, you can read the response. Example in Java: https://villavu.com/forum/showthread...81#post1275581


    You see how in:

    Simba Code:
    Function HTTPS_GetPage(var this: HTTPS): String;
    var
      Header: String;
    Begin
      Header := HTTPS_CreateGetHeader(this); //this line..
      Pro_WriteSocket(this.sock, Header, Length(Header));
      Result := HTTPS_ReadChunked(this);
    End;

    it creates the GET header first then writes to the socket. Instead you need to create a POST header then write to the socket.
    All parameters in a POST request have a key-value pair and each is separated by an ampersand sign.


    Give me a couple minutes and I'll see if I can simplify it greatly. I'll probably also patch the stupid get headers or use libcurl to do it.

    If I use libcurl, there'd probably never be any glitches or problems and things will be a ton easier but I'm a kind of DIY-er guy.. We'll see.
    That's great to hear! I actually created a couple of functions:

    Simba Code:
    Function HTTPS.CreatePostHeader: String;

    All I did there was edit this line
    Simba Code:
    Result := 'GET /' + self.__GetLocation(self.__Address) + ' HTTP/1.1' + #13#10;
    to
    Simba Code:
    Result := 'POST /' + self.__GetLocation(self.__Address) + ' HTTP/1.1' + #13#10;
    But as I had no idea of what I was doing, it didn't work. I also created a Function HTTPS.PostRawPage: String; which is equal to GetRawPage but it calls self.CreatePostHeader(); instead. Glad to see you're actively developing this !

  10. #60
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by Shady? View Post
    ...
    Still cross-platform and in development.. I'll be finished everything by tomorrow (i think). Currently, I focused mostly on getting the bug fixed reported by elfffy for PS get-page. You can see the code below for an example of the "new" way of getting a page.
    ProSocks.zip

    License is GPL3 with the following exception (for developers.. same as the Debian distribution license):
    Code:
    In addition, as a special exception, the copyright holders give
    permission to link the code of portions of this program with the
    OpenSSL library under certain conditions as described in each
    individual source file, and distribute linked combinations including
    the two.
    
    You must obey the GNU General Public License in all respects for all
    of the code used other than OpenSSL. If you modify file(s) with this
    exception, you may extend this exception to your version of the
    file(s), but you are not obligated to do so. If you do not wish to do
    so, delete this exception statement from your version. If you delete
    this exception statement from all source files in the program, then
    also delete it here.

    I haven't gotten around to writing a proper include yet so I wouldn't be in a hurry to use this, but here is a list of its capabilities:

    Lape (memory manager example):
    Simba Code:
    {$loadlib prosocks}

    function PCharToStr(P: PChar): String;
    var
      L: Integer;
      PP: PChar := P;
    begin
      while (PP^ <> #0) do
      begin
        Inc(PP); Inc(L);
      end;
      SetLength(Result, L + 1);
      MemMove(P^, Result[1], L);
    end;

    Function Pro_CustomWriteF(contents: PChar; size: PtrUInt; nmemb: PtrUint; var userp: String): PtrUInt;
    var
      realsize: PtrUInt;
      l: PtrUInt;
      ptr: PChar;
    begin
      ptr := @userp;
      realsize := size * nmemb;

      if (size <> 0) then
      begin
        l := Length(UserP);
        if (l = 0) then l := 1;
        SetLength(UserP, Length(UserP) + realsize);
        MemMove(Contents^, UserP[l], realsize); //<3 slacky.
      end else
        if (ptr <> nil) then
          SetLength(UserP, 0);

      Result := realsize;
    end;

    Function Pro_CustomErrorHandlerF(str: PChar; errorcode: LongInt): PtrUInt;
    begin
      writeln('Error: ' + PCharToStr(Str));
      writeln('Error Code: ' + ToStr(ErrorCode));
    end;

    Function Pro_CustomStrLenF(var str: String): PtrUInt;
    begin
      Result := Length(str);
    end;

    var
      S: SSLSocket;
      Str: String;
    begin
      S.Timeout := 500;
      S.caller_allocates := true;
      S.data := @Str;
      Pro_InitSocket(S, Natify(@Pro_CustomWriteF), Natify(@Pro_CustomWriteF), Natify(@Pro_CustomErrorHandlerF), Natify(@Pro_CustomStrLenF));
      Pro_CreateSocket(S, '');
      Pro_SetSSL(S, false, true);
      Pro_SetURL(S, 'https://villavu.com/forum/');
      Pro_DoGet(S);
      Pro_FreeSocket(S);

      writeln(Str);
    end.
    end.


    Don't mind the pchartostr.. That's just because lape is retarded and can't print pchars like pascal script.. @Olly; tell me why..

    Other than that, the rest of code is actually optional. It lets lape do the allocations instead of C. These are all callbacks. Whenever the socket receives data, it calls the above functions. The first is for every bit of data it receives. The second function is for headers that it receives and the third is for error handling. If there is an error, it calls that function and passes it a description as well as an error code. The last function is just a wrapper that it calls to get the length of a lape string.

    IMO, the lape code is absolute crap (because of the pchar stuff). Not sure how much of an overhead 'native' or 'natify' have in lape but with slacky's suggestion, the lape code is a lot faster now. Still not as fast as the plugin's code.

    The much simpler approach which can also be done in Lape is to let C handle the allocations (notice there's no include yet? That's a huge simplification from before. Might not ever need one, who knows.. ):

    PascalScript/Lape:
    Simba Code:
    {$loadlib prosocks} //load the lib.. no include so far..

    var
      S: SSLSocket;
      res: ProMemoryStruct;
    begin
      Pro_InitSocket(S, nil, nil, nil, nil);
      Pro_CreateSocket(S, '');
      Pro_SetSSL(S, false, true);
      Pro_SetURL(S, 'https://villavu.com/forum/');
      Pro_DoGetEx(S, res);
      writeln(res.memory);
      Pro_FreeSocket(S);
    end.


    Others functions:
    //Pro_AddPostParameter(S: SSLSocket, key, value: String; escapeString: Boolean);
    //Procedure Pro_SetURLFollow(S: SSLSocket, follow: Boolean);
    //Pro_SetCookies(S: SSLSocket; cookiejar, cookiefile: String);

    Those are just a few of the things the plugin contains.. I haven't added the 'GetRequest' parameters yet.. Easy to add. Some other features that it can handle are TLS and SSL requests:

    Pop3
    Imap
    Smtp
    Ftp
    Https
    Http
    etc...

    Also wrote a multi-plexer for fully asynchronous sockets (not non-blocking/timeout).. but I might leave it out of Simba because I don't see the need for threaded and queue requests..

    For now, you can try out some things with it but I'll be finishing the rest of it tomorrow.. Here's the current additions (these are additions onto the current raw SSL plugin.. This API is what will make things way easier for everyone, including me..)

    C Code:
    static const char* PascalExports[] =
    {
        #ifndef CURL_SSL
        "AcceptSocket", "Function Pro_AcceptSocket(var ssl_info, ssl_client_info: SSLSocket): Boolean;",
        "BindSocket", "Function Pro_BindSocket(var ssl_info: SSLSocket): Boolean;",
        "BytesPendingSocket", "Function Pro_BytesPendingSocket(var ssl_info: SSLSocket): Integer;",
        "CreateSocket", "Function Pro_CreateSocket(var ssl_info: SSLSocket): Boolean;",
        "ConnectSocket", "Function Pro_ConnectSocket(var ssl_info: SSLSocket): Boolean;",
        "ListenSocket", "Function Pro_ListenSocket(var ssl_info: SSLSocket): Boolean;",
        "SetBlockingSocket", "Function Pro_SetBlockingSocket(var ssl_info: SSLSocket): Boolean;",
        "SetTimeoutSocket", "Function Pro_SetTimeoutSocket(var ssl_info: SSLSocket): Boolean;",
        "SelectSocket", "Function Pro_SelectSocket(var ssl_info: SSLSocket; Read: Boolean): Integer;",
        "CloseSocket", "Function Pro_CloseSocket(var ssl_info: SSLSocket): Boolean;",
        "FreeSocket", "Function Pro_FreeSocket(var ssl_info: SSLSocket): Boolean;",
        "ReadSocket", "Function Pro_ReadSocket(var ssl_info: SSLSocket; Buffer: PChar; Size: Cardinal): Integer;",
        "WriteSocket", "Function Pro_WriteSocket(var ssl_info: SSLSocket; Buffer: String; Size: Cardinal): Integer;",
        #else
        "Curl_InitSocket", "Procedure Pro_InitSocket(var curl_info: SSLSocket; WriteFunc: ProWritePtr; HeaderFunc: ProWritePtr; ErrorHandlerFunc: ProErrorHandlerPtr; StrLenFunc: ProLenPtr);",
        "Curl_CreateSocket", "Procedure Pro_CreateSocket(var curl_info: SSLSocket; useragent: String);",
        "Curl_FreeSocket", "Procedure Pro_FreeSocket(var curl_info: SSLSocket);",
        "Curl_SetURLFollow", "Procedure Pro_SetURLFollow(var curl_info: SSLSocket; follow: Boolean);",
        "Curl_SetSSL", "Procedure Pro_SetSSL(var curl_info: SSLSocket; verifypeer, verifyhost: Boolean);",
        "Curl_SetCookies", "Procedure Pro_SetCookies(var curl_info: SSLSocket; const cookiejar: String; const cookiefile: String);",
        "Curl_SetHeaderCapture", "Procedure Pro_SetHeaderCapture(var curl_info: SSLSocket; enable: boolean);",
        "Curl_SetURL", "Procedure Pro_SetURL(var curl_info: SSLSocket; const URL: String);",
        "Curl_AddParameter", "Function Pro_AddPostParameter(var curl_info: SSLSocket; const key: String; const value: String; escape: Boolean): Boolean;",
        "Curl_DoGet", "Function Pro_DoGet(var curl_info: SSLSocket): PChar;",
        "Curl_DoGetEx", "Procedure Pro_DoGetEx(var curl_info: SSLSocket; var Res: ProMemoryStruct);",
        "Curl_DoPost", "Function Pro_DoPost(var curl_info: SSLSocket): PChar;",
        "Curl_DoPostEx", "Procedure Pro_DoPostEx(var curl_info: SSLSocket; var Res: ProMemoryStruct);",
        "Curl_GetHeaders", "Function Pro_GetHeaders(var curl_info: SSLSocket): PChar",
        "Curl_GetHeaders", "Function Pro_GetHeadersEx(var curl_info: SSLSocket): ProMemoryStruct;"
        #endif
    };

    static const char* PascalTypes[] =
    {
        #ifndef CURL_SSL
        "SSLSocketType", "(TLS1_CLIENT_METHOD, TLS1_SERVER_METHOD, TLS11_CLIENT_METHOD, TLS11_SERVER_METHOD, SSL2_CLIENT_METHOD, SSL2_SERVER_METHOD, SSL3_CLIENT_METHOD, SSL3_SERVER_METHOD, SSL23_CLIENT_METHOD, SSL23_SERVER_METHOD);",
        "SSLSocket", "{$IFNDEF LAPE}record sock: Cardinal; ssl: Cardinal; ctx: Cardinal; address: PChar; socktype: Integer; timeout: Cardinal; port: Word; connected: Boolean; blockmode: Boolean; end;{$ELSE}packed record sock: Cardinal; ssl: Cardinal; ctx: Cardinal; address: PChar; socktype: SSLSocketType; timeout: Cardinal; port: Word; connected: Boolean; blockmode: Boolean; end;{$ENDIF}"
        #else
        "ProWritePtr", "Function(contents: PChar; size: PtrUInt; nmemb: PtrUint; var userp: String): PtrUInt;",
        "ProErrorHandlerPtr", "Function(str: PChar; errorcode: LongInt): PtrUInt;",
        "ProLenPtr", "Function(var Str: String): PtrUInt",
        "ProMemoryStruct", "{$IFNDEF LAPE}record memory: PChar; size: PtrUInt; end;{$ELSE}packed record memory: PChar; size: PtrUInt; end;{$ENDIF}",
        "SSLSocket", "{$IFNDEF LAPE}record curl_handle: PtrUInt; headers: PChar; data: PChar; params: PChar; LengthFunc: Function(var Str: String): PtrUInt; ErrorHandlerFunc: Function(var str: string; errorcode: LongInt): PtrUInt; WriteFunc: Function(contents: PChar; size: PtrUInt; nmemb: PtrUint; var userp: String): PtrUInt; HeaderFunc: Function(contents: PChar; size: PtrUInt; nmemb: PtrUint; var userp: String): PtrUInt; Timeout: Cardinal; Port: Word; caller_allocates: Boolean; end;{$ELSE}packed record curl_handle: PtrUInt; headers: PChar; data: PChar; params: PChar; LengthFunc: Function(var Str: String): PtrUInt; ErrorHandlerFunc: Function(var str: string; errorcode: LongInt): PtrUInt; WriteFunc: Function(contents: PChar; size: PtrUInt; nmemb: PtrUint; var userp: String): PtrUInt; HeaderFunc: Function(contents: PChar; size: PtrUInt; nmemb: PtrUint; var userp: String): PtrUInt; Timeout: Cardinal; Port: Word; caller_allocates: Boolean; end;{$ENDIF}"
        #endif
    };
    Last edited by Brandon; 10-20-2014 at 07:41 AM.
    I am Ggzz..
    Hackintosher

  11. #61
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    995
    Mentioned
    145 Post(s)
    Quoted
    596 Post(s)

    Default

    @Brandon:
    The params of MemMove is the other way around, assuming your MemCpy is "Dest, Source", where MemMove is "Source, Dest".

    pascal Code:
    Function Pro_CustomWriteF(contents: PChar; size: PtrUInt; nmemb: PtrUint; var userp: String): PtrUInt;
    var
      realsize: PtrUInt;
      l: PtrUInt;
      ptr: PChar;
    begin
      ptr := @userp; //user p is a lape string provided by you. this string will be filled..
      realsize := size * nmemb; //sizeof(char) * length = total data size.

      if (size <> 0) then
      begin
        l := Length(UserP);
        if (l = 0) then l := 1;
        SetLength(UserP, Length(UserP) + realsize); //let lape resize the string appropriately.
        MemMove(Contents^, UserP[l], realsize); //let lape fill it with data..
      end else
        if (ptr <> nil) then
          SetLength(UserP, 0);

      Result := realsize;
    end;

    Anyways, good job! :-)
    Last edited by slacky; 10-20-2014 at 07:35 AM.
    !No priv. messages please

  12. #62
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by slacky View Post
    @Brandon:
    The params of MemMove is the other way around, assuming your MemCpy is "Dest, Source", where MemMove is "Source, Dest".

    Yes! This is what I needed <3. Updated the post. Now to get lape to print pchars and not their addresses..
    This suggestion worked perfectly fine though. I kept thinking it was like the memmove in C where it goes memmove(dest, src, len).. Never thought pascal would switch the parameters like that -_-.
    I am Ggzz..
    Hackintosher

  13. #63
    Join Date
    Feb 2012
    Location
    Norway
    Posts
    995
    Mentioned
    145 Post(s)
    Quoted
    596 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    Yes! This is what I needed <3. Updated the post. Now to get lape to print pchars and not their addresses..
    This suggestion worked perfectly fine though. I kept thinking it was like the memmove in C where it goes memmove(dest, src, len).. Never thought pascal would switch the parameters like that -_-.
    happy to help.

    Ref: «get lape to print pchars and not their addresses»
    If I get you right, you wanna changing the behavior of of WriteLn in Lape?(override ToString)
    pascal Code:
    // overrides lapes ToString, and treats PChar as a null-terminated string.
    function ToString(P:PChar):String; override;
    var
      PP: PChar := P;
    begin
      while not(PP^ = #0) do Inc(PP);

      SetLength(Result, PtrUInt(PP)-PtrUInt(P) + 1);
      MemMove(P^, Result[1], PtrUInt(PP)-PtrUInt(P));
    end;

    (*
    // Or.. just dereference the PChar
    function ToString(P:PChar): String; override;
    begin
      Result := P^;
    end;
    *)


    var
      Arr: Array of Char := ['a','b','c','d','e','f',#0];
    begin
      WriteLn( @Arr[0] );
    end.
    Last edited by slacky; 10-29-2014 at 10:38 AM.
    !No priv. messages please

  14. #64
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    https://github.com/Brandon-T/ProSocks/releases/tag/v0.2

    Done.. I hope.. I'm really tired so I'll only post some examples.. NOT all.. The license (exception added) is now updates as well so there should be no problems.

    If you need more examples (Pop3, Imap, etc.. let me know and I can write something up).. For now, I need sleep and the below is what users would use the most..

    What the internals of the plugin looks like (this is not an include.. there are no includes for this plugin atm.. it works out of the box):
    Simba Code:
    type ProWritePtr = Function(contents: PChar; size: PtrUInt; nmemb: PtrUint; var userp: String): PtrUInt;
    type ProErrorHandlerPtr = Function(str: PChar; errorcode: LongInt): PtrUInt;
    type ProLenPtr = Function(var Str: String): PtrUInt;

    {$IFNDEF LAPE}
    type
      ProMemoryStruct = record
        memory: PChar;
        size: PtrUInt;
      end;
    {$ELSE}
    type
      ProMemoryStruct = packed record
        memory: PChar;
        size: PtrUInt;
      end;
    {$ENDIF}

    {$IFNDEF LAPE}
    type
      SSLSocket = record
        curl_handle: PtrUInt;
        headers: PChar;
        data: PChar;
        params: PChar;
        LengthFunc: ProLenPtr;
        ErrorHandlerFunc: ProErrorHandlerPtr;
        WriteFunc: ProWritePtr;
        HeaderFunc: ProWritePtr;
        hdrs: PChar;
        Timeout: Cardinal;
        Port: Word;
        caller_allocates: Boolean;
      end;
    {$ELSE}
    type
      SSLSocket = packed record
        curl_handle: PtrUInt;
        headers: PChar;
        data: PChar;
        params: PChar;
        LengthFunc: ProLenPtr;
        ErrorHandlerFunc: ProErrorHandlerPtr;
        WriteFunc: ProWritePtr;
        HeaderFunc: ProWritePtr;
        hdrs: PChar;
        Timeout: Cardinal;
        Port: Word;
        caller_allocates: Boolean;
      end;
    {$ENDIF}

    //all parameters for this function are to be set to nil in pascal script (except the first parameter). That's because PS doesn't have "natify" or "native".
    Procedure Pro_InitSocket(var curl_info: SSLSocket; WriteFunc: ProWritePtr; HeaderFunc: ProWritePtr; ErrorHandlerFunc: ProErrorHandlerPtr; StrLenFunc: ProLenPtr);

    Procedure Pro_CreateSocket(var curl_info: SSLSocket; useragent: String);
    Procedure Pro_FreeSocket(var curl_info: SSLSocket);
    Procedure Pro_SetURLFollow(var curl_info: SSLSocket; follow: Boolean);
    Procedure Pro_SetSSL(var curl_info: SSLSocket; try_set: Boolean; verifypeer: Boolean; verifyhost: Boolean);
    Procedure Pro_SetCookies(var curl_info: SSLSocket; const cookiejar: String; const cookiefile: String);
    Procedure Pro_SetHeaderCapture(var curl_info: SSLSocket; enable: boolean);
    Function Pro_SetHeader(var curl_info: SSLSocket; const key: String; const value: String): Boolean;
    Procedure Pro_CustomRequest(var curl_info: SSLSocket; const request: String);
    Procedure Pro_SetNoBody(var curl_info: SSLSocket; enable: Boolean);
    Procedure Pro_SetVerbose(var curl_info: SSLSocket; enable: Boolean);
    Function Pro_GetHostLocation(var address: String; var buffer: String): String;
    Function Pro_GetRequestLocation(var address: String; var buffer: String): String;
    Procedure Pro_SetURL(var curl_info: SSLSocket; const URL: String);
    Procedure Pro_SetUpload(var curl_info: SSLSocket; enable: Boolean);
    Procedure Pro_SetLogin(var curl_info: SSLSocket; const user: String; const pwd: String);
    Procedure Pro_ClearParameters(var curl_info: SSLSocket);
    Function Pro_AddParameter(var curl_info: SSLSocket; const key: String; const value: String; escape: Boolean): Boolean;
    Function Pro_DoGet(var curl_info: SSLSocket): PChar;
    Procedure Pro_DoGetEx(var curl_info: SSLSocket; var Res: ProMemoryStruct);
    Function Pro_DoPost(var curl_info: SSLSocket): PChar;
    Procedure Pro_DoPostEx(var curl_info: SSLSocket; var Res: ProMemoryStruct);
    Function Pro_Perform(var curl_info: SSLSocket): PChar;
    Procedure Pro_PerformEx(var curl_info: SSLSocket; var Res: ProMemoryStruct);
    Function Pro_GetHeaders(var curl_info: SSLSocket): PChar;
    Procedure Pro_GetHeadersEx(var curl_info: SSLSocket; var Res: ProMemoryStruct);
    Function Pro_SMTP(var curl_info: SSLSocket; url, user, pwd, name, recipient, cc, bcc, subject, body, bodymime, file, filemime: PChar): Boolean;
    Procedure Pro_MSTPC(var curl_info: SSLSocket; var Res: ProMemoryStruct);


    Examples:

    Emails with attachment support and mime-type support (html, plain-text, etc..). You can have multiple Recipients, CCs, BCCs by separating each one with \r\n aka #13#10 in PS/Lape.
    Simba Code:
    {$loadlib prosocks}

    var
      S: SSLSocket;
    begin
      Pro_InitSocket(S, nil, nil, nil, nil); //nil for PS.
      Pro_CreateSocket(S, ''); //default user agent.
      Pro_SetVerbose(S, True); //debugging enabled. Not needed.
      Pro_SetSSL(S, false, false, true);
      Pro_SMTP(S, 'smtps://smtp.gmail.com', 'user@gmail.com', '****', 'Brandon T', 'to@gmail.com', 'cc', 'bcc', 'Subject', 'Message', 'text/plain; charset=UTF-8', 'Attachment.ext', 'application/x-msdownload; charset=UTF-8');
      Pro_FreeSocket(S);
    end.


    GET:
    Simba Code:
    {$loadlib prosocks}

    var
      S: SSLSocket;
      res: ProMemoryStruct;
    begin
      Pro_InitSocket(S, nil, nil, nil, nil);
      Pro_CreateSocket(S, '');
      Pro_SetSSL(S, false, false, true);
      Pro_SetURL(S, 'https://villavu.com/forum/');
      Pro_DoGetEx(S, res);
      writeln(res.memory);
      Pro_FreeSocket(S);
    end.


    GET Custom Header:
    Simba Code:
    {$loadlib prosocks}

    var
      S: SSLSocket;
      res: ProMemoryStruct;
    begin
      Pro_InitSocket(S, nil, nil, nil, nil);
      Pro_CreateSocket(S, '');
      Pro_SetSSL(S, false, false, true);
      Pro_SetURL(S, 'https://villavu.com/forum/');
      Pro_SetHeader(S, 'Accept', 'text/plain', false);
      Pro_SetHeader(S, 'Connection', 'keep-alive', false);
      Pro_DoGetEx(S, res);
      writeln(res.memory);
      Pro_FreeSocket(S);
    end.


    POST (complicated example with parameters.. Logs into facebook..):
    Simba Code:
    {$loadlib prosocks}

    var
      S: SSLSocket;
      MS: ProMemoryStruct;
    begin
      Pro_InitSocket(S, nil, nil, nil, nil);
      Pro_CreateSocket(S, '');
      Pro_SetCookies(S, 'Cookies.txt', 'Cookies.txt'); //allow cookies.
      Pro_SetSSL(S, false, false, true);
      Pro_SetURLFollow(S, true); //follow redirects.

      Pro_SetURL(S, 'https://facebook.com');
      Pro_DoGet(S); //dummy GET (used in the OAuth protocol)

      Pro_SetURL(S, 'https://www.facebook.com/login.php?login_attempt=1&amp;next=https%3A%2F%2Fwww.facebook.com%2Fmessages%2F');
      Pro_AddParameter(S, 'id', 'login_form', false);
      Pro_AddParameter(S, 'trynum', '1', false);
      Pro_AddParameter(S, 'email', 'email@hotmail.com', false);
      Pro_AddParameter(S, 'pass', '****', false);
      Pro_DoPost(S);

      Pro_SetURL(S, 'https://www.facebook.com/messages/');   //private page.. to test if we logged in successfully..
      Pro_DoGetEx(S, MS);
      writeln(MS.memory); //save to a file.html and open the file in the browser. ;)
      Pro_FreeSocket(S);
    end.


    Notes:
    I've tested all of the above. Especially the emailing features.. Worked real hard on that. Let me know how things go for you guys..
    Last edited by Brandon; 10-21-2014 at 05:31 AM.
    I am Ggzz..
    Hackintosher

  15. #65
    Join Date
    Nov 2006
    Location
    'Pergamino, BA, Argentina';
    Posts
    473
    Mentioned
    0 Post(s)
    Quoted
    6 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    https://github.com/Brandon-T/ProSocks/releases/tag/v0.2

    Done.. I hope.. I'm really tired so I'll only post some examples.. NOT all.. The license (exception added) is now updates as well so there should be no problems.
    Wow, I can't being to tell you how much I appreciate this. Great work! This should come in very handy, thank youuu. I'll do some tests, will let you know how it works.

  16. #66
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    @Brandon;

    When I use HTTP.getRawPage() it seems to randomly delete spaces from the page causing the code not to compile

    For instance:

    Simba Code:
    function isText(Text, theText: TStringArray): Boolean;
    vari,k: Integer;

    And if I use getPage then I just get something like
    Code:
    HTTP/1.1 200 OK
    Date: Wed, 15 Apr 2015 05:15:55 GMT
    Server: Apache
    Access-Control-Allow-Origin: https://render.githubusercontent.com
    Content-Security-Policy: default-src 'none'
    X-XSS-Protection: 1; mode=block
    X-Frame-Options: deny
    X-Content-Type-Options: nosniff
    Strict-Transport-Security: max-age=31536000
    ETag: "ae2c508f9c1a0aa5cff6dbcf3a300976bfeda682"
    Content-Type: text/plain; charset=utf-8
    Cache-Control: max-age=300
    Content-Length: 2330
    Accept-Ranges: bytes
    Via: 1.1 varnish
    X-Served-By: ca
    So I figured I had to use getRawPage


    Any idea why it does that? Just read on page 2 I was having the same issue last year but it was fixed, now I'm running into the same issue somehow

  17. #67
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by rj View Post
    @Brandon;

    When I use HTTP.getRawPage() it seems to randomly delete spaces from the page causing the code not to compile

    For instance:

    Simba Code:
    function isText(Text, theText: TStringArray): Boolean;
    vari,k: Integer;

    And if I use getPage then I just get something like
    Code:
    HTTP/1.1 200 OK
    Date: Wed, 15 Apr 2015 05:15:55 GMT
    Server: Apache
    Access-Control-Allow-Origin: https://render.githubusercontent.com
    Content-Security-Policy: default-src 'none'
    X-XSS-Protection: 1; mode=block
    X-Frame-Options: deny
    X-Content-Type-Options: nosniff
    Strict-Transport-Security: max-age=31536000
    ETag: "ae2c508f9c1a0aa5cff6dbcf3a300976bfeda682"
    Content-Type: text/plain; charset=utf-8
    Cache-Control: max-age=300
    Content-Length: 2330
    Accept-Ranges: bytes
    Via: 1.1 varnish
    X-Served-By: ca
    So I figured I had to use getRawPage


    Any idea why it does that? Just read on page 2 I was having the same issue last year but it was fixed, now I'm running into the same issue somehow
    Not sure what you're using or doing but if you use the latest plugin then you can do what the reflection include does as well:


    Simba Code:
    {$loadlib prosocks}

    Function GetPageEx(URL: String): String;
    var
      S: SSLSocket;
      res: ProMemoryStruct;
    begin
      Pro_InitSocket(S, nil, nil, nil, nil);
      Pro_CreateSocket(S, '');
      Pro_SetSSL(S, false, false, true);
      Pro_SetURL(S, URL);
      Pro_DoGetEx(S, res);

      {$IFDEF LAPE}
      SetLength(Result, res.size);
      MemMove(res.memory^, Result[1], res.size);
      {$ELSE}
      Result := res.memory;
      {$ENDIF}


      try
        Pro_FreeSocket(S);
      except
        WriteLn('Unable to Free ' + URL + ' ProSocks Error');
      end;
    end;

    begin
      writeln(getPageEx('https://render.githubusercontent.com'));
    end.

    Which prints everything just fine. The latest plugin does everything and it does it correctly. The include on the first page may be outdated which would explain the bug you're experiencing. I don't remember if I updated the include on the front page. I haven't had much time these days to even log in but if I'll try to update the front page.
    Last edited by Brandon; 04-25-2015 at 01:15 AM.
    I am Ggzz..
    Hackintosher

  18. #68
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    Not sure what you're using or doing but if you use the latest plugin then you can do what the reflection include does as well:


    Simba Code:
    {$loadlib prosocks}

    Function GetPageEx(URL: String): String;
    var
      S: SSLSocket;
      res: ProMemoryStruct;
    begin
      Pro_InitSocket(S, nil, nil, nil, nil);
      Pro_CreateSocket(S, '');
      Pro_SetSSL(S, false, false, true);
      Pro_SetURL(S, URL);
      Pro_DoGetEx(S, res);

      {$IFDEF LAPE}
      SetLength(Result, res.size);
      MemMove(res.memory^, Result[1], res.size);
      {$ELSE}
      Result := res.memory;
      {$ENDIF}


      try
        Pro_FreeSocket(S);
      except
        WriteLn('Unable to Free ' + URL + ' ProSocks Error');
      end;
    end;

    begin
      writeln(getPageEx('https://render.githubusercontent.com'));
    end.

    Which prints everything just fine. The latest plugin does everything and it does it correctly. The include on the first page may be outdated which would explain the bug you're experiencing. I don't remember if I updated the include on the front page. I haven't had much time these days to even log in but if I'll try to update the front page.
    I'm getting

    Simba Code:
    Error: Unknown declaration "ProMemoryStruct" at line 208
    I put it in socks.simba is that a pascalscript version? I'm using lape

  19. #69
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by rj View Post
    I'm getting

    Simba Code:
    Error: Unknown declaration "ProMemoryStruct" at line 208
    I put it in socks.simba is that a pascalscript version? I'm using lape

    https://github.com/Brandon-T/ProSocks/releases/tag/v0.3 The above function is both Lape AND pascal script. Hence the "IFDEF".
    I am Ggzz..
    Hackintosher

  20. #70
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    https://github.com/Brandon-T/ProSocks/releases/tag/v0.3 The above function is both Lape AND pascal script. Hence the "IFDEF".
    Which include do I use? My current one loads lib ProSock and the new one is Prosocks. Do I change the name or do I have an outdated include?

  21. #71
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by rj View Post
    Which include do I use? My current one loads lib ProSock and the new one is Prosocks. Do I change the name or do I have an outdated include?

    What exactly are you trying to do? Emails? Get requests? Posts? If it's just plain get requests and posts, you don't really need an include. The plugin is designed in such a way that an include isn't necessary. The email functions are built in and so is get and post. See: https://villavu.com/forum/showthread...55#post1314355

    The ability to use raw sockets is there but you don't have to go through the pain of that. There's only 3~4 steps you need:

    Init
    Create
    //Do whatever you want (set flags, urls, headers, etc)
    Free
    Last edited by Brandon; 04-26-2015 at 03:34 AM.
    I am Ggzz..
    Hackintosher

  22. #72
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    What exactly are you trying to do? Emails? Get requests? Posts? If it's just plain get requests and posts, you don't really need an include. The plugin is designed in such a way that an include isn't necessary. The email functions are built in and so is get and post. See: https://villavu.com/forum/showthread...55#post1314355

    The ability to use raw sockets is there but you don't have to go through the pain of that. There's only 3~4 steps you need:

    Init
    Create
    //Do whatever you want (set flags, urls, headers, etc)
    Free
    I'm trying to use getpage, I just pasted your above example and ported it into what I'm doing. After 2 file update I get this error

    Code:
    Unable to Free https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/core/globals.simba ProSocks Error
    And the script just continues to run without outputting anymore debug (my script writes when it is updating a file)

    script
    Simba Code:
    //{$I Socks.Simba}
    {$loadlib prosocks}


    (*
      Alotic include updater written by rj,
      string functions by Janilabo, github page grabber by Brandon
    *)


    const
      BASE_URL = 'https://raw.githubusercontent.com/officerBarbrady/Alotic/master/';
      INCLUDE_PATH = 'C:\Simba\Includes\Alotic\';

    type
      TFileFormat = (FILE_PATH, WEB_PATH, DIRECTORY_PATH);

    function mInc(var x: Integer; N: Integer = 1): Integer;
    begin
      Result := x;
      x := (x + N);
    end;

    function mIncrease(var x: Integer; N: Integer = 1): Integer;
    begin
      x := (x + N);
      Result := x;
    end;

    function mExplode(str: string; d: Char): TStringArray;
    var
      a, b, l, p, r, s: Integer;
    begin
      l := Length(str);
      SetLength(Result, 1);
      if (l > 0) then
      begin
        b := 1;
        a := 1;
        p := 0;
        r := 0;
        s := 0;
        while (mInc(p) < l) do
          if (str[p] = d) then
          begin
            Result[mInc(r)] := Copy(str, a, s);
            if (b <= r) then
              SetLength(Result, mIncrease(b, b));
            a := (p + 1);
            s := 0;
          end else
            s := (s + 1);
        SetLength(Result, (r + 1));
        Result[r] := Copy(str, a, s);
      end else
        Result[0] := str;
    end;

    function mLines(str: string): TStringArray;
    begin
      if (Length(str) = 0) then
      begin
        SetLength(Result, 1);
        Result[0] := str;
      end else
        Result := mExplode(str, #10);
    end;

    function Before(s, str: string): string;
    var
      p: Integer;
    begin
      if (Length(s) < Length(str)) then
      begin
        p := Pos(s, str);
        if (p > 1) then
          Result := Copy(str, 1, (p - 1))
        else
          Result := '';
      end else
        Result := '';
    end;

    function formatPath(s:string;formatType:TFileFormat):string;
    var
      base, fileType:string;
    begin
      case formatType of
        FILE_PATH:
        begin
          fileType := between('[', ']', s);
          base := before('[', s);
          result := INCLUDE_PATH + base + '.' + fileType;
        end;
        WEB_PATH:
        begin
          s := replace(s, '\', '/', [rfReplaceall]);
          fileType := between('[', ']', s);
          base := before('[', s);
          result := base + '.' + fileType;
        end;
        DIRECTORY_PATH:
        begin
          base := between('[', '\', s);
          result := before(base, s);
        end;
      end;
    end;

    Function GetPageEx(URL: String): String;
    var
      S: SSLSocket;
      res: ProMemoryStruct;
    begin
      Pro_InitSocket(S, nil, nil, nil, nil);
      Pro_CreateSocket(S, '');
      Pro_SetSSL(S, false, false, true);
      Pro_SetURL(S, URL);
      Pro_DoGetEx(S, res);

      {$IFDEF LAPE}
      SetLength(Result, res.size);
      MemMove(res.memory^, Result[1], res.size);
      {$ELSE}
      Result := res.memory;
      {$ENDIF}
      try
        Pro_FreeSocket(S);
      except
        WriteLn('Unable to Free ' + URL + ' ProSocks Error');
      end;
    end;



    procedure updateInclude();
    var
      i, c, tmpFile:integer;
      p:string;
      filePaths:TStringArray;
      fileContents:string;
    begin
      writeln('Scanning for files to update..');
      p := getPageEx(BASE_URL + 'Files.txt');
      if (p <> '') then
      begin
        if (formatPath(p, DIRECTORY_PATH) <> '') then
        begin
          if (not directoryExists(formatPath(p, DIRECTORY_PATH))) then
            createDirectory(formatPath(p, DIRECTORY_PATH));
        end;
        filePaths := mLines(p);
        for i := 0 to high(filePaths) do
        begin
          p := '';
          p := getPageEx(BASE_URL + formatPath(filePaths[i], WEB_PATH));
          try
            tmpFile := openFile(formatPath(filePaths[i], FILE_PATH), false);
            readFileString(tmpFile, fileContents, fileSize(tmpFile));
            closeFile(tmpFile);
            if (length(fileContents) <> length(p)) then
            begin
              tmpFile := reWriteFile(formatPath(filePaths[i], FILE_PATH), false);
              if writeFileString(tmpFile, p) then
              begin
                c := c + 1;
                writeln('Updated ', formatPath(filePaths[i], FILE_PATH));
              end;
              closeFile(tmpFile);
            end;
          except
            try
              writeln('Creating new File ', formatPath(filePaths[i], FILE_PATH));
              tmpFile := createFile(formatPath(filePaths[i], FILE_PATH));
              if (p <> '') then
              begin
                c := c + 1;
                writeFileString(tmpFile, p);
              end;
            except
              writeln('Failed to create File ', formatPath(filePaths[i], FILE_PATH));
            finally
              closeFile(tmpFile);
            end;
          end;
        end;
        writeln('Updated ' , c , ' Files');
      end;
    end;

    begin
      updateInclude();
    end.

  23. #73
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by rj View Post
    I'm trying to use getpage, I just pasted your above example and ported it into what I'm doing. After 2 file update I get this error


    The only error I get when running your code is:

    Progress Report:
    Compiled successfully in 406 ms.
    Scanning for files to update..
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\Authors.txt
    Creating new File C:\Simba\Includes\Alotic\Authors.txt
    CreateFile - Exception. Could not create file: C:\Simba\Includes\Alotic\Authors.txt
    Failed to create File C:\Simba\Includes\Alotic\Authors.txt
    Error: Invalid FileNum passed: -1 at line 181
    Execution failed.


    And when I check the folder where the above script is located, it doesn't create a file called "Authors.txt". You're creating a FOLDER called "Authors[". In fact, it creates a folder: "C:/Simba/Scripts/Authors[" and "C:/Simba/Authors[".


    When I debug your code, all the HTTP(S) calls work just fine (only file creation fails):

    Last edited by Brandon; 04-26-2015 at 01:42 PM.
    I am Ggzz..
    Hackintosher

  24. #74
    Join Date
    Sep 2010
    Posts
    5,762
    Mentioned
    136 Post(s)
    Quoted
    2739 Post(s)

    Default

    Quote Originally Posted by Brandon View Post
    ...
    Ok, I have the directory creation fixed (with the except of it creating blank files so it has to be run twice, whatever ill fix that later)but ProSocks is unable to free
    Code:
    Unable to Free https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/core/globals.simba ProSocks Error
    After that, the script does nothing and has to be stopped. I figured I maybe the next webpage wasn't a valid webpage and that's why it's getting stuck but after further debugging found that not to be the case ( https://raw.githubusercontent.com/of...inscreen.simba exists)

    It's always https://raw.githubusercontent.com/of.../globals.simba that it is unable to free for some odd reason

    script
    Simba Code:
    //{$I Socks.Simba}
    {$loadlib prosocks}


    (*
      Alotic include updater written by rj,
      string functions by Janilabo, github page grabber by Brandon
    *)


    const
      BASE_URL = 'https://raw.githubusercontent.com/officerBarbrady/Alotic/master/';
      INCLUDE_PATH = 'C:\Simba\Includes\Alotic\';

    type
      TFileFormat = (FILE_PATH, WEB_PATH, DIRECTORY_PATH);

    function mInc(var x: Integer; N: Integer = 1): Integer;
    begin
      Result := x;
      x := (x + N);
    end;

    function mIncrease(var x: Integer; N: Integer = 1): Integer;
    begin
      x := (x + N);
      Result := x;
    end;

    function mExplode(str: string; d: Char): TStringArray;
    var
      a, b, l, p, r, s: Integer;
    begin
      l := Length(str);
      SetLength(Result, 1);
      if (l > 0) then
      begin
        b := 1;
        a := 1;
        p := 0;
        r := 0;
        s := 0;
        while (mInc(p) < l) do
          if (str[p] = d) then
          begin
            Result[mInc(r)] := Copy(str, a, s);
            if (b <= r) then
              SetLength(Result, mIncrease(b, b));
            a := (p + 1);
            s := 0;
          end else
            s := (s + 1);
        SetLength(Result, (r + 1));
        Result[r] := Copy(str, a, s);
      end else
        Result[0] := str;
    end;

    function mLines(str: string): TStringArray;
    begin
      if (Length(str) = 0) then
      begin
        SetLength(Result, 1);
        Result[0] := str;
      end else
        Result := mExplode(str, #10);
    end;

    function Before(s, str: string): string;
    var
      p: Integer;
    begin
      if (Length(s) < Length(str)) then
      begin
        p := Pos(s, str);
        if (p > 1) then
          Result := Copy(str, 1, (p - 1))
        else
          Result := '';
      end else
        Result := '';
    end;

    function lastBefore(s, str: string): string;
    var
      l, p, lp: Integer;
    begin
      l := Length(str);
      if (Length(s) <= l) then
      begin
        repeat
          p := PosEx(s, str, (p + 1));
          if (p > 0) then
            lp := p;
        until (p <= 0);
        if (lp > 0) then
          Result := Copy(str, 1, (lp - 1))
        else
          Result := '';
      end else
        Result := '';
    end;

    function formatPath(s:string;formatType:TFileFormat):string;
    var
      base, fileType:string;
    begin
      case formatType of
        FILE_PATH:
        begin
          fileType := between('[', ']', s);
          base := before('[', s);
          result := INCLUDE_PATH + base + '.' + fileType;
        end;
        WEB_PATH:
        begin
          s := replace(s, '\', '/', [rfReplaceall]);
          fileType := between('[', ']', s);
          base := before('[', s);
          result := base + '.' + fileType;
        end;
        DIRECTORY_PATH:
        begin
          result := INCLUDE_PATH + lastBefore('\', s);
          if (result[length(result)] <> '\') then
            result := result + '\';
          //writeln('result=',result);
        end;
      end;
    end;

    Function GetPageEx(URL: String): String;
    var
      S: SSLSocket;
      res: ProMemoryStruct;
    begin
      Pro_InitSocket(S, nil, nil, nil, nil);
      Pro_CreateSocket(S, '');
      Pro_SetSSL(S, false, false, true);
      Pro_SetURL(S, URL);
      Pro_DoGetEx(S, res);

      {$IFDEF LAPE}
      SetLength(Result, res.size);
      MemMove(res.memory^, Result[1], res.size);
      {$ELSE}
      Result := res.memory;
      {$ENDIF}
      try
        Pro_FreeSocket(S);
      except
        WriteLn('Unable to Free ' + URL + ' ProSocks Error');
      end;
    end;



    procedure updateInclude();
    var
      i, c, tmpFile:integer;
      p:string;
      filePaths:TStringArray;
      fileContents:string;
    begin
      writeln('Scanning for files to update..');
      p := getPageEx(BASE_URL + 'Files.txt');
      //writeln(BASE_URL + 'Files.txt');
      filePaths := mLines(p);
      //writeln(filePaths);
      for i := 0 to high(filePaths) do
      begin
        writeln('Webpath = ', BASE_URL + formatPath(filePaths[i], WEB_PATH));
        //writeln('Path = ', formatPath(filePaths[i], DIRECTORY_PATH));
        if (filePaths[i] <> '') then
        begin
          if (formatPath(filePaths[i], DIRECTORY_PATH) <> '') then
          begin
            if (not directoryExists(formatPath(filePaths[i], DIRECTORY_PATH))) then
            begin
              createDirectory(formatPath(filePaths[i], DIRECTORY_PATH));
              //wait(1000);
            end;
          end;
          p := '';
          p := getPageEx(BASE_URL + formatPath(filePaths[i], WEB_PATH));
          try
            tmpFile := openFile(formatPath(filePaths[i], FILE_PATH), false);
            readFileString(tmpFile, fileContents, fileSize(tmpFile));
            closeFile(tmpFile);
            if (length(fileContents) <> length(p)) then
            begin
              tmpFile := reWriteFile(formatPath(filePaths[i], FILE_PATH), false);
              if writeFileString(tmpFile, p) then
              begin
                c := c + 1;
                writeln('Updated ', formatPath(filePaths[i], FILE_PATH));
              end;
              closeFile(tmpFile);
            end;
          except
            try
              writeln('Creating new File ', formatPath(filePaths[i], FILE_PATH));
              tmpFile := createFile(formatPath(filePaths[i], FILE_PATH));
              if (p <> '') then
              begin
                c := c + 1;
                writeFileString(tmpFile, p);
              end;
            except
             // writeln('Failed to create File ', formatPath(filePaths[i], FILE_PATH));
            finally
              if (tmpFile <> -1) then
                closeFile(tmpFile);
            end;
          end;
        end;
      end;
      writeln('Updated ' , c , ' Files');
    end;

    begin
      updateInclude();
    end.

  25. #75
    Join Date
    Feb 2011
    Location
    The Future.
    Posts
    5,600
    Mentioned
    396 Post(s)
    Quoted
    1598 Post(s)

    Default

    Quote Originally Posted by rj View Post
    ...

    Try this (a direct link to the plugin on github): https://github.com/Brandon-T/ProSock...3/ProSocks.dll

    I have a feeling you're somehow using a very OLD version of the plugin. The above is the latest build and that's the one myself & the reflection include uses.


    When I run your code I get:

    Progress Report:
    Compiled successfully in 422 ms.
    Scanning for files to update..
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/Authors.txt
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\Authors.txt
    Creating new File C:\Simba\Includes\Alotic\Authors.txt
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/Files.txt
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\Files.txt
    Creating new File C:\Simba\Includes\Alotic\Files.txt
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/Alotic.simba
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\lib\Alotic.simba
    Creating new File C:\Simba\Includes\Alotic\lib\Alotic.simba
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/Updater.simba
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\lib\Updater.simba
    Creating new File C:\Simba\Includes\Alotic\lib\Updater.simba
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/core/globals.simba
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\lib\core\globals.simba
    Creating new File C:\Simba\Includes\Alotic\lib\core\globals.simba
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/core/mainscreen.simba
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\lib\core\mainscreen.simba
    Creating new File C:\Simba\Includes\Alotic\lib\core\mainscreen.simba
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/core/math.simba
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\lib\core\math.simba
    Creating new File C:\Simba\Includes\Alotic\lib\core\math.simba
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/core/mouse.simba
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\lib\core\mouse.simba
    Creating new File C:\Simba\Includes\Alotic\lib\core\mouse.simba
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/core/prayer.simba
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\lib\core\prayer.simba
    Creating new File C:\Simba\Includes\Alotic\lib\core\prayer.simba
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/core/text.simba
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\lib\core\text.simba
    Creating new File C:\Simba\Includes\Alotic\lib\core\text.simba
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/interfaces/bank.simba
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\lib\interfaces\bank.simba
    Creating new File C:\Simba\Includes\Alotic\lib\interfaces\bank.simba
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/interfaces/chatbox.simba
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\lib\interfaces\chatbox.simba
    Creating new File C:\Simba\Includes\Alotic\lib\interfaces\chatbox.simba
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/interfaces/gametab.simba
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\lib\interfaces\gametab.simba
    Creating new File C:\Simba\Includes\Alotic\lib\interfaces\gametab.simba
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/interfaces/interface.simba
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\lib\interfaces\interface.simba
    Creating new File C:\Simba\Includes\Alotic\lib\interfaces\interface.simba
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/interfaces/inventory.simba
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\lib\interfaces\inventory.simba
    Creating new File C:\Simba\Includes\Alotic\lib\interfaces\inventory.simba
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/interfaces/minimap.simba
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\lib\interfaces\minimap.simba
    Creating new File C:\Simba\Includes\Alotic\lib\interfaces\minimap.simba
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/misc/Simba.simba
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\lib\misc\Simba.simba
    Creating new File C:\Simba\Includes\Alotic\lib\misc\Simba.simba
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/misc/datatypes/extendedarrays.simba
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\lib\misc\datatypes\extendedarrays.simba
    Creating new File C:\Simba\Includes\Alotic\lib\misc\datatypes\extendedarrays.simba
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/misc/datatypes/integer.simba
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\lib\misc\datatypes\integer.simba
    Creating new File C:\Simba\Includes\Alotic\lib\misc\datatypes\integer.simba
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/misc/datatypes/integerarrays.simba
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\lib\misc\datatypes\integerarrays.simba
    Creating new File C:\Simba\Includes\Alotic\lib\misc\datatypes\integerarrays.simba
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/misc/datatypes/string.simba
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\lib\misc\datatypes\string.simba
    Creating new File C:\Simba\Includes\Alotic\lib\misc\datatypes\string.simba
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/misc/datatypes/stringarrays.simba
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\lib\misc\datatypes\stringarrays.simba
    Creating new File C:\Simba\Includes\Alotic\lib\misc\datatypes\stringarrays.simba
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/misc/datatypes/t2dstringarray.simba
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\lib\misc\datatypes\t2dstringarray.simba
    Creating new File C:\Simba\Includes\Alotic\lib\misc\datatypes\t2dstringarray.simba
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/misc/datatypes/tbox.simba
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\lib\misc\datatypes\tbox.simba
    Creating new File C:\Simba\Includes\Alotic\lib\misc\datatypes\tbox.simba
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/misc/datatypes/tpoint.simba
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\lib\misc\datatypes\tpoint.simba
    Creating new File C:\Simba\Includes\Alotic\lib\misc\datatypes\tpoint.simba
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/misc/datatypes/tpointarrays.simba
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\lib\misc\datatypes\tpointarrays.simba
    Creating new File C:\Simba\Includes\Alotic\lib\misc\datatypes\tpointarrays.simba
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/misc/datatypes/typemath.simba
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\lib\misc\datatypes\typemath.simba
    Creating new File C:\Simba\Includes\Alotic\lib\misc\datatypes\typemath.simba
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/misc/datatypes/types.simba
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\lib\misc\datatypes\types.simba
    Creating new File C:\Simba\Includes\Alotic\lib\misc\datatypes\types.simba
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/player/login.simba
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\lib\player\login.simba
    Creating new File C:\Simba\Includes\Alotic\lib\player\login.simba
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/player/player.simba
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\lib\player\player.simba
    Creating new File C:\Simba\Includes\Alotic\lib\player\player.simba
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/player/varManager.simba
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\lib\player\varManager.simba
    Creating new File C:\Simba\Includes\Alotic\lib\player\varManager.simba
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/utilities/canvas.simba
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\lib\utilities\canvas.simba
    Creating new File C:\Simba\Includes\Alotic\lib\utilities\canvas.simba
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/utilities/color.simba
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\lib\utilities\color.simba
    Creating new File C:\Simba\Includes\Alotic\lib\utilities\color.simba
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/utilities/debug.simba
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\lib\utilities\debug.simba
    Creating new File C:\Simba\Includes\Alotic\lib\utilities\debug.simba
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/utilities/debugBox.simba
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\lib\utilities\debugBox.simba
    Creating new File C:\Simba\Includes\Alotic\lib\utilities\debugBox.simba
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/utilities/drawing.simba
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\lib\utilities\drawing.simba
    Creating new File C:\Simba\Includes\Alotic\lib\utilities\drawing.simba
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/utilities/file.simba
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\lib\utilities\file.simba
    Creating new File C:\Simba\Includes\Alotic\lib\utilities\file.simba
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/utilities/timing.simba
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\lib\utilities\timing.simba
    Creating new File C:\Simba\Includes\Alotic\lib\utilities\timing.simba
    Webpath = https://raw.githubusercontent.com/officerBarbrady/Alotic/master/lib/utilities/wrappers.simba
    OpenFile - Exception. Could not open file: C:\Simba\Includes\Alotic\lib\utilities\wrappers.simba
    Creating new File C:\Simba\Includes\Alotic\lib\utilities\wrappers.simba
    Updated 37 Files
    Successfully executed.



    and everything gets created and downloaded fine.. Do some error checking in "GetPageEx" make sure res.size > 0. Other than that, there's nothing wrong :S
    Last edited by Brandon; 04-27-2015 at 11:38 PM.
    I am Ggzz..
    Hackintosher

Page 3 of 5 FirstFirst 12345 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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