libGoo 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8b0c79f36a312707254052bb87a36de631a064d7
4
- data.tar.gz: 93d68e3055614496c8fa9ffe4294075e950b67de
3
+ metadata.gz: 5e5926a7270b36fc362ed137c2f218d8eb42a3aa
4
+ data.tar.gz: a1fa56f3b96d5d13fbffcc8bf77d11b63f04e36d
5
5
  SHA512:
6
- metadata.gz: 23d9a20da2f7295ca4b770f6f02383731499adda30a841ac1d593300029cfdfee67ace355b64692f3842d7e751d2c5fcd283cf20c69b384e4a5971f422c3b765
7
- data.tar.gz: 92edcaf947ab55e80df1d02f696b539dd0f46cfda05a181e6a82473bbefa303ace275762b80724349c675ab0ffd5c47d079e0fdddc113db022abcfacfa2564a0
6
+ metadata.gz: 02739c9c48f32abb583130d481985d5adb2e36a7db081eb7d5fb630e7c0c72902b3647cb371903106e3d332ebf9edff1d5342ba281e1a17245da6f71fd167ab0
7
+ data.tar.gz: 016581ac79eba465a6da108f70260e06863922c4b3f45ddc2c252de8416ff74dfa0c0163c2675467b66eb2c700fb5d7215583463d42941856b2b602408e988c4
data/bin/example.rb CHANGED
@@ -1,13 +1,31 @@
1
- #require 'hackex' #Optional
2
- require 'libGoo'
3
- include LibGoo
1
+ #require 'hackex' #Optional, dont use that
2
+ require 'libGoo' #Requiring libGoo
3
+ include LibGoo #Including libGoo into your script
4
+ email = 'your@e.mail'
5
+ password = 'password'
4
6
 
5
- user = User.new('your@e.mail', 'password')
7
+ user = User.new(email, password)
6
8
  #user = User.new(nil, nil, 'YOUR_AUTH_TOKEN_HERE') #Loggining by auth token
7
9
 
8
10
  #Methods names as in hackex/request.rb, but you can also use old methods names or translate old ones to new ones by OLD_TO_NEW
9
11
  puts LibGoo::OLD_TO_NEW['getUserProcesses'.to_sym] #=>UserProcesses
10
- puts LibGoo::NEW_TO_OLD[:UserProcesses] #=>getUserProcesses
11
- puts JSON.pretty_generate user.VictimInfo(590331)
12
- puts JSON.pretty_generate user.user
13
- puts user.auth_token
12
+ puts LibGoo::NEW_TO_OLD['UserProcesses'] #=>getUserProcesses
13
+ puts JSON.pretty_generate OLD_TO_NEW #Prints out methods names
14
+ #puts JSON.pretty_generate user.VictimInfo(590331)
15
+ #puts JSON.pretty_generate user.user
16
+ puts user.auth_token #=>B13C1313-1313-A13D-13E1-ACB13F131B13 #example
17
+ victim = Victim.new('user_id' => 590331)
18
+ LibGooHelper.MassScanner(user.auth_token, [1001, 1005]) do |user| #Scans users with id's 1001 to 1004 and prints out his usernames
19
+ puts user['user']['username'] #=>Nardski
20
+ end
21
+ User.Do(email, password) do |http, auth_token, user_info, user|
22
+ puts user.user == user_info #=>true
23
+ puts JSON.pretty_generate user.VictimInfo(victim)['user']
24
+ puts user.http == http #=>true
25
+ puts auth_token == user.auth_token #=>true
26
+ puts LibGooHelper.AnonymousTransfer(user.auth_token, 1, 590331) #Accepts values of BTC up to 1 Billion, where 1 is value of BTC
27
+ #Sending 1 BTC to me^^^^^ #You can dont care about adding this user as contact, it's cayman too
28
+ end
29
+
30
+
31
+
data/lib/libGoo/error.rb CHANGED
@@ -1,4 +1,3 @@
1
1
  module LibGoo
2
- class LibGooError < StandardError
3
- end
2
+ LibGooError = Class.new(StandardError)
4
3
  end
@@ -0,0 +1,77 @@
1
+ module LibGoo
2
+ class LibGooHelper
3
+
4
+ class << self
5
+
6
+ def AnonymousTransfer(auth_token, amount, user_id, display = true) #Adds contact, then transfers BTC to him and removes him, or just transfers BTC if contact already exists. Supports values up to 1B
7
+ HackEx.NetworkDo do |http|
8
+ added = ForceAdd(auth_token, user_id)
9
+ if amount <= 100_000_000
10
+ HackEx::Request.Do(http, HackEx::Request.TransferBankFundsToContact(auth_token, user_id, amount))
11
+ puts "Transfering #{amount}" if display
12
+ elsif amount > 1_000_000_000
13
+ raise LibGooError, "Too much money to transfer #{amount}"
14
+ elsif amount < 100_000_000
15
+ i = amount / 100_000_000
16
+ ii = amount % 100_000_000
17
+ i.times {HackEx::Request.Do(http, HackEx::Request.TransferBankFundsToContact(auth_token, user_id, 100_000_000))}
18
+ i.times {puts 'Transfering 100M'} if display
19
+ HackEx::Request.Do(http, HackEx::Request.TransferBankFundsToContact(auth_token, user_id, ii)) if ii > 0
20
+ puts "Transfering #{ii}" if ii > 0 && display
21
+ end
22
+ HackEx::Request.Do(http, HackEx::Request.RemoveContact(auth_token, user_id)) if added
23
+ end
24
+ end
25
+
26
+ def ForceAdd(auth_token, user_id) #Force add contact and returns true if success, and false if not.
27
+ HackEx.NetworkDo do |http|
28
+ HackEx::Request.Do(http, HackEx::Request.AddContact(auth_token, user_id))
29
+ HackEx::Request.Do(http, HackEx::Request.AcceptContact(auth_token, user_id))
30
+ true
31
+ end
32
+ rescue
33
+ false
34
+ end
35
+
36
+ def SafeVictimInfo(http, auth_token, id) #Doesnt stopping your script in case SLL handshake or other errors
37
+ return HackEx::Request.Do(http, HackEx::Request.VictimInfo(auth_token, id))
38
+ rescue
39
+ false
40
+ end
41
+
42
+ def MassScanner(auth_token, array, display = false) #Array is array of scanned IDs like [minimum, maximum] ([1001, 1100])
43
+ errors = []
44
+ cur_id, max = array
45
+ HackEx.NetworkDo do |http|
46
+ while cur_id < max
47
+ victim = SafeVictimInfo(http, auth_token, cur_id)
48
+ if victim
49
+ yield victim
50
+ errors = [] if errors.count > 0
51
+ puts "[#{Time.now}] Scanned id #{cur_id}" if display
52
+ cur_id += 1
53
+ else
54
+ errors << 'error, yopta'
55
+ puts "Failed to scan victim ID:#{cur_id}, count of errors: #{errors.count}"
56
+ raise LibGooError, 'Too much errors in same victim: ' + errors.count.to_s if errors.count > 10
57
+ end
58
+ end
59
+ end
60
+ end
61
+
62
+ def params(*objs) #Parameters processor, accepts Array, String, Integer, LibGoo::Processes
63
+ result = []
64
+ objs.each do |obj|
65
+ if obj.is_a?(Fixnum) || obj.is_a?(String) || obj.is_a?(Array)
66
+ result << obj
67
+ elsif LibGoo::ObjectProcessor.descendants.include?(obj.class)
68
+ return obj.get_var(obj.class.class_variable_get(:@@important))
69
+ else
70
+ raise LibGooError, 'Undefined class object given as one of params: ' + obj.class.to_s
71
+ end
72
+ end
73
+ result
74
+ end
75
+ end
76
+ end
77
+ end
@@ -0,0 +1,52 @@
1
+ module LibGoo
2
+ class ObjectProcessor #Much needed such wow, really, idk why it's here
3
+ attr_reader :params
4
+
5
+ def initialize(params, raise_if)
6
+ if params.is_a?(Hash) || params.is_a?(JSON)
7
+ raise LibGooError, "No specified key #{raise_if} in params" unless params.has_key?(raise_if) && raise_if
8
+ @params = params
9
+ else
10
+ raise LibGooError, "Unavailable type of argument: #{params.class.to_s}."
11
+ end
12
+ end
13
+
14
+ def method_missing(m, *args)
15
+ return self.get_var(m) if self.get_var(m)
16
+ super
17
+ end
18
+
19
+ def get_var(m)
20
+ if @params.has_key?(m.to_s)
21
+ @params[m.to_s]
22
+ elsif @params.has_key?(m)
23
+ @params[m]
24
+ else
25
+ false
26
+ end
27
+ end
28
+
29
+ def self.descendants
30
+ ObjectSpace.each_object(Class).select { |klass| klass < self }
31
+ end
32
+
33
+ def self.parent
34
+ LibGoo::ObjectProcessor
35
+ end
36
+ end
37
+
38
+ class Victim < ObjectProcessor
39
+ @@important = 'user_id'
40
+ def initialize(params)
41
+ super(params, @@important)
42
+ end
43
+
44
+ end
45
+
46
+ class Processes < ObjectProcessor
47
+ @@important = 'id'
48
+ def initialize(params)
49
+ super(params, @@important)
50
+ end
51
+ end
52
+ end
data/lib/libGoo/user.rb CHANGED
@@ -2,13 +2,13 @@ module LibGoo
2
2
  OLD_TO_NEW = {getUser: 'get_user', getUserProcesses: 'UserProcesses', getUserAntivirus: 'UserViruses', addProcess: 'UserAddProcess', getRandomUsers: 'RandomUsers', getVictimInfo: 'VictimInfo', getVictimBank: 'VictimBank', getStore: 'StoreInfo', updateVictimLog: 'UpdateVictimLog', updateUserLog: 'UpdateUserLog', updateUserNotepad: 'UpdateUserNotepad', transferToSavings: 'TransferBankFundsToSavings', transferToVictim: 'TransferBankFundsToVictim', transferToContact: 'TransferBankFundsToContact', addContact: 'AddContact', acceptContact: 'AcceptContact', removeContact: 'RemoveContact', storePurchase: 'StorePurchase', getUserByIp: 'UserByIp', getUserBank: 'UserBank', getUserViruses: 'UserViruses', getUserSoftware: 'UserSoftware', getUserSpam: 'UserSpam', getUserSpyware: 'UserSpyware', removeUploadedVirus: 'UserRemoveUploadedVirus', processInfo: 'ProcessInfo', processOverclock: 'ProcessOverclock', processRetry: 'ProcessRetry', processDelete: 'ProcessDelete', processesDelete: 'ProcessesDelete', getLeaderboard: 'Leaderboard'}
