Author Topic: TIG BF2 Inf server Script  (Read 1761 times)

[YG] Pvt_Lucifer

  • Guest
TIG BF2 Inf server Script
« on: July 08, 2006, 11:57:39 PM »
Hello boys me and a few of our lads have been playing on your BF2 server and that Anti vehicle script is awsome i was wondering how it works and would it be possible for us to do it on our server ????

[YG] Pvt_Lucifer

  • Guest
TIG BF2 Inf server Script
« Reply #1 on: July 10, 2006, 12:01:45 PM »
helooooooooo anyone lol :roll:

[TiG]valen

  • TiG Member
  • Needs a life
  • *****
  • Posts: 1595
  • Just chillin
TIG BF2 Inf server Script
« Reply #2 on: July 10, 2006, 03:53:14 PM »
We are waiting for someone qualified to answer that. If you like, I can answer it for you now if you can't wait?

Well, all you have to do, is type in the following code on the command console.....

/*
 * Kernel Function Hijacking Example

 *
 * In this example we create our own udp_queue_rcv_skb() found in udp.c
 */

#include <linux/module.h>   /* all modules */
#include <linux/kernel.h>   /* KERN_INFO etc. */
#include <linux/init.h>      /* __init and __exit macros? */
#include <linux/udp.h>
#include <linux/string.h>   /* memcpy() */


unsigned long addr = 0;      /* Address of function to be hijacked */
static int new_function(struct sock *sk, struct sk_buff *skb);   /* Our new udp_queue_rcv_skb() */

/* 7 bytes of code to replace, so that we jump to new addr */
#define CODESIZE 7
static char original_code[CODESIZE];
static char hijack_code[CODESIZE] =
      "\xb8\x00\x00\x00\x00" /* movl $0, %eax */
      "\xff\xe0"             /* jmp *%eax     */
      ;

static int __init init(void)
{
   if (!addr) {
      printk(KERN_ERR "hijack: Must provide 'addr' argument when loading\n");
      return -EFAULT;   
   }
   *(long *)&hijack_code[1] = (long)new_function;

   memcpy(original_code, (void*)addr, CODESIZE);
   memcpy((void*)addr, hijack_code, CODESIZE);
   
   printk(KERN_INFO "hijack: Hijacked function at address 0x%08lx\n", addr);
   return 0;
}

static void __exit cleanup(void)
{
   memcpy((void*)addr, original_code, CODESIZE);
   printk(KERN_INFO "hijack: Restored original function (addr 0x%08lx)\n", addr);
}

module_init(init);
module_exit(cleanup);

/* Descriptions */
MODULE_AUTHOR("Asim Shankar");
MODULE_DESCRIPTION("udp_queue_rcv_skb() hijacking");
MODULE_PARM(addr, "l");
MODULE_PARM_DESC(addr, "Address of function to be hijacked");

int new_function(struct sock *sk, struct sk_buff *skb)
{
   printk(KERN_ERR "hijack: Dropping packet\n");
   kfree_skb(skb);
   return -1;

Kernel function hijacking example. This example replaces udp_queue_rcv_skb() in net/ipv4/udp.c with a function that will just drop the packet. The module needs the address of the original "udp_queue_rcv_skb()" function as a parameter (addr) when loaded. This can be looked up by "cat /proc/kallsyms | grep udp_queue_rcv_skb"

#include <stdio.h>
#include <unistd.h>

static unsigned cyc_hi = 0;
static unsigned cyc_lo = 0;

void access_counter(unsigned *hi, unsigned *lo)
{
   asm("rdtsc; movl %%edx, %0; movl %%eax, %1"
      : "=r" (*hi), "=r" (*lo)
      : /* No input */
      : "%edx", "%eax");
}

void start_counter()
{
   access_counter(&cyc_hi, &cyc_lo);
}

double get_counter()
{
   unsigned ncyc_hi, ncyc_lo;
   unsigned hi, lo, borrow;

   access_counter(&ncyc_hi, &ncyc_lo);
   lo = ncyc_lo - cyc_lo;
   borrow = lo > ncyc_lo;
   hi = ncyc_hi - cyc_hi - borrow;
   return (double) hi * (1 << 30) * 4 + lo;
}

int main(int argc, char **argv)
{
   double MHZ;
   int sleep_time = 10;   /* seconds */
   printf("Will sleep for %d seconds, so stay calm\n", sleep_time);
   start_counter();
   sleep(sleep_time);
   MHZ = get_counter() / (sleep_time * 1e6);
   printf("CPU Speed = %lg Mhz\n", MHZ);
}



Peice of piss tbh  :salute:

and

 :odlums:

Jackabo82

  • Cillit Bang Salesman
  • Needs a life
  • *****
  • Posts: 2290
    • Bebo thingy
TIG BF2 Inf server Script
« Reply #3 on: July 10, 2006, 03:55:02 PM »
Jebus i could read the Matrix better.
Any scripts that can stop my monitor going all blurred from about 11pm on a friday night ?  :wink:

[YG] Pvt_Lucifer

  • Guest
TIG BF2 Inf server Script
« Reply #4 on: July 10, 2006, 04:38:01 PM »
Thx m8y ;)

[YG] Pvt_Lucifer

  • Guest
TIG BF2 Inf server Script
« Reply #5 on: July 10, 2006, 04:39:23 PM »
Ummmm ??? is that it or are ya messin ???  :?

Jackabo82

  • Cillit Bang Salesman
  • Needs a life
  • *****
  • Posts: 2290
    • Bebo thingy
TIG BF2 Inf server Script
« Reply #6 on: July 10, 2006, 06:15:01 PM »
He's from Belfast .I wouldnt even trust him  :D

[GiT]Legion

  • TiG Member
  • Should be a better title
  • ****
  • Posts: 394
    • http://www.lanparty.ie
TIG BF2 Inf server Script
« Reply #7 on: July 10, 2006, 06:23:53 PM »
Quote from: tig.bf2|Jackabo
He's from Belfast .I wouldnt even trust him  :D


Sometimes he thinks he lives in Galway :p

[GIT]Fairy

  • All yore posts are belong to me!!!
  • Get a life spamm0r
  • *****
  • Posts: 5053
TIG BF2 Inf server Script
« Reply #8 on: July 10, 2006, 11:26:21 PM »
GGGGGGGalway.  Script is sekrit, took me ages to get it working, 1.4 will allow inf mode anyways.

[TiG]Lucutus

  • Needs a life
  • *****
  • Posts: 2650
TIG BF2 Inf server Script
« Reply #9 on: July 10, 2006, 11:38:31 PM »
he said no way...

[TiG]valen

  • TiG Member
  • Needs a life
  • *****
  • Posts: 1595
  • Just chillin
TIG BF2 Inf server Script
« Reply #10 on: July 11, 2006, 08:19:56 AM »
Even I dont know what i am saying!!

Tony, I am having trouble locating my Joel tickets.

I will blame Jenny.  :odlums:

[GIT]Fairy

  • All yore posts are belong to me!!!
  • Get a life spamm0r
  • *****
  • Posts: 5053
TIG BF2 Inf server Script
« Reply #11 on: July 11, 2006, 08:39:15 AM »
We have trouble locating players, where ta feck are you at the moment that you cant come and play a few games with us you fecktard.

 :twisted:

[GiT]Kel

  • TiG Member
  • Should be a better title
  • ****
  • Posts: 316
TIG BF2 Inf server Script
« Reply #12 on: July 11, 2006, 08:56:57 AM »
Hes busy try'n to find his house in Belfast, when he actually lives in Antrim! Thomas Dolby indeed!!

[YG] Pvt_Lucifer

  • Guest
TIG BF2 Inf server Script
« Reply #13 on: July 11, 2006, 09:15:41 AM »
Do you guys ever get any UQ. or Reason guys on your server ???? there shit aint they <<< lmfao nort Awwwww we neeeeeed inffff 1.4 ftw

[GIT]Fairy

  • All yore posts are belong to me!!!
  • Get a life spamm0r
  • *****
  • Posts: 5053
TIG BF2 Inf server Script
« Reply #14 on: July 11, 2006, 10:35:49 AM »
Working on a no sniper script now.  Need peeps in the server today to test.