1
0
mirror of https://github.com/pumpitupdev/pumptools.git synced 2025-02-17 10:58:36 +01:00

59 Commits

Author SHA1 Message Date
icex2
e21a9638a2 wip 2021-02-02 21:05:59 +01:00
icex2
abbee9291b hasp + f2: Add missing hasp API method, fixes f2 hanging profile load
f2 was hanging on loading a profile from usb because a hasp API call
was missing that needed to be hooked. Stub the missing call and
return what the game expects there.

This also works with prime because prime is not using that function
anymore.
2021-02-02 21:05:59 +01:00
icex2
b14751a362 prinet-proxy: Fix shutdown getting stuck when thread is waiting to receive 2021-02-01 22:10:35 +01:00
icex2
a81e886f0f prinet-proxy: Fix memory leak
Incorrect encryption size for keepalive package. don't include
macbytes in length. Tweak length afterwards with result of
encryption function
2021-02-01 22:10:34 +01:00
icex2
a3c0fc3303 prinet-proxy/client: Bugfix, avoid claiming mutex constantly
Without a brief pause between retries on the socket to receive
data, other threads, e.g. keepalive, have a hard time acquiring
the mutex. This leads to the keepalive thread gettin stuck
frequently.
2021-01-23 23:46:22 +01:00
icex2
7dd2403d67 util/time: Refactor time and use gettimeofday
Something was not properly working with the previous implementation.
Since no ns accuracy is requried, gettimeofday is good enough for
now
2021-01-23 23:46:22 +01:00
icex2
b29f21f3f1 prinet-proxy/keepalive: Fix thread pausing and when to send keepalive 2021-01-23 23:46:22 +01:00
icex2
2f5c4467a0 prinet-proxy/client: Move log message, only makes sense when socket not closed 2021-01-23 23:46:22 +01:00
icex2
1e32a1f6c0 util/time: Add functions to measure time 2021-01-23 23:46:22 +01:00
icex2
52ae247f00 prinet-proxy/client: Increase timeout for nonblocking recv length 2021-01-23 23:46:22 +01:00
icex2
210f30ca03 prinet-proxy/client: Minor logging enhancements 2021-01-23 23:46:22 +01:00
icex2
5a6c8e588b util/sock-tcp: Fix non blocking receiving, detect broken connection 2021-01-23 23:46:22 +01:00
icex2
5a78cdf7f6 prinet-proxy: Add keepalive module
Starts a separate thread that sends the keepalive packet to the
client in defined intervals
2021-01-23 23:46:22 +01:00
icex2
1bd7d927c4 prinet-proxy/client: Clarify log messages 2021-01-23 23:46:22 +01:00
icex2
32172670da prinet-proxy/packet: Add keepalive packet + creation function 2021-01-23 23:46:22 +01:00
icex2
c29136afb5 prinet-proxy: Make proxy client thread safe + hide connection handling
Required for running separate keepalive thread.
2021-01-23 23:46:22 +01:00
icex2
52a821f207 prinet-proxy: Separate module for client communication/packet handling
Move stuff from main. Will be re-used for keepalive packet sending
2021-01-23 23:46:22 +01:00
icex2
171e14ddc3 prinet-proxy: Handle uni-directional messages + bugfix cleanup
Allow handling of uni-directional messages not closing the
connection.

This also fixes cleanup of buffers on each iteration which wasn't
done properly before when the inner loop was successful.
The labeled cleanup part was skipped.
2021-01-23 23:46:22 +01:00
icex2
43c8acdfb2 prinet: Allow no response to request
Different to empty response which is data size of response == 0.

No response happens for uni-directional messages. This is reflected
by not containing any content data in the http response.

A response without any additional data still contains at least the
size field (4 bytes) set to 0
2021-01-23 23:46:22 +01:00
icex2
6aafaaf12a prinet-proxy: Fix connection handling
See elaborate comment for why this is required...
2021-01-23 23:46:22 +01:00
icex2
60f61d2de5 prinet-proxy: Bugfix handling of decryption data length 2021-01-23 23:46:13 +01:00
icex2
8747fce0ca hook/pro: Add net-crypt module, monitor network packet decryption failure 2021-01-17 01:58:24 +01:00
icex2
07146a7672 hook/pri: Update server addresses
- Use default ports for redirects -> attach local proxy
- Block a few more addresses that are currently unknown
2021-01-17 01:57:01 +01:00
icex2
73f2402455 pumpnet/prinet-proxy: Change default port to correct stock prime port 2021-01-17 01:53:35 +01:00
icex2
3b56bccfff Add automatic release package upload to target webserver 2021-01-17 01:34:23 +01:00
icex2
fc04ba5623 Include executing unit tests in gitlab ci pipeline 2021-01-17 01:34:23 +01:00
icex2
d261a905b3 Add Dockerfile.test for running pumptool's tests in a container 2021-01-17 01:34:23 +01:00
icex2
6c944ab9a0 Rename dockerfile to allow using multiple dockerfiles 2021-01-17 01:34:23 +01:00
icex2
9126fbd804 cmake: Remove public release compile branch, not used anymore
This furthermore fixes the argument positioning of -g which
needs to be part of the compiler flags not linker flags.
Fixes not showing line numbers and source files on valgrind
2021-01-17 01:34:23 +01:00
icex2
986571a513 pumpnet: Add prinet-proxy application
Sits between the game (client) and pumpnet (server) translating
the game's native protocol to more managable http requests.

Encryption and decryption is also taken care off to remove that
burden from the server side. This makes http requests as generic as
"game version X is sending some data. here, go and figure out what
to do" on the server side.
2021-01-17 01:34:23 +01:00
icex2
506abe92da pumpnet/lib: Add prinet module for sending prime network data to pumpnet 2021-01-17 01:34:23 +01:00
icex2
2b193a8d40 pumpnet/lib: Add protocol for prinet data 2021-01-17 01:34:23 +01:00
icex2
60e37e8eff pumpnet/lib: Adapt cmake file to refactoring changes 2021-01-17 01:34:23 +01:00
icex2
da44fb71a4 pumpnet/client: Remove curl dependency, already part of pumpnet-lib 2021-01-17 01:34:23 +01:00
icex2
1210386602 hook/patch: Adapt net-profile to naming changes of deps 2021-01-17 01:34:23 +01:00
icex2
450f5507d8 pumpnet/client: Adapt to naming changes of deps 2021-01-17 01:34:23 +01:00
icex2
250ff3bf51 pumpnet/lib: Remove now obsolete pumpnet module
Got separated to allow re-usability of specific parts for prinet
2021-01-17 01:34:23 +01:00
icex2
30f45783ff pumpnet/lib: Tweak http module, return recv size, set recv buffer size 2021-01-17 01:34:23 +01:00
icex2
4c46aa4337 pumpnet/lib: Factor out (from pumpnet module) usbprofile parts
Preparation for having another module for handling network stuff
and re-using parts of the pumpnet lib
2021-01-17 01:34:23 +01:00
icex2
7b03067348 pumpnet/lib: Rename protocol -> protocol-usbprofile 2021-01-17 01:34:23 +01:00
icex2
e94d64d30a pumpnet/lib: Factor out some base pumpnet logic, e.g. get+put with retry 2021-01-17 01:34:23 +01:00
icex2
659f2ea1f0 util/sock-tcp: Add functions for client side data handling 2021-01-17 01:34:21 +01:00
icex2
eac14dd673 util/sock-tcp: Add constant for invalid socket handle 2021-01-17 01:34:21 +01:00
icex2
abb383995a sec/prinet: Module for encryption/decryption of prime network traffic 2021-01-17 01:34:18 +01:00
icex2
c84ff4463f util/iobuf: Add functions to safely and easly alloc/free iobufs 2021-01-17 00:52:09 +01:00
icex2
2871238427 util/rand: Extend, add functions to init with seed, rand u8, u16, array 2021-01-17 00:51:22 +01:00
icex2
628a5d040e util/base64: Add tests 2021-01-17 00:50:54 +01:00
icex2
8c66e6b763 piubtn real: Add missing library on linking 2020-12-31 19:55:24 +01:00
icex2
6492e4df1a capnhook/result: Extend error code list 2020-12-31 19:54:59 +01:00
icex2
fb69d87c15 doc: Add doc for hooks regarding dependencies 2020-10-25 16:19:42 +01:00