[TUTORIAL] Pef Files Edit - How to edit some attributes

Results 1 to 4 of 4
  1. #1
    Registered ericksousa2435 is offline
    Aug 2014 Join Date

    smile [TUTORIAL] Pef Files Edit - How to edit some attributes

    *I'm here to share this for free with all of you. Here is the tutorial.*

    You gonna need 3 archives:
    Notepad++ 32Bits (https://notepad-plus-plus.org/download/v7.5.8.html)
    Hex Editor Extension (Download Notepad++ Plugins from SourceForge.net)
    Pef Decryptor (You can find here http://forum.ragezone.com/f904/relea...i3pack-1153057)
    Some Hex Calculator.

    How to add this plugin to notepad++:
    1 - Go to notepad++ folder.
    2 - Extract the DLL into plugins folder.

    1 - Extract the file Weapon.pef from Script.i3pack.
    2 - Decrypt this PEF using PEF Decryptor.
    3 - After this, you can see a new file (Weapon.pef.dec). Open this using Notepad++.
    4 - Now click on Plugins > HEX-Editor > View in Hex. (see this image https://i.imgur.com/zt5vfkf.png).
    5 - Now you need to find the weapon you want to edit, lets edit (K-1). You need to put (TRN3) on the name, so lets search for (K-1TRN3).

    6 - Now lets look for something to edit, lets suppose you wanna edit the Vertical Recoil. Let's go up the page a bit and look for anything that has to do with vertical recoil.

    7 - We found this, RecoilVertMax. We need to edit this values :*My file is already edited, your file gonna show more values before this, but is the same value.

    8 - We have only 4 Hex values (00 00 e8 40), it's is (7.25). This is the factor used in the math of the game. When we change it to 0, the recoil stay at 0 too.
    9 - Lets change it to 0, you just need to replace this (00 00 e8 40) for (00 00 00 00).
    10 - After this, you can save the file and open the pef decryptor. But now change the option to (Encrypt).
    11 - Rename the file (Weapon.pef-) to (Weapon.pef) and replace into Script.i3pack.
    12 - Do the same process to add a pack into PB.

    What you can Edit:
    Ext_RecoilVertFactor - Extension vertical recoil (change to 00 00 00 00)
    Ext_RecoilHorzFactor - Extension horizontal recoil (change to 00 00 00 00)
    RecoilVertMax - Maximum vertical recoil (change to 00 00 00 00)
    RecoilVertAngle - Vertical recoil angle (change to 00 00 00 00)
    RecoilHorzMax - Maximum horizontal Recoil (change to 00 00 00 00)
    RecoilHorzAngle - Vertical horizontal angle (change to 00 00 00 00)
    Deviation - Deviation (change to 00 00 00 00)
    FireBulletCount - Number of bullets per shot (Change to 0A, more than this can crash your game)
    Range - Bullet distance.
    Explosion_Range - If you increase the grenade, it raises the range of damage

    If you find more, share with us.
    Last edited by ericksousa2435; 03-09-18 at 01:19 AM.
    What are you looking for?

  2. #2
    Hardcore Member QuietCode is offline
    Dec 2015 Join Date
    Russia, ITGNetLocation

    Re: [TUTORIAL] Pef Files Edit - How to edit some attributes

    Few of our leeches will understand.

  3. #3
    Would You Kindly? Bola is offline
    Dec 2011 Join Date

    Re: [TUTORIAL] Pef Files Edit - How to edit some attributes

    i'm gonna leave link do PEFDecryptor, is really funny about how long this tool was around here and i havent noticed XD.
    as well i leave pb development people can just download here and use it: https://mega.nz/#!vA1z3BST!WOo2Bj4hc...4is96057ffz3B4

    Compiled with vs 2017, tested on windows 10.
    die as a hero or live long enough to see yourself become a villain

  4. #4
    Registered farisfreak is offline
    Nov 2013 Join Date

    Re: [TUTORIAL] Pef Files Edit - How to edit some attributes

    The struct .pef file is the same as an i3pack struct file that starts with 49 33 52 32 (I3R2).

    this is i3pack file :

    this is pef file :

    to make it easier, you can find it after getting the data 'DirTable'. you can find the offsets from janglapuk i3pack source. this is the offsets :

    and you can decrypt it with 3 bit from janglapuk encdec tool (i remake it from c++ to c# btw lol. so, this is not janglapuk's tool)

    this is the data of DirTable from Character.pef :

    then, i parse raw data (the data is in the photo above) (and its using my own tools for parsing btw) for easy reading. will be like this :

    the order of the names of the data above is this (you can get this using offset stringtables) :

    the data is the same sequence (nodeinfo and stringtable). here I will give an example.
    I will search for data for 'InvincibleTime'. from the stringtable sequence, 'InvincibleTime' is number 12. I retrieve data from the nodeinfo whose index is 12 (0C hex). I got data like this:
    00 00 00 00 0C 00 00 00 00 00 00 00 6E 39 03 00 00 00 00 00 67 00 00 00 00 00 00 00

    the data can be described using NodeInf offset in the first photo. so the data is like this

    char _0x0000 [4] = 00 00 00 00
    DWORD dwIndex = 0C 00 00 00
    char _0x0008 [4] = 00 00 00 00
    DWORD dwOffset = 6E 39 03 00
    char _0x0010 [4] = 00 00 00 00
    DWORD dwSize = 67 00 00 00
    char _0x0018 [4] = 00 00 00 00

    You can search for 'InvicibleTime' data directly by looking for data from the offset (the data is 'LittleEndian'. so the value is 00 03 39 6E) you can immediately search the offset. then it will get data like this from Character.pef:

    finally, you can change the value of 'InvicibleTime' :)

    You can't easily modify the Script.i3pack btw. You will get this after modifying it :