#include "ieee802_3.h" static const ieee802_3_mac_addr Addr; static const ethernet2_frame Frame; static size_t parse(char *, size_t, parse_frame *, const parse_status *); static size_t dump(const parse_frame *, int, FILE *); static const void * ieee802_3_addr_from(const parse_frame *); static const void * ieee802_3_addr_to (const parse_frame *); static int test_logical(const char *, size_t, const parse_status *); static const prot_parent Test[] = { { PROT_LOGICAL, test_logical } }; const prot_iface Iface_IEEE802_3 = { DINIT(id, PROT_IEEE802_3), DINIT(osi, OSI_Link), DINIT(shortname, "802.3"), DINIT(propername, "IEEE 802.3"), DINIT(init, NULL), DINIT(unload, NULL), DINIT(parse, parse), DINIT(dump, dump), DINIT(addr_type, "M"), DINIT(addr_from, ieee802_3_addr_from), DINIT(addr_to, ieee802_3_addr_to), DINIT(addr_format, ieee802_3_addr_format), DINIT(addr_local, ieee802_3_addr_local), DINIT(parents, sizeof Test / sizeof Test[0]), DINIT(parent, Test) };
#include "ipv4.h" #include "tivoconn.h" static size_t parse(char *, size_t, parse_frame *, const parse_status *); static size_t dump(const parse_frame *, int options, FILE *); static int test_udp(const char *, size_t, const parse_status *); static const prot_parent Test[] = { { PROT_UDP, test_udp } }; /** * exported interface */ const prot_iface Iface_TiVoConn = { DINIT(id, PROT_TIVOCONN), DINIT(osi, OSI_Trans), DINIT(shortname, "TiVoConn"), DINIT(propername, "TiVoConnect Discovery Protocol"), DINIT(init, NULL), DINIT(unload, NULL), DINIT(parse, parse), DINIT(dump, dump), DINIT(addr_type, NULL), DINIT(addr_from, NULL), DINIT(addr_to, NULL), DINIT(addr_format, NULL), DINIT(addr_local, NULL), DINIT(parents, sizeof Test / sizeof Test[0]), DINIT(parent, Test) };
static size_t dump(const parse_frame *, int options, FILE *); static int test_udp_port(const char *, size_t, const parse_status *); static int test_ipv4_addr(const char *, size_t, const parse_status *); static int test_ipv6_addr(const char *, size_t, const parse_status *); static const prot_parent Test[] = { { PROT_UDP, test_udp_port }, { PROT_IPv4, test_ipv4_addr }, { PROT_IPv6, test_ipv6_addr } }; /** * exported interface */ const prot_iface Iface_WSDD = { DINIT(id, PROT_WSDD), DINIT(osi, OSI_App), DINIT(shortname, "WSDD"), DINIT(propername, "Web Service Dynamic Discovery"), DINIT(init, NULL), DINIT(unload, NULL), DINIT(parse, parse), DINIT(dump, dump), DINIT(addr_type, NULL), DINIT(addr_from, NULL), DINIT(addr_to, NULL), DINIT(addr_format, NULL), DINIT(addr_local, NULL), DINIT(parents, sizeof Test / sizeof Test[0]), DINIT(parent, Test) };
#include "udp.h" #include "mcafee-rumor.h" static size_t parse(char *, size_t, parse_frame *, const parse_status *); static size_t dump(const parse_frame *, int options, FILE *); static int test_udp(const char *, size_t, const parse_status *); static const prot_parent Test[] = { { PROT_UDP, test_udp } }; /** * exported interface */ const prot_iface Iface_McAfeeRumor = { DINIT(id, PROT_UDP), DINIT(osi, OSI_Trans), DINIT(shortname, "Rumor"), DINIT(propername, "McAfee Rumor"), DINIT(init, NULL), DINIT(unload, NULL), DINIT(parse, parse), DINIT(dump, dump), DINIT(addr_type, NULL), DINIT(addr_from, NULL), DINIT(addr_to, NULL), DINIT(addr_format, NULL), DINIT(addr_local, NULL), DINIT(parents, sizeof Test / sizeof Test[0]), DINIT(parent, Test) };
size_t smb_dump (const parse_frame *, int options, FILE *); static int test_nbdgm (const char *, size_t, const parse_status *); static int test_netbios(const char *, size_t, const parse_status *); static int test_tcp (const char *, size_t, const parse_status *); static const prot_parent Test[] = { { PROT_NBDGM, test_nbdgm }, { PROT_NetBIOS, test_netbios }, { PROT_TCP, test_tcp } }; /** * exported interface */ const prot_iface Iface_SMB = { DINIT(id, PROT_SMB), DINIT(osi, OSI_App), DINIT(shortname, "SMB"), DINIT(propername, "Server Message Block"), DINIT(init, smb_init), DINIT(unload, NULL), DINIT(parse, smb_parse), DINIT(dump, smb_dump), DINIT(addr_type, NULL), DINIT(addr_from, NULL), DINIT(addr_to, NULL), DINIT(addr_format, NULL), DINIT(addr_local, NULL), DINIT(parents, sizeof Test / sizeof Test[0]), DINIT(parent, Test) };
#include "rtsp.h" static int init (void); static size_t parse(char *, size_t, parse_frame *, const parse_status *); static size_t dump (const parse_frame *, int options, FILE *); static int test_udp_port(const char *, size_t, const parse_status *); static const prot_parent Test[] = { { PROT_UDP, test_udp_port } }; /** * exported interface */ const prot_iface Iface_RTSP = { DINIT(id, PROT_RTSP), DINIT(osi, OSI_App), DINIT(shortname, "RTSP"), DINIT(propername, "Real Time Streaming Protocol"), DINIT(init, init), DINIT(unload, NULL), DINIT(parse, parse), DINIT(dump, dump), DINIT(addr_type, NULL), DINIT(addr_from, NULL), DINIT(addr_to, NULL), DINIT(addr_format, NULL), DINIT(addr_local, NULL), DINIT(parents, sizeof Test / sizeof Test[0]), DINIT(parent, Test) };
static size_t dump (const parse_frame *, int options, FILE *); static int test_ports (const char *, size_t, const parse_status *); static int test_header (const char *, size_t, const parse_status *); static int test_bin_huer(const char *, size_t, const parse_status *); static const prot_parent Test[] = { { PROT_TCP, test_ports }, { PROT_TCP, test_header }, { PROT_TCP, test_bin_huer } }; /** * exported interface */ const prot_iface Iface_Gnutella = { DINIT(id, PROT_GNUTELLA), DINIT(osi, OSI_App), DINIT(shortname, "Gnutella"), DINIT(propername, "Gnutella"), DINIT(init, init), DINIT(unload, NULL), DINIT(parse, parse), DINIT(dump, dump), DINIT(addr_type, NULL), DINIT(addr_from, NULL), DINIT(addr_to, NULL), DINIT(addr_format, NULL), DINIT(addr_local, NULL), DINIT(parents, sizeof Test / sizeof Test[0]), DINIT(parent, Test) };
#include "smb.h" #include "browse.h" static size_t parse(char *, size_t, parse_frame *, const parse_status *); static size_t dump(const parse_frame *, int options, FILE *); static int test_smb(const char *, size_t, const parse_status *); static const prot_parent Test[] = { { PROT_SMB, test_smb } }; /** * exported interface */ const prot_iface Iface_BROWSE = { DINIT(id, PROT_BROWSE), DINIT(osi, OSI_App), DINIT(shortname, "BROWSE"), DINIT(propername, "Microsoft Browser Protocol"), DINIT(init, NULL), DINIT(unload, NULL), DINIT(parse, parse), DINIT(dump, dump), DINIT(addr_type, NULL), DINIT(addr_from, NULL), DINIT(addr_to, NULL), DINIT(addr_format, NULL), DINIT(addr_local, NULL), DINIT(parents, sizeof Test / sizeof Test[0]), DINIT(parent, Test) };
int main(int argc, char **argv){ char ElfPath[32]; DINIT(); DPRINTF("OPL EE core start!\n"); SifInitRpc(0); int i = 0; if (!_strncmp(argv[i], "USB_MODE", 8)) GameMode = USB_MODE; else if (!_strncmp(argv[i], "ETH_MODE", 8)) GameMode = ETH_MODE; else if (!_strncmp(argv[i], "HDD_MODE", 8)) GameMode = HDD_MODE; DPRINTF("Game Mode = %d\n", GameMode); DisableDebug = 0; if (!_strncmp(&argv[i][9], "1", 1)) { DisableDebug = 1; DPRINTF("Debug Colors disabled\n"); } PS2Logo = 0; if (!_strncmp(&argv[i][11], "1", 1)) { PS2Logo = 1; DPRINTF("PS2 Logo enabled\n"); } char *p = _strtok(&argv[i][13], " "); if (!_strncmp(p, "Browser", 7)) ExitPath[0] = '\0'; else _strcpy(ExitPath, p); DPRINTF("Exit Path = (%s)\n", ExitPath); p = _strtok(NULL, " "); HDDSpindown = _strtoui(p); DPRINTF("HDD Spindown = %d\n", HDDSpindown); p = _strtok(NULL, " "); _strcpy(g_ps2_ip, p); p = _strtok(NULL, " "); _strcpy(g_ps2_netmask, p); p = _strtok(NULL, " "); _strcpy(g_ps2_gateway, p); g_ps2_ETHOpMode=_strtoui(_strtok(NULL, " ")); DPRINTF("IP=%s NM=%s GW=%s mode: %d\n", g_ps2_ip, g_ps2_netmask, g_ps2_gateway, g_ps2_ETHOpMode); #ifdef CHEAT EnableCheatOp = (gCheatList = (void*)_strtoui(_strtok(NULL, " "))) != NULL; DPRINTF("PS2RD Cheat Engine = %s\n", EnableCheatOp==0?"Disabled":"Enabled"); #endif #ifdef GSM EnableGSMOp = _strtoi(_strtok(NULL, " ")); DPRINTF("GSM = %s\n", EnableGSMOp==0?"Disabled":"Enabled"); #endif i++; ModStorageStart = (void*)_strtoui(_strtok(argv[i], " ")); ModStorageEnd = (void*)_strtoui(_strtok(NULL, " ")); i++; argv[i][11]=0x00; // fix for 8+3 filename. _strcpy(ElfPath, "cdrom0:\\"); _strcat(ElfPath, argv[i]); _strcat(ElfPath, ";1"); strncpy(GameID, argv[i], sizeof(GameID) - 1); GameID[sizeof(GameID) - 1] = '\0'; DPRINTF("Elf path = '%s'\n", ElfPath); DPRINTF("Game ID = '%s'\n", GameID); i++; // bitmask of the compat. settings g_compat_mask = _strtoui(argv[i]); DPRINTF("Compat Mask = 0x%02x\n", g_compat_mask); i++; #ifdef CHEAT if(EnableCheatOp){ EnableCheats(); } #endif #ifdef GSM if(EnableGSMOp){ u32 interlace, mode, ffmd, dx_offset, dy_offset, skip_videos_fix; u64 display, syncv, smode2; interlace=_strtoui(_strtok(argv[i], " ")); mode=_strtoui(_strtok(NULL, " ")); ffmd=_strtoui(_strtok(NULL, " ")); display=_strtoul(_strtok(NULL, " ")); syncv=_strtoul(_strtok(NULL, " ")); smode2=_strtoui(_strtok(NULL, " ")); dx_offset=_strtoui(_strtok(NULL, " ")); dy_offset=_strtoui(_strtok(NULL, " ")); skip_videos_fix=_strtoui(_strtok(NULL, " ")); UpdateGSMParams(interlace, mode, ffmd, display, syncv, smode2, dx_offset, dy_offset, skip_videos_fix); EnableGSM(); } #endif set_ipconfig(); /* installing kernel hooks */ DPRINTF("Installing Kernel Hooks...\n"); Install_Kernel_Hooks(); if(!DisableDebug) GS_BGCOLOUR = 0xff0000; //Blue SifExitRpc(); DPRINTF("Executing '%s'...\n", ElfPath); //PS2LOGO Caller, based on l_oliveira & SP193 tips if (PS2Logo) { char *argvs[1]; argvs[0] = ElfPath; argvs[1] = NULL; LoadExecPS2("rom0:PS2LOGO", 1, argvs); } else { LoadExecPS2(ElfPath, 0, NULL); } if(!DisableDebug) GS_BGCOLOUR = 0x0000ff; //Red DPRINTF("LoadExecPS2 failed!\n"); SleepThread(); return 0; }
static int init (void); static size_t dump (const parse_frame *, int options, FILE *); static int test_udp(const char *, size_t, const parse_status *); static int test_mdns(const char *, size_t, const parse_status *); static const prot_parent Test[] = { { PROT_UDP, test_udp }, { PROT_UDP, test_mdns } }; /** * exported interface */ const prot_iface Iface_DNS = { DINIT(id, PROT_DNS), DINIT(osi, OSI_App), DINIT(shortname, "DNS"), DINIT(propername, "Domain Name System"), DINIT(init, init), DINIT(unload, NULL), DINIT(parse, dns_parse), DINIT(dump, dump), DINIT(addr_type, NULL), DINIT(addr_from, NULL), DINIT(addr_to, NULL), DINIT(addr_format, NULL), DINIT(addr_local, NULL), DINIT(parents, sizeof Test / sizeof Test[0]), DINIT(parent, Test) };
#include "tcp-fingerprint.h" int tcp_init(void); size_t tcp_parse(char *, size_t, parse_frame *, const parse_status *); size_t tcp_dump(const parse_frame *, int options, FILE *); static int test_ipv4(const char *, size_t, const parse_status *); static const prot_parent Test[] = { { PROT_IPv4, test_ipv4 } }; /** * exported interface */ const prot_iface Iface_TCP = { DINIT(id, PROT_TCP), DINIT(osi, OSI_Trans), DINIT(shortname, "TCP"), DINIT(propername, "Transmission Control Protocol"), DINIT(init, tcp_init), DINIT(unload, NULL), DINIT(parse, tcp_parse), DINIT(dump, tcp_dump), DINIT(addr_type, NULL), DINIT(addr_from, NULL), DINIT(addr_to, NULL), DINIT(addr_format, NULL), DINIT(addr_local, NULL), DINIT(parents, sizeof Test / sizeof Test[0]), DINIT(parent, Test) };
static size_t _http_dump (const parse_frame *, int opt, FILE *); static int test_tcp_port(const char *, size_t, const parse_status *); static int test_reqhead(const char *, size_t, const parse_status *); static int test_resphead(const char *, size_t, const parse_status *); static const prot_parent Test[] = { { PROT_TCP, test_tcp_port }, { PROT_TCP, test_reqhead }, { PROT_TCP, test_resphead } }; /** * exported interface */ const prot_iface Iface_HTTP = { DINIT(id, PROT_HTTP), DINIT(osi, OSI_App), DINIT(shortname, "HTTP"), DINIT(propername, "HyperText Transmission Protocol"), DINIT(init, NULL), DINIT(unload, NULL), DINIT(parse, _http_parse), DINIT(dump, _http_dump), DINIT(addr_type, NULL), DINIT(addr_from, NULL), DINIT(addr_to, NULL), DINIT(addr_format, NULL), DINIT(addr_local, NULL), DINIT(parents, sizeof Test / sizeof Test[0]), DINIT(parent, Test) };
#include "ieee802_3.h" /* for reporting */ #include "cdp.h" static size_t parse(char *, size_t, parse_frame *, const parse_status *); static size_t dump(const parse_frame *, int options, FILE *); static int test_llc(const char *, size_t, const parse_status *); static const prot_parent Test[] = { { PROT_LLC, test_llc } }; /** * exported interface */ const prot_iface Iface_CDP = { DINIT(id, PROT_CDP), DINIT(osi, OSI_Link), DINIT(shortname, "CDP"), DINIT(propername, "Cisco Discovery Protocol"), DINIT(init, NULL), DINIT(unload, NULL), DINIT(parse, parse), DINIT(dump, dump), DINIT(addr_type, NULL), DINIT(addr_from, NULL), DINIT(addr_to, NULL), DINIT(addr_format, NULL), DINIT(addr_local, NULL), DINIT(parents, sizeof Test / sizeof Test[0]), DINIT(parent, Test) };
static size_t parse(char *, size_t, parse_frame *, const parse_status *); static size_t dump(const parse_frame *, int options, FILE *); static int test_tcp_port(const char *, size_t, const parse_status *); static int test_contents(const char *, size_t, const parse_status *); static const prot_parent Test[] = { { PROT_TCP, test_tcp_port }, { PROT_TCP, test_contents } }; /** * exported interface */ const prot_iface Iface_DCERPC = { DINIT(id, PROT_DCERPC), DINIT(osi, OSI_App), DINIT(shortname, "DCERPC"), DINIT(propername, "DCERPC"), DINIT(init, NULL), DINIT(unload, NULL), DINIT(parse, parse), DINIT(dump, dump), DINIT(addr_type, NULL), DINIT(addr_from, NULL), DINIT(addr_to, NULL), DINIT(addr_format, NULL), DINIT(addr_local, NULL), DINIT(parents, sizeof Test / sizeof Test[0]), DINIT(parent, Test) };
#include "rasadv.h" static int init (void); static size_t parse(char *, size_t, parse_frame *, const parse_status *); static size_t dump (const parse_frame *, int options, FILE *); static int test_udp(const char *, size_t, const parse_status *); static const prot_parent Test[] = { { PROT_UDP, test_udp } }; /** * exported interface */ const prot_iface Iface_RASADV = { DINIT(id, PROT_RASADV), DINIT(osi, OSI_App), DINIT(shortname, "RASADV"), DINIT(propername, "Routing and Remote Access Server Advertisement"), DINIT(init, init), DINIT(unload, NULL), DINIT(parse, parse), DINIT(dump, dump), DINIT(addr_type, NULL), DINIT(addr_from, NULL), DINIT(addr_to, NULL), DINIT(addr_format, NULL), DINIT(addr_local, NULL), DINIT(parents, sizeof Test / sizeof Test[0]), DINIT(parent, Test) };