3
3
  NEW_TO_OLD = OLD_TO_NEW.invert
4
4
  class User
5
-
5
+ attr_accessor :auth_token, :http, :user
6
6
  def initialize(email, password, auth_token = nil)
7
7
  if auth_token
8
8
  HackEx.NetworkDo { |http| @http = http; @user = HackEx::Request.Do(http, HackEx::Request.UserInfo(auth_token))['user']}
9
9
  @auth_token = auth_token
10
10
  else
11
- HackEx.LoginDo(email, password) {|http, auth_token, user| @auth_token , @http, @user = auth_token, http, user}
11
+ HackEx.LoginDo(email, password) {|http, auth, user| @auth_token , @http, @user = auth, http, user}
12
12
  end
13
13
  end
14
14
 
@@ -16,14 +16,12 @@ class User
16
16
  def get_user
17
17
  @user = HackEx::Request.Do(@http, HackEx::Request.UserInfo(@auth_token))['user']
18
18
  end
19
- #gr
19
+
20
+
20
21
  def method_missing(m, *args)
21
- m = m.to_s.gsub!(m.to_s, OLD_TO_NEW[m]).to_sym if OLD_TO_NEW.has_key?(m)
22
+ m = m.to_s.gsub(m.to_s, OLD_TO_NEW[m]).to_sym if OLD_TO_NEW.has_key?(m)
22
23
  if HackEx::Request.respond_to?(m)
23
- HackEx::Request.Do(@http, HackEx::Request.method(m).call(@auth_token, *User.params(*args)))
24
- #elsif HackEx::Request.respond_to?(m)
25
- # puts m
26
- # HackEx::Request.Do(@http, HackEx::Request.method(m).call(@auth_token, *args))
24
+ HackEx::Request.Do(@http, HackEx::Request.method(m).call(@auth_token, *LibGooHelper.params(*args)))
27
25
  else
28
26
  raise LibGooError, "Undefined method '#{m}' for class LibGoo::User or class HackEx::Request"
29
27
  end
@@ -37,20 +35,6 @@ class User
37
35
  yield obj.http, obj.auth_token, obj.user, obj
38
36
  end
39
37
 
40
- def params(*objs) #Parameters processor, accepts Array, String, Integer, LibGoo::Processes
41
- result = []
42
- objs.each do |obj|
43
- if obj.is_a?(LibGoo::Processes)
44
- return obj.id
45
- elsif obj.is_a?(Fixnum) || obj.is_a?(String) || obj.is_a?(Array)
46
- result << obj
47
- else
48
- raise LibGooError, 'Undefined class object given as one of params: ' + obj.class.to_s
49
- end
50
- end
51
- result
52
- end
53
-
54
38
  end
55
39
  end
56
40
  end
data/lib/libGoo.rb CHANGED
@@ -1,7 +1,8 @@
1
1
  require_relative 'hackex'
2
2
  require_relative 'libGoo/user'
3
3
  require_relative 'libGoo/error'
4
- require_relative 'libGoo/process'
4
+ require_relative 'libGoo/objects'
5
+ require_relative 'libGoo/helper'
5
6
  module LibGoo
6
- VERSION = '0.1.1'
7
+ VERSION = '0.1.2'
7
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: libGoo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Grig O. Betsan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-10 00:00:00.000000000 Z
11
+ date: 2015-10-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -64,7 +64,8 @@ files:
64
64
  - lib/hackex/request.rb
65
65
  - lib/libGoo.rb
66
66
  - lib/libGoo/error.rb
67
- - lib/libGoo/process.rb
67
+ - lib/libGoo/helper.rb
68
+ - lib/libGoo/objects.rb
68
69
  - lib/libGoo/user.rb
69
70
  - libGoo.gemspec
70
71
  homepage: ''
@@ -1,16 +0,0 @@
1
- module LibGoo
2
- class Processes #Much needed such wow
3
- attr_reader :id, :params
4
-
5
- def initialize(params)
6
- if params.is_a?(Hash) || params.is_a?(JSON)
7
- raise LibGooError, 'No specified key \'id\' in arguments' unless params.has_key?('id')
8
- @id, @params = params['id'], params
9
- elsif params.is_a?(Fixnum)
10
- @id = params
11
- else
12
- raise LibGooError, 'Unavailable type ' + params.class.to_s
13
- end
14
- end
15
- end
16
- end