You are not logged in.

#1 26 Oct 2006 8:58 am

MadHatter
Administrator
From: Dallas TX
Registered: Jun 2006
Posts: 529
Website

removing / stopping ads from the game

While personally I have no problems with having ads in the game, I did find this interesting.

copied and pasted from snotapius' blog http://www.derijk.org/blog/index.php?/a … tions.html


After some browsing and searching I came across a forum where they discuss the ads mechanism in Battlefield 2142. I have to warn you that the thread is pretty long (17 pages atm). In the thread a few people found a way to modify the cache files in such a way that you can display your own personal made ads. This is ofcourse for your own risk because EA can ban your account if they find out that you are blocking their extra income that way.

People have found out that there are quite a few ads in the various levels of Battlefield 2142. This is the count I found on the above mentioned forum:

Belgrade - 26
Camp Gibraltar - 12
Cerbere Landing - 14
Fall of Berlin - 30
Minsk - 17
Shuhia Taiba - 6
Sidi Power Plant - 6
Suez Canal - 13
Tunis Harbor - 6
Verdun - 26

In this document I will try to explain on what you should do to block the ads and insert your own ads/pictures. This is ofcourse at your own risk. All that is described here is already on the internet and has been found out by other people. I just made a short post about it.

  •   Block the adservers. In the demo players found out that there was a connection open to IGA. IGA servers can be in the following ranges: 72.3.184.144-72.3.184.159 and 72.32.5.0-72.32.5.15. This is ofcourse subject to change when alot of people start blocking ads. Adding those IP addresses now blocks the game from getting new ads. If you chose between a "drop packet" and "deny packet" you can better use the "deny packet" feature on your firewall because "drop packet" will give timeouts and therefor giving the game a delay by the size of that timeout. Setting it to "deny" will speed things up.
       
  • Download Python 2.5 at http://www.python.org/
       
  • copy the icontent.cache from <my documents>\battlefield 2142 to icontent.cache.original and to the python install folder (standard c:\python25).
       
  • open the python CMD and type the following followed by a return:

    Code:

          import sqlite3
    
          con = sqlite3.connect('icontent.cache')
          cur = con.cursor()
          cur.execute("select contentId, data from content")
          result = cur.fetchall()
          for row in result:
              d = row[1]
              cid = row[0]
              assert type(d) is buffer
              fh = open('bf2ad-img-' + str(cid) + '.dds', 'wb')
              fh.write(str(d))
              fh.close()

  • This last thing will export all the image files in that database (.dds files)
       
  • Download the NVidia DDS utils and needed plugins for you to start modifying the files. Be sure to keep the size and colordept the same.
       
  • name the files the same way as they were before editing, place them in the python folder (together with the icontent.cache)
       
  • Start the python CMD again and enter the following:

    Code:

          import sqlite3
          con = sqlite3.connect('icontent.cache')
          cur = con.cursor()
          cur.execute("select contentId from content")
          result = cur.fetchall()
          for row in result:
           try:
            cid = row[0]
            fh = open('bf2ad-img-' + str(cid)+'.dds', 'rb')
            d = fh.read()
            s = fh.tell()
            print "read %d bytes from file." % (s)
            fh.close()
            cur.execute("update content set data=? where contentId=?", (sqlite3.Binary(d),cid))
           except(IOError):
            continue
          con.commit()
          cur.close()
          con.close()

  • This will import the modified DDS files back into the icontent.cache. You can now copy the file back into the <my documents>\Battlefield 2142 folder.
       
  • Start the game and start a game (online or offline) to see if it works. If it didnt work you probably did something wrong with the colordepth or size of the files.


  • In case you dont want to use python you can also use a .NET application that has been written solely for this purpose. You can download the application here: http://micolous.id.au/projects/bf2142/. The application is currently in Alpha stages but by the reports I heard so far it works and the developer of the tool is actively working on it.

    I dont know if modifications like this will get you banned but at least they will work if you do a langame (with a cracked version of the game). If you want more information on the exact contents of the database I suggest you visit the above forum and read the entire thread about it.

    Update:

    To make a policy to block IGA traffic install the Support Tools from the Windows XP CD and run this command:
    ipseccmd -w REG -p "IGA-B-Gone" -r "Block Outbound connections to IGA server network 72.3.184.144/28" -f 0=72.3.184.144/255.255.255.240::TCP -n BLOCK -x
    ipseccmd -w REG -p "IGA-B-Gone" -r "Block Outbound connections to IGA server network 72.32.5.0/28" -f 0=72.32.5.0/255.255.255.240::TCP -n BLOCK -x

    Offline

     



    © 2003 - 2019 NullFX
    Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License