diff --git a/README.MD b/README.MD
index cad1868..20cfe4a 100644
--- a/README.MD
+++ b/README.MD
@@ -121,6 +121,9 @@ make
then you can build the example_plugin.
+# Logging
+For logging you need to start the UdpDebugReader. This has been created by @dimok789 and can be found in the tools folder.
+
# Similar projects
## function-patcher-example
diff --git a/tools/udp_debug_reader/Makefile b/tools/udp_debug_reader/Makefile
new file mode 100644
index 0000000..c98ba4c
--- /dev/null
+++ b/tools/udp_debug_reader/Makefile
@@ -0,0 +1,12 @@
+CC=gcc
+CFLAGS=-c -Wall
+LDFLAGS=
+SOURCES:= $(wildcard source/*.c)
+OBJ_FILES = $(patsubst source/%.c,obj/%.o,$(SOURCES))
+EXECUTABLE=UdpDebugReader
+
+$(EXECUTABLE): $(OBJ_FILES)
+ $(CC) $(LDFLAGS) -o $@ $^
+
+obj/%.o: source/%.c
+ mkdir obj; $(CC) $(CFLAGS) -c -o $@ $<
diff --git a/tools/udp_debug_reader/UdpDebugReader b/tools/udp_debug_reader/UdpDebugReader
new file mode 100644
index 0000000..3ebaf70
Binary files /dev/null and b/tools/udp_debug_reader/UdpDebugReader differ
diff --git a/tools/udp_debug_reader/UdpDebugReader.cbp b/tools/udp_debug_reader/UdpDebugReader.cbp
new file mode 100644
index 0000000..16d9183
--- /dev/null
+++ b/tools/udp_debug_reader/UdpDebugReader.cbp
@@ -0,0 +1,47 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tools/udp_debug_reader/UdpDebugReader.depend b/tools/udp_debug_reader/UdpDebugReader.depend
new file mode 100644
index 0000000..685e484
--- /dev/null
+++ b/tools/udp_debug_reader/UdpDebugReader.depend
@@ -0,0 +1,424 @@
+# depslib dependency file v1.0
+1279792267 source:c:\dokumente und einstellungen\dima\desktop\UdpDebugReader\source\network.c
+
+
+
+
+
+
+
+
+ "network.h"
+
+1452177726 "
+
+1279792340 source:c:\dokumente und einstellungen\dima\desktop\UdpDebugReader\source\main.c
+
+
+
+ "network.h"
+
+1279798227 source:/home/dima/Desktop/UdpDebugReader/source/main.c
+
+
+
+ "Input.h"
+ "network.h"
+
+1279798084 /home/dima/Desktop/UdpDebugReader/source/network.h
+ "winsock/winsock.h"
+
+
+
+
+1279798084 n.h>
+
+1279797916 source:/home/dima/Desktop/UdpDebugReader/source/network.c
+
+
+
+
+
+
+ "network.h"
+
+1279798221 /home/dima/Desktop/UdpDebugReader/source/Input.h
+
+
+
+1445718391 >
+
+1279798252 source:/home/dima/Desktop/UdpDebugReader/source/Input.c
+
+
+
+ "Input.h"
+
+
+1198764450 /home/dima/Desktop/UdpDebugReader/source/winsock/winsock.h
+
+
+
+1279798227 source:d:\UdpDebugReader\source\main.c
+
+
+
+ "Input.h"
+ "network.h"
+
+1279799401 d:\UdpDebugReader\source\input.h
+
+
+
+1279799400 d:\UdpDebugReader\source\network.h
+ "winsock/winsock.h"
+
+
+
+
+
+1452177726
+
+1198768050 d:\UdpDebugReader\source\winsock\winsock.h
+
+
+
+1279799399 source:d:\UdpDebugReader\source\network.c
+
+
+
+
+
+ "network.h"
+
+1279798252 source:d:\UdpDebugReader\source\input.c
+
+
+
+ "Input.h"
+
+
+1291665385 source:d:\code\windowstools\UdpDebugReader\source\network.c
+
+
+
+
+
+ "network.h"
+
+1291665388 d:\code\windowstools\UdpDebugReader\source\network.h
+ "winsock/winsock.h"
+
+
+
+
+
+1198764450 d:\code\windowstools\UdpDebugReader\source\winsock\winsock.h
+
+
+
+1291665361 source:d:\code\windowstools\UdpDebugReader\source\input.c
+
+
+
+ "Input.h"
+
+
+1291665378 d:\code\windowstools\UdpDebugReader\source\input.h
+
+
+
+1293478462 source:d:\code\windowstools\UdpDebugReader\source\main.c
+
+
+
+ "Input.h"
+ "network.h"
+
+1325182250 source:/media/truecrypt1/code/LocalTrunk/Tools/UdpDebugReader/source/Input.c
+
+
+
+ "Input.h"
+
+
+
+
+ "Input.h"
+
+
+1325182250 /media/truecrypt1/code/LocalTrunk/Tools/UdpDebugReader/source/Input.h
+
+
+
+
+
+1334304767 source:/media/truecrypt1/code/LocalTrunk/Tools/UdpDebugReader/source/main.c
+
+
+
+ "Input.h"
+ "network.h"
+
+
+
+ "Input.h"
+ "network.h"
+
+1334304019 /media/truecrypt1/code/LocalTrunk/Tools/UdpDebugReader/source/network.h
+ "winsock/winsock.h"
+
+
+
+
+ "winsock/winsock.h"
+
+
+
+
+
+1325182250 /media/truecrypt1/code/LocalTrunk/Tools/UdpDebugReader/source/winsock/winsock.h
+
+
+
+
+
+1334308770 source:/media/truecrypt1/code/LocalTrunk/Tools/UdpDebugReader/source/network.c
+
+
+
+
+
+ "network.h"
+
+
+
+
+
+ "network.h"
+
+1334910814 source:d:\code\localtrunk\tools\UdpDebugReader\source\main.c
+
+
+
+ "Input.h"
+ "network.h"
+
+1334909941 d:\code\localtrunk\tools\UdpDebugReader\source\input.h
+
+
+
+1334910353 d:\code\localtrunk\tools\UdpDebugReader\source\network.h
+ "winsock/winsock.h"
+
+
+
+
+
+1325182250 d:\code\localtrunk\tools\UdpDebugReader\source\winsock\winsock.h
+
+
+
+1334910629 source:d:\code\localtrunk\tools\UdpDebugReader\source\network.c
+
+
+
+
+
+ "network.h"
+
+1334909938 source:d:\code\localtrunk\tools\UdpDebugReader\source\input.c
+
+
+
+ "Input.h"
+
+
+1334909938 source:/media/truecrypt1/test/UdpDebugReader/source/Input.c
+
+
+
+ "Input.h"
+
+
+1334909941 /media/truecrypt1/test/UdpDebugReader/source/Input.h
+
+
+
+1334910431 source:/media/truecrypt1/test/UdpDebugReader/source/main.c
+
+
+
+ "Input.h"
+ "network.h"
+
+1334910353 /media/truecrypt1/test/UdpDebugReader/source/network.h
+ "winsock/winsock.h"
+
+
+
+
+
+1325182250 /media/truecrypt1/test/UdpDebugReader/source/winsock/winsock.h
+
+
+
+1334910629 source:/media/truecrypt1/test/UdpDebugReader/source/network.c
+
+
+
+
+
+ "network.h"
+
+1445714791 source:d:\code\UdpDebugReader\source\input.c
+
+
+
+ "Input.h"
+
+
+1445714791 d:\code\UdpDebugReader\source\input.h
+
+
+
+1452177726 source:d:\code\UdpDebugReader\source\main.c
+
+
+
+ "Input.h"
+ "network.h"
+
+1452177726 d:\code\UdpDebugReader\source\network.h
+ "winsock/winsock.h"
+
+
+
+
+
+1445714791 d:\code\UdpDebugReader\source\winsock\winsock.h
+
+
+
+1452177726 source:d:\code\UdpDebugReader\source\network.c
+
+
+
+
+
+ "network.h"
+
+1445714791 source:d:\loadiine_code\loadiine_gx2\udpdebugreader\source\input.c
+
+
+
+ "Input.h"
+
+
+1445714791 d:\loadiine_code\loadiine_gx2\udpdebugreader\source\input.h
+
+
+
+1455123313 source:d:\loadiine_code\loadiine_gx2\udpdebugreader\source\network.c
+
+
+
+
+
+ "network.h"
+
+1452177726 d:\loadiine_code\loadiine_gx2\udpdebugreader\source\network.h
+ "winsock/winsock.h"
+
+
+
+
+
+1445714791 d:\loadiine_code\loadiine_gx2\udpdebugreader\source\winsock\winsock.h
+
+
+
+1455123353 source:d:\loadiine_code\loadiine_gx2\udpdebugreader\source\main.c
+
+
+
+
+ "Input.h"
+ "network.h"
+
+1445718391 source:/media/harddisk1/loadiine_code/loadiine_gx2/UdpDebugReader/source/Input.c
+
+
+
+ "Input.h"
+
+
+1445718391 /media/harddisk1/loadiine_code/loadiine_gx2/UdpDebugReader/source/Input.h
+
+
+
+1455123087 source:/media/harddisk1/loadiine_code/loadiine_gx2/UdpDebugReader/source/main.c
+
+
+
+
+ "Input.h"
+ "network.h"
+
+1452177726 /media/harddisk1/loadiine_code/loadiine_gx2/UdpDebugReader/source/network.h
+ "winsock/winsock.h"
+
+
+
+
+
+1445718391 /media/harddisk1/loadiine_code/loadiine_gx2/UdpDebugReader/source/winsock/winsock.h
+
+
+
+1452177726 source:/media/harddisk1/loadiine_code/loadiine_gx2/UdpDebugReader/source/network.c
+
+
+
+
+
+ "network.h"
+
+1445718391 source:/media/harddisk1/loadiine_code/loadiine_gx2/UdpDebugReader/source/Input.c
+
+
+
+ "Input.h"
+
+
+1445718391 /media/harddisk1/loadiine_code/loadiine_gx2/UdpDebugReader/source/Input.h
+
+
+
+1455123353 source:/media/harddisk1/loadiine_code/loadiine_gx2/UdpDebugReader/source/main.c
+
+
+
+
+ "Input.h"
+ "network.h"
+
+1452177726 /media/harddisk1/loadiine_code/loadiine_gx2/UdpDebugReader/source/network.h
+ "winsock/winsock.h"
+
+
+
+
+
+1445718391 /media/harddisk1/loadiine_code/loadiine_gx2/UdpDebugReader/source/winsock/winsock.h
+
+
+
+1455123550 source:/media/harddisk1/loadiine_code/loadiine_gx2/UdpDebugReader/source/network.c
+
+
+
+
+
+ "network.h"
+
diff --git a/tools/udp_debug_reader/UdpDebugReader.exe b/tools/udp_debug_reader/UdpDebugReader.exe
new file mode 100644
index 0000000..7c34fee
Binary files /dev/null and b/tools/udp_debug_reader/UdpDebugReader.exe differ
diff --git a/tools/udp_debug_reader/UdpDebugReader.layout b/tools/udp_debug_reader/UdpDebugReader.layout
new file mode 100644
index 0000000..cc1897b
--- /dev/null
+++ b/tools/udp_debug_reader/UdpDebugReader.layout
@@ -0,0 +1,29 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/tools/udp_debug_reader/doxygen/doxyfile b/tools/udp_debug_reader/doxygen/doxyfile
new file mode 100644
index 0000000..77791c9
--- /dev/null
+++ b/tools/udp_debug_reader/doxygen/doxyfile
@@ -0,0 +1,288 @@
+#******************************************************************************
+# Base configuration for doxygen, generated by DoxyBlocks.
+# You may change these defaults to suit your purposes.
+#******************************************************************************
+
+# Doxyfile 1.7.3
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+DOXYFILE_ENCODING = UTF-8
+PROJECT_NAME = UdpDebugReader
+PROJECT_NUMBER =
+PROJECT_BRIEF =
+PROJECT_LOGO =
+OUTPUT_DIRECTORY =
+CREATE_SUBDIRS = NO
+OUTPUT_LANGUAGE = English
+BRIEF_MEMBER_DESC = YES
+REPEAT_BRIEF = YES
+ABBREVIATE_BRIEF =
+ALWAYS_DETAILED_SEC = NO
+INLINE_INHERITED_MEMB = NO
+FULL_PATH_NAMES = NO
+STRIP_FROM_PATH =
+STRIP_FROM_INC_PATH =
+SHORT_NAMES = NO
+JAVADOC_AUTOBRIEF = NO
+QT_AUTOBRIEF = NO
+MULTILINE_CPP_IS_BRIEF = NO
+INHERIT_DOCS = YES
+SEPARATE_MEMBER_PAGES = NO
+TAB_SIZE = 8
+ALIASES =
+OPTIMIZE_OUTPUT_FOR_C = NO
+OPTIMIZE_OUTPUT_JAVA = NO
+OPTIMIZE_FOR_FORTRAN = NO
+OPTIMIZE_OUTPUT_VHDL = NO
+EXTENSION_MAPPING =
+BUILTIN_STL_SUPPORT = NO
+CPP_CLI_SUPPORT = NO
+SIP_SUPPORT = NO
+IDL_PROPERTY_SUPPORT = YES
+DISTRIBUTE_GROUP_DOC = NO
+SUBGROUPING = YES
+TYPEDEF_HIDES_STRUCT = NO
+SYMBOL_CACHE_SIZE = 0
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+EXTRACT_ALL = NO
+EXTRACT_PRIVATE = NO
+EXTRACT_STATIC = NO
+EXTRACT_LOCAL_CLASSES = YES
+EXTRACT_LOCAL_METHODS = NO
+EXTRACT_ANON_NSPACES = NO
+HIDE_UNDOC_MEMBERS = NO
+HIDE_UNDOC_CLASSES = NO
+HIDE_FRIEND_COMPOUNDS = NO
+HIDE_IN_BODY_DOCS = NO
+INTERNAL_DOCS = NO
+CASE_SENSE_NAMES = NO
+HIDE_SCOPE_NAMES = NO
+SHOW_INCLUDE_FILES = YES
+FORCE_LOCAL_INCLUDES = NO
+INLINE_INFO = YES
+SORT_MEMBER_DOCS = YES
+SORT_BRIEF_DOCS = NO
+SORT_MEMBERS_CTORS_1ST = NO
+SORT_GROUP_NAMES = NO
+SORT_BY_SCOPE_NAME = NO
+STRICT_PROTO_MATCHING = NO
+GENERATE_TODOLIST = YES
+GENERATE_TESTLIST = YES
+GENERATE_BUGLIST = YES
+GENERATE_DEPRECATEDLIST= YES
+ENABLED_SECTIONS =
+MAX_INITIALIZER_LINES = 30
+SHOW_USED_FILES = YES
+SHOW_DIRECTORIES = NO
+SHOW_FILES = YES
+SHOW_NAMESPACES = YES
+FILE_VERSION_FILTER =
+LAYOUT_FILE =
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+QUIET = NO
+WARNINGS = YES
+WARN_IF_UNDOCUMENTED = NO
+WARN_IF_DOC_ERROR = YES
+WARN_NO_PARAMDOC = YES
+WARN_FORMAT = "$file:$line: $text"
+WARN_LOGFILE = "D:\code\UdpDebugReader\doxygen\doxygen.log"
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+INPUT = \
+ "..\source\network.h" \
+ "..\source\Input.h" \
+ "..\source\Input.c" \
+ "..\source\main.c" \
+ "..\source\network.c"
+INPUT_ENCODING = UTF-8
+FILE_PATTERNS =
+RECURSIVE = NO
+EXCLUDE =
+EXCLUDE_SYMLINKS = NO
+EXCLUDE_PATTERNS =
+EXCLUDE_SYMBOLS =
+EXAMPLE_PATH =
+EXAMPLE_PATTERNS =
+EXAMPLE_RECURSIVE = NO
+IMAGE_PATH =
+INPUT_FILTER =
+FILTER_PATTERNS =
+FILTER_SOURCE_FILES = NO
+FILTER_SOURCE_PATTERNS =
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+SOURCE_BROWSER = NO
+INLINE_SOURCES = NO
+STRIP_CODE_COMMENTS = YES
+REFERENCED_BY_RELATION = NO
+REFERENCES_RELATION = NO
+REFERENCES_LINK_SOURCE = YES
+USE_HTAGS = NO
+VERBATIM_HEADERS = YES
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+ALPHABETICAL_INDEX = YES
+COLS_IN_ALPHA_INDEX = 5
+IGNORE_PREFIX =
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+GENERATE_HTML = YES
+HTML_OUTPUT = html
+HTML_FILE_EXTENSION = .html
+HTML_HEADER =
+HTML_FOOTER =
+HTML_STYLESHEET =
+HTML_COLORSTYLE_HUE = 220
+HTML_COLORSTYLE_SAT = 100
+HTML_COLORSTYLE_GAMMA = 80
+HTML_TIMESTAMP = YES
+HTML_ALIGN_MEMBERS = YES
+HTML_DYNAMIC_SECTIONS = NO
+GENERATE_DOCSET = NO
+DOCSET_FEEDNAME = "Doxygen generated docs"
+DOCSET_BUNDLE_ID = org.doxygen.Project
+DOCSET_PUBLISHER_ID = org.doxygen.Publisher
+DOCSET_PUBLISHER_NAME = Publisher
+GENERATE_HTMLHELP = NO
+CHM_FILE = "../UdpDebugReader.chm"
+HHC_LOCATION =
+GENERATE_CHI = NO
+CHM_INDEX_ENCODING =
+BINARY_TOC = NO
+TOC_EXPAND = NO
+GENERATE_QHP = NO
+QCH_FILE =
+QHP_NAMESPACE = org.doxygen.Project
+QHP_VIRTUAL_FOLDER = doc
+QHP_CUST_FILTER_NAME =
+QHP_CUST_FILTER_ATTRS =
+QHP_SECT_FILTER_ATTRS =
+QHG_LOCATION =
+GENERATE_ECLIPSEHELP = NO
+ECLIPSE_DOC_ID = org.doxygen.Project
+DISABLE_INDEX = NO
+ENUM_VALUES_PER_LINE = 4
+GENERATE_TREEVIEW = YES
+USE_INLINE_TREES = NO
+TREEVIEW_WIDTH = 250
+EXT_LINKS_IN_WINDOW = NO
+FORMULA_FONTSIZE = 10
+FORMULA_TRANSPARENT = YES
+USE_MATHJAX = NO
+MATHJAX_RELPATH = http://www.mathjax.org/mathjax
+SEARCHENGINE = YES
+SERVER_BASED_SEARCH = NO
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+GENERATE_LATEX = NO
+LATEX_OUTPUT = latex
+LATEX_CMD_NAME = latex
+MAKEINDEX_CMD_NAME = makeindex
+COMPACT_LATEX = NO
+PAPER_TYPE = a4
+EXTRA_PACKAGES =
+LATEX_HEADER =
+PDF_HYPERLINKS = YES
+USE_PDFLATEX = YES
+LATEX_BATCHMODE = NO
+LATEX_HIDE_INDICES = NO
+LATEX_SOURCE_CODE = NO
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+GENERATE_RTF = NO
+RTF_OUTPUT = rtf
+COMPACT_RTF = NO
+RTF_HYPERLINKS = NO
+RTF_STYLESHEET_FILE =
+RTF_EXTENSIONS_FILE =
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+GENERATE_MAN = NO
+MAN_OUTPUT = man
+MAN_EXTENSION = .3
+MAN_LINKS = NO
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+GENERATE_XML = NO
+XML_OUTPUT = xml
+XML_SCHEMA =
+XML_DTD =
+XML_PROGRAMLISTING = YES
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+GENERATE_AUTOGEN_DEF = NO
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+GENERATE_PERLMOD = NO
+PERLMOD_LATEX = NO
+PERLMOD_PRETTY = YES
+PERLMOD_MAKEVAR_PREFIX =
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+ENABLE_PREPROCESSING = YES
+MACRO_EXPANSION = YES
+EXPAND_ONLY_PREDEF = YES
+SEARCH_INCLUDES = YES
+INCLUDE_PATH =
+INCLUDE_FILE_PATTERNS =
+PREDEFINED = WXUNUSED()=
+EXPAND_AS_DEFINED =
+SKIP_FUNCTION_MACROS = YES
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+TAGFILES =
+GENERATE_TAGFILE =
+ALLEXTERNALS = NO
+EXTERNAL_GROUPS = YES
+PERL_PATH = /usr/bin/perl
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+CLASS_DIAGRAMS = NO
+MSCGEN_PATH =
+HIDE_UNDOC_RELATIONS = YES
+HAVE_DOT = NO
+DOT_NUM_THREADS = 0
+DOT_FONTNAME = Helvetica
+DOT_FONTSIZE = 10
+DOT_FONTPATH =
+CLASS_GRAPH = YES
+COLLABORATION_GRAPH = YES
+GROUP_GRAPHS = YES
+UML_LOOK = NO
+TEMPLATE_RELATIONS = NO
+INCLUDE_GRAPH = YES
+INCLUDED_BY_GRAPH = YES
+CALL_GRAPH = YES
+CALLER_GRAPH = NO
+GRAPHICAL_HIERARCHY = YES
+DIRECTORY_GRAPH = YES
+DOT_IMAGE_FORMAT = png
+DOT_PATH =
+DOTFILE_DIRS =
+MSCFILE_DIRS =
+DOT_GRAPH_MAX_NODES = 50
+MAX_DOT_GRAPH_DEPTH = 0
+DOT_TRANSPARENT = NO
+DOT_MULTI_TARGETS = NO
+GENERATE_LEGEND = YES
+DOT_CLEANUP = YES
+
diff --git a/tools/udp_debug_reader/source/Input.c b/tools/udp_debug_reader/source/Input.c
new file mode 100644
index 0000000..3fb0708
--- /dev/null
+++ b/tools/udp_debug_reader/source/Input.c
@@ -0,0 +1,118 @@
+/****************************************************************************
+ * Copyright (C) 2010-2012
+ * by Dimok
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any
+ * damages arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any
+ * purpose, including commercial applications, and to alter it and
+ * redistribute it freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you
+ * must not claim that you wrote the original software. If you use
+ * this software in a product, an acknowledgment in the product
+ * documentation would be appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and
+ * must not be misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ * distribution.
+ ***************************************************************************/
+#include
+#include
+#include
+#include "Input.h"
+
+FILE * logFile = NULL;
+
+char CheckInput()
+{
+ if(!kbhit())
+ return 0;
+
+ char inputChar = getch();
+
+ if(inputChar == 'f')
+ {
+ if(logFile)
+ {
+ printf("\n\nStopped logging.\n\n");
+ fclose(logFile);
+ logFile = NULL;
+ }
+ else
+ {
+ logFile = fopen("GeckoLog.txt", "wb");
+ if(logFile)
+ printf("\n\nStarted logging to GeckoLog.txt.\n\n");
+ else
+ printf("\n\nCan't create GeckoLog.txt.\n\n");
+ }
+ }
+ else if(inputChar == 'c')
+ {
+ system(CLEAR);
+ }
+
+ return inputChar;
+}
+
+#ifndef WIN32
+#include
+
+int kbhit(void)
+{
+ struct termios term, oterm;
+ int fd = 0;
+ int c = 0;
+
+ tcgetattr(fd, &oterm);
+
+ memcpy(&term, &oterm, sizeof(term));
+
+ term.c_lflag = term.c_lflag & (!ICANON);
+
+ term.c_cc[VMIN] = 0;
+
+ term.c_cc[VTIME] = 1;
+
+ tcsetattr(fd, TCSANOW, &term);
+
+ c = getchar();
+
+ tcsetattr(fd, TCSANOW, &oterm);
+
+ if (c != -1)
+ ungetc(c, stdin);
+
+ return ((c != -1) ? 1 : 0);
+}
+
+int getch()
+{
+ static int ch = -1, fd = 0;
+
+ struct termios neu, alt;
+
+ fd = fileno(stdin);
+
+ tcgetattr(fd, &alt);
+
+ neu = alt;
+
+ neu.c_lflag &= ~(ICANON|ECHO);
+
+ tcsetattr(fd, TCSANOW, &neu);
+
+ ch = getchar();
+
+ tcsetattr(fd, TCSANOW, &alt);
+
+ return ch;
+
+}
+
+#endif //WIN32
diff --git a/tools/udp_debug_reader/source/Input.h b/tools/udp_debug_reader/source/Input.h
new file mode 100644
index 0000000..506e2b3
--- /dev/null
+++ b/tools/udp_debug_reader/source/Input.h
@@ -0,0 +1,48 @@
+/****************************************************************************
+ * Copyright (C) 2010-2012
+ * by Dimok
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any
+ * damages arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any
+ * purpose, including commercial applications, and to alter it and
+ * redistribute it freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you
+ * must not claim that you wrote the original software. If you use
+ * this software in a product, an acknowledgment in the product
+ * documentation would be appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and
+ * must not be misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ * distribution.
+ ***************************************************************************/
+#ifndef ___INPUT_H_
+#define ___INPUT_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef WIN32
+ #include
+ #define CLEAR "cls"
+#else
+ #include
+ #define CLEAR "clear"
+
+ int kbhit(void);
+ int getch();
+#endif
+
+extern FILE * logFile;
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/tools/udp_debug_reader/source/main.c b/tools/udp_debug_reader/source/main.c
new file mode 100644
index 0000000..545b404
--- /dev/null
+++ b/tools/udp_debug_reader/source/main.c
@@ -0,0 +1,81 @@
+/****************************************************************************
+ * Copyright (C) 2010-2012
+ * by Dimok
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any
+ * damages arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any
+ * purpose, including commercial applications, and to alter it and
+ * redistribute it freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you
+ * must not claim that you wrote the original software. If you use
+ * this software in a product, an acknowledgment in the product
+ * documentation would be appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and
+ * must not be misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ * distribution.
+ *****************************************************d**********************/
+#include
+#include
+#include
+#include
+#include "Input.h"
+#include "network.h"
+
+int main(int argc, char *argv[])
+{
+ char inputChar = 0;
+
+ if(NetInit() < 0)
+ {
+ printf("Can't open socket.\n");
+ usleep(999999);
+ usleep(999999);
+ return 0;
+ }
+
+ if(Bind() < 0)
+ {
+ printf("Can't bind socket.\n");
+ usleep(999999);
+ usleep(999999);
+ return 0;
+ }
+
+ printf("UdpDebugReader by Dimok\n");
+ printf("q = quit\n");
+ printf("f = start/stop writing log to file\n");
+ printf("c = clear console\n");
+
+ int ret;
+ char data[RECEIVE_BLOCK_SIZE+1];
+ memset(data, 0, sizeof(data));
+
+ while(inputChar != 'q')
+ {
+ inputChar = CheckInput();
+
+ ret = NetRead(data, RECEIVE_BLOCK_SIZE);
+ if(ret > 0)
+ {
+ data[ret] = '\0';
+
+ printf("%s", data);
+ if(logFile)
+ fwrite(data, 1, ret, logFile);
+ }
+ }
+
+ if(logFile)
+ fclose(logFile);
+
+ CloseSocket();
+
+ return 0;
+}
diff --git a/tools/udp_debug_reader/source/network.c b/tools/udp_debug_reader/source/network.c
new file mode 100644
index 0000000..b62ed28
--- /dev/null
+++ b/tools/udp_debug_reader/source/network.c
@@ -0,0 +1,107 @@
+/****************************************************************************
+ * Copyright (C) 2010-2012
+ * by Dimok
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any
+ * damages arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any
+ * purpose, including commercial applications, and to alter it and
+ * redistribute it freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you
+ * must not claim that you wrote the original software. If you use
+ * this software in a product, an acknowledgment in the product
+ * documentation would be appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and
+ * must not be misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ * distribution.
+ ***************************************************************************/
+#include
+#include
+#include
+#include
+#include
+#include "network.h" // Include Winsock Library
+
+static int sock_id = -1;
+static struct sockaddr_in servaddr;
+
+int Bind()
+{
+ memset(&servaddr,0,sizeof(servaddr));
+
+ servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
+ servaddr.sin_port = htons(LISTEN_PORT);
+ servaddr.sin_family = AF_INET;
+
+ if (bind(sock_id, (struct sockaddr*)&servaddr, sizeof(servaddr)) < 0)
+ {
+ close(sock_id);
+ return -1;
+ }
+
+ return 0;
+}
+
+void CloseSocket()
+{
+ if(sock_id < 0)
+ return;
+
+ close(sock_id);
+ sock_id = -1;
+}
+
+int NetInit()
+{
+ if(sock_id >= 0)
+ return sock_id;
+
+#ifdef WIN32
+ WSADATA wsaData;
+
+ // Initialize Winsock
+ if (WSAStartup(MAKEWORD(2,2), &wsaData) == SOCKET_ERROR)
+ return -1;
+#endif
+ //Get a socket
+ if((sock_id = socket(AF_INET, SOCK_DGRAM, IPPROTO_IP)) == -1)
+ return -1;
+
+#ifdef WIN32
+ u_long mode = 1;
+ ioctlsocket(sock_id, FIONBIO, &mode);
+#else
+ int flags = fcntl(sock_id, F_GETFL, 0);
+ fcntl(sock_id, F_SETFL, flags | O_NONBLOCK);
+#endif
+
+ return sock_id;
+}
+
+int NetRead(void *buffer, unsigned int buf_len)
+{
+ if(sock_id < 0)
+ return sock_id;
+
+ fd_set fdsRead;
+ FD_ZERO(&fdsRead);
+ FD_SET(sock_id, &fdsRead);
+
+ struct timeval tv;
+ tv.tv_sec = 0;
+ tv.tv_usec = 10000;
+
+ if(select(sock_id + 1, &fdsRead, NULL, NULL, &tv) != 1) {
+ return 0;
+ }
+
+ int len = sizeof(servaddr);
+
+ return recvfrom(sock_id,buffer, buf_len, 0,(struct sockaddr *)&servaddr, &len);
+}
diff --git a/tools/udp_debug_reader/source/network.h b/tools/udp_debug_reader/source/network.h
new file mode 100644
index 0000000..71f167c
--- /dev/null
+++ b/tools/udp_debug_reader/source/network.h
@@ -0,0 +1,52 @@
+/****************************************************************************
+ * Copyright (C) 2010-2012
+ * by Dimok
+ *
+ * This software is provided 'as-is', without any express or implied
+ * warranty. In no event will the authors be held liable for any
+ * damages arising from the use of this software.
+ *
+ * Permission is granted to anyone to use this software for any
+ * purpose, including commercial applications, and to alter it and
+ * redistribute it freely, subject to the following restrictions:
+ *
+ * 1. The origin of this software must not be misrepresented; you
+ * must not claim that you wrote the original software. If you use
+ * this software in a product, an acknowledgment in the product
+ * documentation would be appreciated but is not required.
+ *
+ * 2. Altered source versions must be plainly marked as such, and
+ * must not be misrepresented as being the original software.
+ *
+ * 3. This notice may not be removed or altered from any source
+ * distribution.
+ ***************************************************************************/
+#ifndef __NETWORK_H_
+#define __NETWORK_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef WIN32
+ #include "winsock/winsock.h" // Include Winsock Library
+#else
+ #include
+ #include
+ #include
+ #include
+#endif
+
+#define RECEIVE_BLOCK_SIZE 4096
+#define LISTEN_PORT 4405
+
+int NetInit();
+int Bind();
+void CloseSocket();
+int NetRead(void *buffer, unsigned int buf_len);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/tools/udp_debug_reader/source/winsock/libwsock32.a b/tools/udp_debug_reader/source/winsock/libwsock32.a
new file mode 100644
index 0000000..a38764c
Binary files /dev/null and b/tools/udp_debug_reader/source/winsock/libwsock32.a differ
diff --git a/tools/udp_debug_reader/source/winsock/winsock.h b/tools/udp_debug_reader/source/winsock/winsock.h
new file mode 100644
index 0000000..b595b59
--- /dev/null
+++ b/tools/udp_debug_reader/source/winsock/winsock.h
@@ -0,0 +1,536 @@
+/*
+
+ Definitions for winsock 1.1
+
+ Portions Copyright (c) 1980, 1983, 1988, 1993
+ The Regents of the University of California. All rights reserved.
+
+ Portions Copyright (c) 1993 by Digital Equipment Corporation.
+ */
+
+#ifndef _WINSOCK_H
+#define _WINSOCK_H
+#if __GNUC__ >=3
+#pragma GCC system_header
+#endif
+
+#define _GNU_H_WINDOWS32_SOCKETS
+
+#include
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if !defined ( _BSDTYPES_DEFINED )
+/* also defined in gmon.h and in cygwin's sys/types */
+typedef unsigned char u_char;
+typedef unsigned short u_short;
+typedef unsigned int u_int;
+typedef unsigned long u_long;
+#define _BSDTYPES_DEFINED
+#endif /* !defined _BSDTYPES_DEFINED */
+typedef u_int SOCKET;
+#ifndef FD_SETSIZE
+#define FD_SETSIZE 64
+#endif
+
+/* shutdown() how types */
+#define SD_RECEIVE 0x00
+#define SD_SEND 0x01
+#define SD_BOTH 0x02
+
+#ifndef _SYS_TYPES_FD_SET
+/* fd_set may have be defined by the newlib