Skip to content

Commit

Permalink
initial
Browse files Browse the repository at this point in the history
  • Loading branch information
isage committed Jan 25, 2024
0 parents commit 37343e4
Show file tree
Hide file tree
Showing 14 changed files with 1,890 additions and 0 deletions.
49 changes: 49 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Prerequisites
*.d

# Object files
*.o
*.ko
*.obj
*.elf

# Linker output
*.ilk
*.map
*.exp

# Precompiled Headers
*.gch
*.pch

# Libraries
*.lib
*.a
*.la
*.lo

# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib

# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex
*.skprx
*.suprx
*.self
*eboot.bin

# Debug files
*.dSYM/
*.su
*.idb
*.pdb

build/
15 changes: 15 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
cmake_minimum_required(VERSION 3.20)

if(NOT DEFINED CMAKE_TOOLCHAIN_FILE)
if(DEFINED ENV{VITASDK})
set(CMAKE_TOOLCHAIN_FILE "$ENV{VITASDK}/share/vita.toolchain.cmake" CACHE PATH "toolchain file")
else()
message(FATAL_ERROR "Please define VITASDK to point to your SDK path!")
endif()
endif()

project(CatLog LANGUAGES C)
include("$ENV{VITASDK}/share/vita.cmake" REQUIRED)

add_subdirectory(kernel_module)
add_subdirectory(user_module)
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Cat-A-Log
---

PlayStation® Vita™ network logging plugin

## Installation:

1. Copy both skprx/suprx into `ur0:tai`
2. Add `ur0:tai/catlog.skprx` under `*KERNEL` in `ur0:tai/config.txt`
3. Add `ur0:tai/catlog.suprx` under `*NPXS10015` in `ur0:tai/config.txt`
4. Reboot
5. On linux run `nc -kl <port>` (on windows you can use https://github.com/TeamFAPS/PSVita-RE-tools/blob/master/PrincessLog/build/NetDbgLogPc.exe <port>)
6. Open `Settings` app -> `Network` -> `Cat Log settings` and adjust settings for your target pc.

## Logging in homebrew
* Kernel: ksceKernelPrintf, etc.
* User: sceClibPrintf or printf

## Credits
* [Princess-of-Sleeping](https://github.com/Princess-of-Sleeping), [cuevavirus](https://git.shotatoshounenwachigau.moe/) - PrincessLog
* [SKGleba](https://github.com/SKGleba) - settings menu idea and injection code
* CBPS
15 changes: 15 additions & 0 deletions include/catlog.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#ifndef CATLOG_H
#define CATLOG_H

#include <stdint.h>

typedef struct {
uint32_t host;
uint16_t port;
uint16_t loglevel;
} CatLogConfig_t;

int CatLogReadConfig(uint32_t* host, uint16_t* port, uint16_t* level);
int CatLogUpdateConfig(uint32_t host, uint16_t port, uint16_t level);

#endif // CATLOG_H
58 changes: 58 additions & 0 deletions kernel_module/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
set(ELF catlog.elf)
set(SELF catlog.skprx)
set(LIB CatLog_stub)
set(LIB_FILE "lib${LIB}.a")

set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -nostdlib -Wall -Wextra -O3 -std=gnu99")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -nostdlib")

add_executable("${ELF}"
src/main.c
src/ringbuf.c
)

target_include_directories("${ELF}"
PRIVATE "${CMAKE_SOURCE_DIR}/include"
)

target_link_libraries("${ELF}"
gcc

taihenForKernel_stub
taihenModuleUtils_stub
SceSysmemForDriver_stub
SceSysclibForDriver_stub
SceSysrootForKernel_stub
SceKernelUtilsForDriver_stub

SceNetPsForDriver_stub
SceSblSsMgrForDriver_stub
SceThreadmgrForDriver_stub
SceSblACMgrForDriver_stub

SceQafMgrForDriver_stub

SceModulemgrForDriver_stub
SceIofilemgrForDriver_stub
SceDebugForDriver_stub
)

vita_create_self("${SELF}"
"${ELF}"
CONFIG exports.yml
UNSAFE
)

vita_create_stubs(stubs
"${ELF}"
exports.yml
KERNEL
)

add_library("${LIB}" STATIC IMPORTED GLOBAL)

add_dependencies("${LIB}" stubs)

set_target_properties("${LIB}" PROPERTIES
IMPORTED_LOCATION "${CMAKE_CURRENT_BINARY_DIR}/stubs/${LIB_FILE}"
)
13 changes: 13 additions & 0 deletions kernel_module/exports.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
CatLog:
attributes: 0
version:
major: 1
minor: 0
main:
start: module_start
libraries:
CatLog:
syscall: true
functions:
- CatLogReadConfig
- CatLogUpdateConfig
Loading

0 comments on commit 37343e4

Please sign in to comment.