Comments (2)
I have sample code that should work/be enough to update our version of core lich, but I'm not in a position to be able to commit on my fork / submit the PR right now.
This is the POC code I used that spits out the response from the login server:
#!/usr/bin/env ruby
# encoding: US-ASCII
require 'socket'
require 'openssl'
acct = ''
pass = ''
gamecode = 'DR'
hostname = 'eaccess.play.net'
port = 7910
cert = OpenSSL::X509::Certificate.new("-----BEGIN CERTIFICATE-----\nMIIFUDCCAzigAwIBAgIJAP1LKTzYRs74MA0GCSqGSIb3DQEBCwUAMDwxCzAJBgNV\nBAYTAlVTMREwDwYDVQQIDAhNaXNzb3VyaTEaMBgGA1UECgwRU2ltdXRyb25pY3Mg\nQ29ycC4wIBcNMTgwNzE2MjIzNjMyWhgPMzAxNzExMTYyMjM2MzJaMDwxCzAJBgNV\nBAYTAlVTMREwDwYDVQQIDAhNaXNzb3VyaTEaMBgGA1UECgwRU2ltdXRyb25pY3Mg\nQ29ycC4wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQD3IDOqTKtc+RmW\nZkv3isBPtqKD8rcTyjWFLzIazYnN7ZGmRMGtBTFATx4ugy1WiLih9pUOo84W5M7i\nMwZlbzxQAUPiRfX3U7xowe5LuzDHSxqWzylkkgmkdCX9K8JoN4FnuIWUMuMji7f/\ncY7eL/Flob6pFMD9U7NZDvVpYH05Fnn0LAsaK0DKtPcms5+EWNh+uYgTjZbaVMyY\nAPTEN8Rh0NpR8CWNqErM6kbt+4NBqzKMIrJEfSSgQHhkXK+r37O+d3rpmgyFFJPl\nfFHlwxEKutdhd5z0MWV/Fj+hc2p0pExy6yDJNYDgI+iMas5aYowtOgHx2sX+pGkc\nCYgBkAyhAmhCja0Nl/TEbOgksnSvwGLWufc+TF89CZMGI7UmRdez/YKc0DR/zhjF\nAPsMur8wJOtps9ZueYqTqJ9SvwRoRT8Nlz0q/891t7P97rZ/+9C1AVJFtuIp3zM4\nGusqdxRqAsgVrgZmsY7FPti8dNTDcv1ZUiFt/FfHGEyJXbt7oYDr1CDAX17KRc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OpenSSL::SSL::SSLContext.new
ssl_context.cert_store = cert_store
ssl_context.options = (OpenSSL::SSL::OP_NO_SSLv2 + OpenSSL::SSL::OP_NO_SSLv3)
cert_store.add_cert(cert)
login_socket = TCPSocket.open(hostname, port)
login_server = OpenSSL::SSL::SSLSocket.new(login_socket)
login_server.sync_close = true
login_server.connect
if login_server
puts login_server.state
login_server.puts "K\n"
hashkey = login_server.sysread(32)
puts hashkey
if 'test'[0].class == String
password = pass.split('').collect { |c| c.getbyte(0) }
hashkey = hashkey.split('').collect { |c| c.getbyte(0) }
else
password = pass.split('').collect { |c| c[0] }
hashkey = hashkey.split('').collect { |c| c[0] }
end
password.each_index { |i| password[i] = ((password[i]-32)^hashkey[i])+32 }
password = password.collect { |c| c.chr }.join
login_server.puts "A\t#{acct}\t#{password}\n"
password = nil
response = login_server.sysread(1500)
puts response
login_key = /KEY\t([^\t]+)\t/.match(response).captures.first
if login_key
login_server.puts "M\n"
response = login_server.sysread(1500)
puts response
if response =~ /^M\t/
login_server.puts "G\t#{gamecode}\n"
response = login_server.sysread(1500)
puts response
login_server.puts "P\t#{gamecode}\n"
response = login_server.sysread(1500)
puts response
login_server.puts "C\n"
response = login_server.sysread(1500)
puts response
#this response needs to be parsed to find the character you want to use. Format is tab separated:
#C <Used Slots> <Available Slots> ? ? W_<ACCT>_000 <CHARACTER0> W_<ACCT>_001 <CHARACTER1> W_<ACCT>_002 <CHARACTER2> etc
#I'm lazy and don't want to write the parsing code here so I've just hard coded it to get the first character
login_server.puts "L\tW_#{acct}_000\tSTORM\n"
response = login_server.sysread(1500)
puts response
else
login_server.close unless login_server.closed?
$stdout.puts "error: unrecognized response from server. (#{response})"
end
else
login_server.close unless login_server.closed?
$stdout.puts "Something went wrong... probably invalid user id and/or password.\nserver response: #{response}"
exit
end
else
$stdout.puts "error: failed to connect to server"
exit
end
from dr-lich.
This is the POC code I used that spits out the response from the login server
Thanks!
from dr-lich.
Related Issues (20)
- Support DRF HOT 1
- Can't Connect At All Anymore HOT 2
- Combat-trainer stealth code doesn't wait for stalk RT
- Crossing-Train Magic Improvements
- Cant connect HOT 5
- feature: dump the ruby patch level into the log at startup for easier debugging HOT 1
- See other issue HOT 3
- Test Trust Changes
- Barb Meditations HOT 2
- Port 4901 or 4091? HOT 6
- TM Focus doesn't invoke after using telescope in combat HOT 1
- New systems have an issue with dh key length HOT 5
- repository isn't updating automatically at startup HOT 3
- Pull in latest updates to upstream Lich HOT 1
- Regex problem with move() causes problems with besocrt and movement during combat.
- Test
- GTK InitError (trying to open display) when in CLI only mode (WSL) due to missing rescue catch
- Excessive file type checking when running scripts HOT 4
- Go2 undergondola hang ups
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dr-lich.