diff --git a/libos/README.md b/libos/README.md new file mode 100644 index 0000000..b3968d0 --- /dev/null +++ b/libos/README.md @@ -0,0 +1,11 @@ +# libos + +## Compile + +1. gcc -c -Wall -Werror -fpic libos.c +2. gcc -shared -o libos.so.0.0.0 libos.o + +## Install + +1. Move new libos.so.0.0.0 to /usr/lib/libos.so.0.0.0 +2. Link /usr/lib/libos.so.0.0.0 to /usr/lib/libos.so.0 diff --git a/libos/libos.c b/libos/libos.c new file mode 100644 index 0000000..31085f5 --- /dev/null +++ b/libos/libos.c @@ -0,0 +1,3 @@ +int validate_os(){ + return 1; +} diff --git a/patterns/angae-010.template b/patterns/angae-010.template new file mode 100644 index 0000000..32c4099 --- /dev/null +++ b/patterns/angae-010.template @@ -0,0 +1,35 @@ +// Files are in little endian +struct FILE { + // from loadHeaderOnly + struct HEAD { + char PatternDate[4] ; // a timestamp in little endian; there is also a "PatternDate" in the header data, maybe something different + + // the following 7 fields are "HeadDatas" + char unknown[1000] ; + int PackageID ; // see CUserPatternDBMgr::SetPackageID + int unknown2 ; // next 4 are rather unclear, info from CPatternDBMgr::GetOSFile() + int PatternDate ; + int FileCount ; + int HeadPos ; + int RealSize ; + + // Count is split into two 32bit integers, unclear why + int Count1 ; // this is 153719 in little endian + int Count2 ; + } magic ; + + struct PACKAGES { + int RecLen ; // length of the pattern, 0xc8, 200 byte + int PackageID ; // mostly goes from 01 to 0E max at position 1. + //ushort incrementing ; // this increments over the file. Sometimes multiple patterns have the same "id". Maybe the same identifier identifies a single file? Interestingly this is going up to FF FE. + char HeadData2[8] ; // looks like there is another header + + char content[192] ; // cannot confirm that I can decrypt this out of the box with openssl. + } packages[153719]; + + // sha1 of whatever + struct CHECKSUM { + char sha1[20] ; + } checksum; + +} file; diff --git a/rtscan/README.md b/rtscan/README.md new file mode 100644 index 0000000..24fd830 --- /dev/null +++ b/rtscan/README.md @@ -0,0 +1,5 @@ +# Interact with /dev/res + +`resctl.py` can be used to interact with `rtscan` kernel module via ioctl calls to `/dev/res`. + +**TODO**: Implement all ioctl calls diff --git a/rtscan/resctl.py b/rtscan/resctl.py new file mode 100644 index 0000000..dd584d7 --- /dev/null +++ b/rtscan/resctl.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python2 +from fcntl import ioctl + +filename = '/dev/res' +fd = open(filename, 'wb') +ret = ioctl(fd, 29187, 0) + +if ret is not 0: + print('Error') + +fd.close()