-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathProgram.cs
More file actions
52 lines (41 loc) · 1.3 KB
/
Program.cs
File metadata and controls
52 lines (41 loc) · 1.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Zradelna
{
class Program
{
static void Main(string[] args)
{
//Create new instance of client
WebApiClient wa = new WebApiClient();
//Open homepage first to get sessin ID and cookie
wa.OpenHomepage();
//Login as "FFFFFFFF"
wa.Login(CardToId("FFFFFFFF"));
//Get current account balance
wa.GetAccountBalance();
}
/// <summary>
/// HEX (Little-endian) string to UInt32 as string
/// </summary>
/// <param name="hexString"></param>
/// <returns></returns>
static string CardToId(string hexString)
{
StringBuilder sb = new StringBuilder();
uint num = uint.Parse(hexString, System.Globalization.NumberStyles.AllowHexSpecifier);
byte[] floatVals = BitConverter.GetBytes(num);
byte[] newArray = new byte[4];
int position = 3;
foreach (byte b in floatVals)
{
newArray[position] = b;
position--;
}
return BitConverter.ToUInt32(newArray, 0).ToString();
}
}
}