Skip to content

Commit 0e7c38c

Browse files
authored
Merge pull request #5 from BNETDocs/refactor
Refactoring
2 parents 3c784bf + 8bfd89c commit 0e7c38c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+5169
-4064
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.o
2+
/src/bncsutil/libbncsutil.so

Makefile.am

Lines changed: 0 additions & 1 deletion
This file was deleted.

README.md

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,58 @@
11
# BNCSUtil
22
## Preface
33
**BNCSUtil** is the **B**attle.**N**et **C**hat **S**ervice **Util**ity which
4-
aids applications trying to logon to Battle.net™ v1 using the binary
4+
aids applications trying to logon to Classic Battle.net™ using the binary
55
protocol. Specifically, BNCSUtil has functions that help with the cryptography
66
of game versions, keys, and passwords.
77

88
## Installing
9-
Simply place the .so or .dll file in the same directory as the application that
10-
wishes to use it. If this does not work, install the file into the system
9+
Simply place the `.so` or `.dll` file in the same directory as the application
10+
that wishes to use it. If this does not work, install the file into the system
1111
library directory.
1212

13-
On Windows, this directory is:
13+
### Windows
14+
Copy the file to:
15+
1416
```
1517
C:\Windows\System32
1618
```
1719

18-
On Linux, this directory is:
20+
### Linux
21+
If you just have the `.so` file, copy it to:
22+
1923
```
2024
/usr/lib/
2125
```
2226

27+
And run:
28+
29+
```
30+
sudo ldconfig
31+
```
32+
33+
If you have just compiled from source, run this instead:
34+
35+
```
36+
sudo make install
37+
```
38+
2339
## Building
2440
### Windows
2541
The official build of BNCSUtil for Windows is produced using Visual Studio 2005
26-
using the solution file in the `vc8_build` folder. The `vc7_build` is no longer
27-
officially used or supported.
42+
using the solution file in the `vc8_build` folder.
2843

2944
BNCSUtil requires GMP.
3045

3146
### Linux
3247
To build:
3348
```
34-
./configure
49+
cd src/bncsutil
50+
make clean
3551
make
36-
make install
3752
```
3853

39-
If you have a fresh checkout or are having build-related issues, run the
40-
following to (re)generate the configure script:
41-
```
42-
autoreconf -if
43-
```
54+
If you are having build related issues, ensure that:
4455

45-
Note that to use `autoreconf` you will need to have GNU `autotools` installed.
56+
- You have the `gcc` package installed.
57+
- You have the `glibc` development package installed.
58+
- You have the `gmp` development package installed.

configure.ac

Lines changed: 0 additions & 43 deletions
This file was deleted.

product_version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.3.1
1+
1.3.2

source_dist.sh

Lines changed: 0 additions & 24 deletions
This file was deleted.

src/Makefile.am

Lines changed: 0 additions & 34 deletions
This file was deleted.

src/bncsutil/Makefile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
SHELL = /bin/sh
2+
SYSTEM = $(shell uname)
3+
CXX = g++
4+
CXXFLAGS = -Wall -O3 -I ../ -Wno-multichar -fPIC
5+
CXXOBJ = bsha1.o cdkeydecoder.o checkrevision.o decodekey.o file.o libinfo.o oldauth.o
6+
CC = gcc
7+
CCFLAGS = -Wall -O3 -I ../ -Wno-multichar -fPIC
8+
CCOBJ = nls.o pe.o sha1.o stack.o
9+
10+
ifeq ($(SYSTEM),Darwin)
11+
LDFLAGS = -dynamiclib -lgmp -L/opt/local/lib
12+
TARGET = libbncsutil.dylib
13+
else
14+
LDFLAGS = -shared -lgmp
15+
TARGET = libbncsutil.so
16+
endif
17+
18+
$(TARGET): $(CXXOBJ) $(CCOBJ)
19+
$(CXX) $(CXXFLAGS) $(LDFLAGS) $(CXXOBJ) $(CCOBJ) -o $(TARGET)
20+
21+
$(CXXOBJ): %.o: %.cpp
22+
$(CXX) $(CXXFLAGS) -c $< -o $@
23+
24+
$(CCOBJ): %.o: %.c
25+
$(CC) $(CCFLAGS) -c $< -o $@
26+
27+
clean:
28+
rm -f $(CCOBJ) $(CXXOBJ) $(TARGET) *~
29+
30+
all:
31+
make $(TARGET)
32+
33+
install: $(TARGET)
34+
mkdir -p /usr/include/bncsutil
35+
cp *.h /usr/include/bncsutil
36+
cp $(TARGET) /usr/lib
37+
ldconfig

0 commit comments

Comments
 (0)