Skip to content

Commit

Permalink
Merge pull request #5 from BNETDocs/refactor
Browse files Browse the repository at this point in the history
Refactoring
  • Loading branch information
carlbennett authored Jul 1, 2016
2 parents 3c784bf + 8bfd89c commit 0e7c38c
Show file tree
Hide file tree
Showing 49 changed files with 5,169 additions and 4,064 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*.o
/src/bncsutil/libbncsutil.so
1 change: 0 additions & 1 deletion Makefile.am

This file was deleted.

43 changes: 28 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,45 +1,58 @@
# BNCSUtil
## Preface
**BNCSUtil** is the **B**attle.**N**et **C**hat **S**ervice **Util**ity which
aids applications trying to logon to Battle.net™ v1 using the binary
aids applications trying to logon to Classic Battle.net™ using the binary
protocol. Specifically, BNCSUtil has functions that help with the cryptography
of game versions, keys, and passwords.

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

On Windows, this directory is:
### Windows
Copy the file to:

```
C:\Windows\System32
```

On Linux, this directory is:
### Linux
If you just have the `.so` file, copy it to:

```
/usr/lib/
```

And run:

```
sudo ldconfig
```

If you have just compiled from source, run this instead:

```
sudo make install
```

## Building
### Windows
The official build of BNCSUtil for Windows is produced using Visual Studio 2005
using the solution file in the `vc8_build` folder. The `vc7_build` is no longer
officially used or supported.
using the solution file in the `vc8_build` folder.

BNCSUtil requires GMP.

### Linux
To build:
```
./configure
cd src/bncsutil
make clean
make
make install
```

If you have a fresh checkout or are having build-related issues, run the
following to (re)generate the configure script:
```
autoreconf -if
```
If you are having build related issues, ensure that:

Note that to use `autoreconf` you will need to have GNU `autotools` installed.
- You have the `gcc` package installed.
- You have the `glibc` development package installed.
- You have the `gmp` development package installed.
43 changes: 0 additions & 43 deletions configure.ac

This file was deleted.

2 changes: 1 addition & 1 deletion product_version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3.1
1.3.2
24 changes: 0 additions & 24 deletions source_dist.sh

This file was deleted.

34 changes: 0 additions & 34 deletions src/Makefile.am

This file was deleted.

37 changes: 37 additions & 0 deletions src/bncsutil/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
SHELL = /bin/sh
SYSTEM = $(shell uname)
CXX = g++
CXXFLAGS = -Wall -O3 -I ../ -Wno-multichar -fPIC
CXXOBJ = bsha1.o cdkeydecoder.o checkrevision.o decodekey.o file.o libinfo.o oldauth.o
CC = gcc
CCFLAGS = -Wall -O3 -I ../ -Wno-multichar -fPIC
CCOBJ = nls.o pe.o sha1.o stack.o

ifeq ($(SYSTEM),Darwin)
LDFLAGS = -dynamiclib -lgmp -L/opt/local/lib
TARGET = libbncsutil.dylib
else
LDFLAGS = -shared -lgmp
TARGET = libbncsutil.so
endif

$(TARGET): $(CXXOBJ) $(CCOBJ)
$(CXX) $(CXXFLAGS) $(LDFLAGS) $(CXXOBJ) $(CCOBJ) -o $(TARGET)

$(CXXOBJ): %.o: %.cpp
$(CXX) $(CXXFLAGS) -c $< -o $@

$(CCOBJ): %.o: %.c
$(CC) $(CCFLAGS) -c $< -o $@

clean:
rm -f $(CCOBJ) $(CXXOBJ) $(TARGET) *~

all:
make $(TARGET)

install: $(TARGET)
mkdir -p /usr/include/bncsutil
cp *.h /usr/include/bncsutil
cp $(TARGET) /usr/lib
ldconfig
Loading

0 comments on commit 0e7c38c

Please sign in to comment.