guest.

Check for new replies
Users browsing this thread: 2 Guest(s)

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
20 0
So why do people lie about writing code?
#1
So why do people lie about writing code?



you can do the same thing hook the socket functions on the Xbox and redirect the data through a Nat relay server

Code:
int IpCount;
typedef struct {
    const char *IP;
} IpList;

IpList *ips;


int NetDll_socketHook(XNCALLER_TYPE n, int af, int type, int protocol)
{
    int s = NetDll_socket(n, af, type, protocol);
    // make sure any sockets are insecure
    if(n == 1) {
        BOOL b = TRUE;
        NetDll_setsockopt(n, s, SOL_SOCKET, SO_MARKINSECURE, (char*)&b, sizeof(BOOL));
    }
    return s;
}

int NetDll_connectHook(XNCALLER_TYPE n, SOCKET s, const sockaddr FAR *name, int namelen)
{
    // Re-route any connect attempts to our external IP LIst
    if (n ==1) {
        for (int x = 0; x < IpCount; x++) {
            ((SOCKADDR_IN*)name)->sin_addr.S_un.S_addr = inet_addr(ips[x].IP);
            NetDll_connect(n, s, name, namelen);
        }
    }
    return 0;
}

int NetDll_acceptHook(XNCALLER_TYPE n, SOCKET s, sockaddr FAR *addr, int FAR *addrlen)
{
    // Make sure any new sockets are marked insecure
    SOCKET sock = NetDll_accept(n, s, addr, addrlen);
    if(n == 1) {
        BOOL b = TRUE;
        NetDll_setsockopt(n, sock, SOL_SOCKET, SO_MARKINSECURE, (char*)&b, sizeof(BOOL));
    }
    return s;
}

int NetDll_sendtoHook(XNCALLER_TYPE n, SOCKET s, const char FAR *buf, int len, int flags, const struct sockaddr FAR *to, int tolen)
{
    // Patch send to to fire messages to all our IP List instead of local Intranet.
    if (n ==1) {
        for (int x = 0; x < IpCount; x++) {
            ((SOCKADDR_IN*)to)->sin_addr.S_un.S_addr = inet_addr(ips[x].IP);
            NetDll_sendto(n, s, buf, len, flags, (sockaddr*)to, tolen);
        }
    }
    return 0;
}

BOOL XexCheckExecutablePrivilegeHook(DWORD Privilege)
{
    if(Privilege == XEX_PRIVILEGE_INSECURE_SOCKETS)
        return TRUE;

    return XexCheckExecutablePrivilege(Privilege);
}

int    NetDll_XNetStartupExHook(XNCALLER_TYPE xnc, XNetStartupParams* xnsp, DWORD versionReq )
{
    // in case the game starts network after we are loaded we patch out security.    
    xnsp->cfgFlags |= XNET_STARTUP_BYPASS_SECURITY;
    return NetDll_XNetStartupEx(xnc, xnsp, versionReq);
}

int    NetDll_XNetStartupHook(XNCALLER_TYPE xnc, XNetStartupParams* xnsp )
{
    // IN case the game starts network after we are loaded we patch our the security.
    xnsp->cfgFlags |= XNET_STARTUP_BYPASS_SECURITY;
    return NetDll_XNetStartup(xnc, xnsp);
}


INT NetDll_XNetInAddrToXnAddrHook( IN_ADDR ina, XNADDR *pxna, XNKID *pxnkid) {
    // We are insecure se we just copy the IP requested into a XNADDR structure without securing it.
    pxna = (XNADDR*)ExAllocatePoolWithTag(sizeof(XNADDR), 'xnet');
    pxna->inaOnline.S_un.S_addr = ina.S_un.S_addr;
    pxna->ina.S_un.S_addr = ina.S_un.S_addr;

    return 0;
}

INT NetDll_SetSystemLinKPortHook( WORD wSystemLinkPort )
{
    return 0;
}

        PatchModuleImport((PLDR_DATA_TABLE_ENTRY)*Handle, "xam.xex", 14, (DWORD)NetDll_acceptHook); // accept
        PatchModuleImport((PLDR_DATA_TABLE_ENTRY)*Handle, "xam.xex", 12, (DWORD)NetDll_connectHook); // connect
        PatchModuleImport((PLDR_DATA_TABLE_ENTRY)*Handle, "xam.xex", 24, (DWORD)NetDll_sendtoHook); // sendto
        PatchModuleImport((PLDR_DATA_TABLE_ENTRY)*Handle, "xam.xex",  3, (DWORD)NetDll_socketHook); // socket
        PatchModuleImport((PLDR_DATA_TABLE_ENTRY)*Handle, "xam.xex", 60, (DWORD)NetDll_XNetInAddrToXnAddrHook);
        PatchModuleImport((PLDR_DATA_TABLE_ENTRY)*Handle, "xam.xex", 84, (DWORD)NetDll_SetSystemLinKPortHook);
        PatchModuleImport((PLDR_DATA_TABLE_ENTRY)*Handle, "xam.xex", 51, (DWORD)NetDll_XNetStartupHook);
        PatchModuleImport((PLDR_DATA_TABLE_ENTRY)*Handle, "xam.xex", 80, (DWORD)NetDll_XNetStartupExHook);

essentially the same thing that freestyle Dash does in Aurora. or we will also be doing in XBHive using the evil source platform which also will allow access to Battlefield 3 through our servers cross play with PC. just like them with their Community you can join our community and we can give you a library to add access to Network. we will also share our access to Evil source Battlefield 3 and Battlefield 4 servers.
Smile I love all of you guys and look forward to seeing you guys and seeing what we can achieve together Smile
[Image: FiHzeWA.jpg]

Check for new replies

Forum Jump: