In this topic I want to collect features that would be great to have in the TCP Gecko server code.
Please post your suggestions below if you have any that haven't been mentioned yet.
@Maschell
@gudenaurock
@NWPlayer123
@Marionumber1
@Onion_Knight
@wj44
@shinyquagsire23
@Hykem
@MrRean
- Support compressed sending/receiving of bytes to save network transmission time using an open-source compression library like zlib or even lzma. Unfortunately, I'm getting Z_MEM_ERROR when calling deflateInit(). Alternatively, there is lzma:
Code:
LzmaCompress(unsigned char *dest, size_t *destLen,
const unsigned char *src, size_t srcLen,
unsigned char *outProps,
size_t *outPropsSize, /* *outPropsSize must be = 5 */
int level, /* 0 <= level <= 9, default = 5 */
unsigned dictSize, /* default = (1 << 24) */
int lc, /* 0 <= lc <= 8, default = 3 */
int lp, /* 0 <= lp <= 4, default = 0 */
int pb, /* 0 <= pb <= 4, default = 2 */
int fb, /* 5 <= fb <= 273, default = 32 */
int numThreads /* 1 or 2, default = 2 */
);
I've found that the Wii U handles 0x4000 zlib compression pretty well and it makes your transfers about 40% faster
- Support dumping memory to the SD Card for performance reasons explained here
- Support multiple clients to be connected to the server at once to avoid having to disconnect when switching clients
- Support setting breakpoints to find out what reads from or writes to an address. Also execute breakpoints for assembly (Everything like on Wii). I heard that Chadderz got it to work so I'm positive this can be done already without an IOSU exploit release. Also Kinnay made breakpoint execute for Diibugger so it could be integrated into the TCP Gecko Installer
- Support pausing and resuming the game to allow more fine-grained memory searches. Some cheat codes can hardly be made without
- Merge kernel exploit and TCP Gecko installer
- Implement a search function for known values that returns all addresses matching the condition (==, !=, >, <, >=, <=) similar to the search function already implemented:
Code:
case COMMAND_MEMORY_SEARCH: { // Receive the initial data ret = recvwait(bss, clientfd, buffer, 4 * 5); ASSERT_FUNCTION_SUCCEEDED(ret, "recvwait (memory search information)") int startingAddress = ((int *) buffer)[0]; int length = ((int *) buffer)[1]; int resultsLimit = ((int *) buffer)[2]; int aligned = ((int *) buffer)[3]; int searchBytesCount = ((int *) buffer)[4]; // Receive the search bytes char searchBytes[searchBytesCount]; ret = recvwait(bss, clientfd, searchBytes, searchBytesCount); ASSERT_FUNCTION_SUCCEEDED(ret, "recvwait (memory search bytes)") int iterationIncrement = aligned ? searchBytesCount : 1; int searchBytesOccurrences = 0; // Perform the bytes search and collect the results for (int currentAddress = startingAddress; currentAddress < startingAddress + length; currentAddress += iterationIncrement) { if (memcmp((void *) currentAddress, searchBytes, searchBytesCount) == 0) { // Search bytes have been found ((int *) buffer)[1 + searchBytesOccurrences] = currentAddress; searchBytesOccurrences++; if ((resultsLimit == searchBytesOccurrences) || (searchBytesOccurrences == ((DATA_BUFFER_SIZE / 4) - 1))) { // We bail out break; } } } ((int *) buffer)[0] = searchBytesOccurrences * 4; ret = sendwait(bss, clientfd, buffer, 4 + (searchBytesOccurrences * 4)); ASSERT_FUNCTION_SUCCEEDED(ret, "recvwait (Sending search bytes occurrences)") break; }
- Support multi-threaded memory dumping (once again for performance reasons)
You can also add some coroutines or multi-processor functions to increase the speed
- Add screenshot support
- Allow replacing files on the file system
Code:case COMMAND_REPLACE_FILE: { // TODO Write file // Receive the file path char file_path[FS_MAX_FULLPATH_SIZE] = {0}; receiveString(bss, clientfd, file_path, FS_MAX_FULLPATH_SIZE); considerInitializingFileSystem(); // Create an empty file for writing. Its contents will be erased int handle; int status = FSOpenFile(client, commandBlock, file_path, "w", &handle, FS_RET_ALL_ERROR); if (status == FS_STATUS_OK) { // Send the OK status ((int *) buffer)[0] = status; ret = sendwait(bss, clientfd, buffer, 4); ASSERT_FUNCTION_SUCCEEDED(ret, "sendwait (OK status)") // Set the file handle position to the beginning ret = FSSetPosFile(client, commandBlock, handle, 0, FS_RET_ALL_ERROR); ASSERT_FUNCTION_SUCCEEDED(ret, "FSSetPosFile") // Allocate the file bytes buffer unsigned int file_buffer_size = 0x2000; char *fileBuffer = (char *) OSAllocFromSystem(file_buffer_size, FS_IO_BUFFER_ALIGN); ASSERT_ALLOCATED(fileBuffer, "File buffer") // Send the maximum file buffer size ret = sendwait(bss, clientfd, &file_buffer_size, 4); ASSERT_FUNCTION_SUCCEEDED(ret, "sendwait (maximum file buffer size)") while (true) { // Receive the data bytes length unsigned int dataLength; ret = recvwait(bss, clientfd, &dataLength, 4); ASSERT_FUNCTION_SUCCEEDED(ret, "recvwait (File bytes length)") ASSERT_MAXIMUM_HOLDS(file_buffer_size, dataLength, "File buffer overrun attempted") if (dataLength > 0) { // Receive the data ret = recvwait(bss, clientfd, fileBuffer, dataLength); ASSERT_FUNCTION_SUCCEEDED(ret, "recvwait (File buffer)") // Write the data and advance file handle position ret = FSWriteFile(client, commandBlock, fileBuffer, 1, dataLength, handle, 0, FS_RET_ALL_ERROR); ASSERT_FUNCTION_SUCCEEDED(ret, "FSWriteFile") } else { // Done break; } } /*// Flush the file back ret = FSFlushFile(client, commandBlock, handle, FS_RET_ALL_ERROR); CHECK_FUNCTION_FAILED(ret, "FSFlushFile")*/ // Close the file ret = FSCloseFile(client, commandBlock, handle, FS_RET_ALL_ERROR); ASSERT_FUNCTION_SUCCEEDED(ret, "FSCloseFile") // Free the file buffer OSFreeToSystem(fileBuffer); } else { // Send the status ((int *) buffer)[0] = status; ret = sendwait(bss, clientfd, buffer, 4); ASSERT_FUNCTION_SUCCEEDED(ret, "sendwait (status)") } break; }
- Allow adding files to the file system
Cafiine source.
Please post your suggestions below if you have any that haven't been mentioned yet.
@Maschell
@gudenaurock
@NWPlayer123
@Marionumber1
@Onion_Knight
@wj44
@shinyquagsire23
@Hykem
@MrRean
Last edited by BullyWiiPlaza,