Advertisement
Guest User

Untitled

a guest
May 25th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Delphi 1.71 KB | None | 0 0
  1. unit Socks5types;
  2.  
  3. interface
  4.  
  5. type TPackedSockets = record
  6.     InternetSocket  : TClientSocket;
  7.     InterfaceSocket : TClientSocket;
  8. end;
  9.  
  10. type TSocksAuth = record
  11.     Version : Byte;
  12.     nMethods: Byte;
  13.     Methods: Array [0..255] of Byte;
  14. end;
  15.  
  16. type TSocksSelectedMethod = record
  17.     Version: Byte;
  18.     Method: Byte;
  19. end;
  20.  
  21. type TSocksSettings = record
  22.     Port: DWORD;
  23.     Username: String;
  24.     Password: String;
  25. end;
  26.  
  27. type TSocksRequest = record
  28.     Version: Byte;
  29.     Command: Byte; // 1 = Connect, 2 = BIND (not Supported)
  30.     Reserved: Byte;
  31.     AddressType: Byte; // 1 = IPv4 Address, 3 Domainname, 4=Ipv6 Address)
  32. end;
  33.  
  34. type TSocksTargetDataIPv4 = record
  35.     destAddress: Array [0..3] of Byte; // wenn IPv4 die ip, ansonsten das erste bytelänge
  36. end;
  37.  
  38. type TSocksTargetDataDomainLength = record
  39.     destAddressLength: Byte;
  40. end;
  41.  
  42. type TSocksTargetDataDomain = record
  43.     destAddress: Array of Byte;
  44. end;
  45.  
  46. type TSocksTargetPort = record
  47.      destPort: Array [0..1] of Byte;
  48. end;
  49.  
  50. type TSocksReply = record
  51.     Version: Byte;
  52.     ReplyType: Byte; // 1 ReplySuccess, 2 Failure
  53.     reserved: Byte;
  54.     addresstype: Byte; //siehe Request
  55.     sboundaddr: Array [0..3] of Byte;
  56.     sboundport: Array [0..1] of Byte;
  57. end;
  58.  
  59. const SOCKS_AddressType_IPv4 = 1;
  60. const SOCKS_AddressType_Domain = 3;
  61. const SOCKS_AddressType_IPv6 = 4;
  62.  
  63. const SOCKS_COMMAND_Connect = 1;
  64. const SOCKS_COMMAND_Bind = 2;
  65.  
  66. const SOCKS_ReplyType_Success = 1;
  67. const SOCKS_ReplyType_Failure = 2;
  68.  
  69. const SOCKS_SelectedMethod_NOAUTH = 0;
  70.  
  71. const SOCKS_AUTHSTATE_supportedmethods = 1;
  72. const SOCKS_AUTHSTATE_request = 2;
  73. const SOCKS_AUTHSTATE_req_allowed = 3;
  74. const SOCKS_AUTHSTATE_Tunneling = 4;
  75.  
  76. implementation
  77.  
  78. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement