Skip to content

Instantly share code, notes, and snippets.

View HeicoDev's full-sized avatar

Aniroh HeicoDev

View GitHub Profile
@HeicoDev
HeicoDev / fbone_txtcon.py
Last active July 8, 2021 11:48
A Python script to convert textures and heightmaps of the Frostbite 1 engine. Requires Python 3.6.9!
import sys
import os
import os.path
import time
import shutil
## Frostbite 1 Texture Converter by Heico
## Requires Python 3.6.9! Other versions may not work.
## Use command line or drag n drop file onto the script to convert
## Supported file formats: .dds .itexture .ps3texture .xenontexture .terrainheightfield
@HeicoDev
HeicoDev / TheaterBackendSniffer.cs
Last active August 21, 2020 02:02
A small console application that can connect to the Theater backend of BFBC2 and obtain information like the server list.
using System;
using System.IO;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
namespace TheaterBackendSniffer
{
class Program
{
@HeicoDev
HeicoDev / dbx.py
Created August 1, 2020 09:12
A Python script that is able to convert dbx files that are used by the Frostbite 1 engine. Created by Frankelstner.
###############################
# Created by Frankelstner #
###############################
##Requires Python 2.7. Rename to .py and drag and drop files onto the script to convert from dbx to xml and vice versa.
##Python does not have single precision floats. The struct module allows retrieving either single or double precision floats,
##but eventually the numbers are treated as doubles anyway. Python then tries to find the shortest string representation
##for the number. Now, this is the shortest representation for DOUBLES, so for singles there are more digits than necessary.
##There are two options, either accept the cumbersome representation, e.g. 0.949999988079 instead of 0.95, or download the
@HeicoDev
HeicoDev / tex_frostbite1_x360.py
Last active June 18, 2020 18:36
A Python plugin for Noesis that is able to convert encoded and swizzled xenontexture files that are used by the Frostbite 1 engine. Created by Acewell.
###############################
# Created by Acewell #
###############################
# Edited by Heico #
###############################
from inc_noesis import *
def registerNoesisTypes():
handle = noesis.register("Frostbite 1 [X360]", ".xenontexture")
@HeicoDev
HeicoDev / fbrb.py
Created June 16, 2020 23:10
A Python script for extracting and archiving fbrb archives that are used by the Frostbite 1 engine. Created by Frankelstner.
###############################
# Created by Frankelstner #
###############################
# Edited by Heico #
###############################
from struct import pack,unpack
import gzip
from cStringIO import StringIO
import sys
static void Main(string[] args)
{
/* C# code snippet to calculate the mipmap sizes for the BFBC2 textures, by Heico */
/* In this case we use a DXT1 texture with a resolution of 512 * 512 and 9 mipmaps */
/* For DXT2-5 textures the code must be slightly edited, see Microsoft Docs below */
//Read the integers below from file
int mipmapCount = 9;
int width = 512;
int height = 512;