• All, Gmail is currently rejecting messages from my host. I have a ticket in process, but it may take some time to resolve. Until further notice, do NOT use Gmail for your accounts. You will be unable to receive confirmations and two factor messages to login.
OpenBOR

OpenBOR 4.0 7556

No permission to download
LOL....

Fair enough... I guess I never shared the code because I didn't want anyone to compromise future PAKS...

Then I guess the answer to that question is NO... OpenBOR has not have plans for locking down PAKS. However, you could still provide a service where you can sell that source code (If you want it, just let me know), fund this website and once a unified build system is in place they can manage it on their own.
 
Then I guess the answer to that question is NO... OpenBOR has not have plans for locking down PAKS.

I'd like to, I just want it to be independent of our (meaning staff) intervention. I was looking at a bit shift cypher of sorts salted from user generated passphrase, but there's obviously some technical hurdles to that.

DC
 
I'd like to, I just want it to be independent of our (meaning staff) intervention. I was looking at a bit shift cypher of sorts salted from user generated passphrase, but there's obviously some technical hurdles to that.

DC
That's what it did originally.... but unless you employ an asynchronous encryption model (Public [read]/Private [write] Keys) it can always be hacked. Asynchronous encryption is the only REAL solution to ensure integrity and have the responsibilities fall under the creator. From a technical perspective it should be feasible, lock and sign the PAK and when read... openbor can unlock with public key and load into memory and work from there (minimizes performance it but makes it vulnerable to memory attacks) or (unlock the data being loaded per call (most secure but comes with a performance hit).

Here is a thought.... maybe I should start a service.... oh wait!!! I'm starting to remember how everyone wanted me to decrypt BonusJZ mod prior to the 1 year expiration.... it was a headache!
 
Last edited:
@SX I made some experiments with the remaining secure pak code. I was able to add some changes in the borpak, which allow me to lock it. There's some security issues yet that require engine changes to be improved, but the concept works and the user can handle it alone easily.

Currently there's other tools to lock paks too, like virtualization using Virtual Box format (some kind of new molebox tool). IMO it would be a lot better to have an official way to lock content instead of requiring third party tools for that.
 
@SX Securepak was not that secure - it was already break and content modified heavily.
There was a Golden Axe game - Golden Axe Myth - which used this pak and, for years, it was secure.

Then come some chinese "modders", cracked it up and things went downhill.

I agree with DC - it would be good to have some tool which doesn't depends on the engine devs to work.
 
hahaha... well like you said it was secure for years but like anything else it can be broken. Really this would require a closed source solution on the engine side and utilize asynchronous cryptography and a new packing structure since there are many of those who are familiar with how the PAK structure is constructed.

I'm actually quite happy that it even lasted that long all things considered.
 
those who are familiar with how the PAK structure is constructed
Exactly, this is the point where I stuck in. It can be certainly improved but we must make several changes on how the engine reads paks.
I added a custom rot13 in the borpak and it's cool, but still breakable without several engine changes.
 
Exactly, this is the point where I stuck in. It can be certainly improved but we must make several changes on how the engine reads paks.
I added a custom rot13 in the borpak and it's cool, but still breakable without several engine changes.
the two file formats would have to co-exist to not break backward compatibility. If I'm not mistake the signature of the file is located right in the beginning and so you could utilize function pointers to reassign the file loading behavior once the magic key has been identified.

That's what I did to support both spk and pak.
 
Last edited:
I'm think the simplest thing to do is to distribute an alternate Packer and Engine. We'd call it "OpenBOR Pro" or some such. The one and ONLY difference is they will have additional (obviously closed source) code to pack and run secure games.

If you want a secure module, then you download the pro versions, pack your game, and distribute it... done. Doing so with the knowledge that pack will not be opened again (so keep your original!). This leaves it completely in the creator's hands, and let's us concentrate on making it , well, secure.

The downside is possible confusion, but good gravy... at this point I am so done capitulating to people who won't bother reading labels.

DC
 
If I'm not mistake the signature of the file is located right in the beginning
Yes, I can confirm it. The change I made in the borpak allows the user to edit the dword before creating the pak.

The point is that some modified versions of the paxplode ignore several steps and unpack no matter what dword is added. We could fix it by changing how the borpak creates a pak's structure, but the engine must be changed too in order to match the same way of reading. However, like you mentioned, it will break the backward compatibility, which makes the DC's solution a good one.

I'm think the simplest thing to do is to distribute an alternate Packer and Engine. We'd call it "OpenBOR Pro" or some such. The one and ONLY difference is they will have additional (obviously closed source) code to pack and run secure games.

If you want a secure module, then you download the pro versions, pack your game, and distribute it... done. Doing so with the knowledge that pack will not be opened again (so keep your original!). This leaves it completely in the creator's hands, and let's us concentrate on making it , well, secure.

The downside is possible confusion, but good gravy... at this point I am so done capitulating to people who won't bother reading labels.

DC
Agreed, IMO this is a good way to go.
 
Agree. If back in 2005.... had I been well versed in cryptography I would have done it differently.... using certificates solves this issue and the pak file itself would be entirely encrypted and no change to the structure would be necessary.
 
Yeah separate pro or whatever version would be nice, but there arent THAT many original mods.... still, nothing really protects these creators from paxplode
 
Hii there's a manual for this version? I want to try this new version to see if it could be my ideal one~
 
All, I just discovered a very severe bug in the 4.0 script support. New functions are returning erroneous values for decimal/floating type. I haven't identified the cause yet. Maybe @SX, or @Kratus could spot something in it. The relative code is in common_property.c:

C:
HRESULT property_access_get_member(const s_property_access_map* property_map, ScriptVariant* pretvar)
{
    //printf("\n property_access_get_member() \n");
    char fixed_string[MAX_NAME_LEN] = { 0 };
    if (property_map == NULL || property_map->field == NULL) {
        printf("\n\n Error: Null pointer passed to a property access get function. \n");
        return E_FAIL;
    }
    //printf("\n property_map->type: %d", property_map->type);
    ScriptVariant_ChangeType(pretvar, property_map->type);

    switch (property_map->type)
    {
    case VT_INTEGER:
        //printf("\n\t VT_INTEGER");
        pretvar->lVal = *(LONG*)property_map->field;  
        break;
    case VT_PTR:
        //printf("\n\t VT_PTR");
        if (property_map->config_flags & PROPERTY_ACCESS_CONFIG_STATIC_POINTER)
        {
            pretvar->ptrVal = (void*)property_map->field;
        }
        else
        {
            pretvar->ptrVal = *(void**)property_map->field;
        }
        break;
    case VT_DECIMAL:
        //printf("\n\t VT_DECIMAL");
        pretvar->dblVal = *(DOUBLE*)property_map->field;
        break;
    case VT_STR:  
        //printf("\n\t VT_STR");
        if (property_map->config_flags & PROPERTY_ACCESS_CONFIG_STATIC_LENGTH) {      
            memcpy(fixed_string, *(char(*)[MAX_NAME_LEN])property_map->field, MAX_NAME_LEN);
            pretvar->strVal = StrCache_Pop(MAX_NAME_LEN);
            memcpy(StrCache_Get(pretvar->strVal), fixed_string, MAX_NAME_LEN);
        }
        else {
            pretvar->strVal = StrCache_CreateNewFrom(*(char**)property_map->field);
        }
        break;
    case VT_EMPTY:
        //printf("\n\t VT_EMPTY");
        break;
    }
    //printf("\n property_access_get_member OK.");
    return S_OK;
}

You can test by using the dump functionality:

C:
void acting_entity = getlocalvar("self");

get_entity_property(acting_entity, openborconstant("PROPERTY_ACCESS_DUMP"));

Note the obviously bad data on position here. The other decimals are wrong too, but position is probably easiest to test and verify:

Rich (BB code):
Property List: 0F3BF298
     | Index | ID                                      | Type       | Access       | Value
     | 0     | ENTITY_PROPERTY_AI_DISABLE              | VT_INTEGER | Read, Write  | 0
     | 1     | ENTITY_PROPERTY_AI_TARGET_ENTITY        |     VT_PTR | Read, Write  | 00000000
     | 2     | ENTITY_PROPERTY_ALTERNATE_IDLE          | VT_INTEGER | Read, Write  | 0
     | 3     | ENTITY_PROPERTY_ALTERNATE_WALK          | VT_INTEGER | Read, Write  | 0
     | 4     | ENTITY_PROPERTY_ANIMATION               |     VT_PTR | Read         | 0F3A2D30
     | 5     | ENTITY_PROPERTY_ANIMATION_FRAME         | VT_INTEGER | Read, Write  | 0
     | 6     | ENTITY_PROPERTY_ANIMATION_ID            | VT_INTEGER | Read, Write  | 17
     | 7     | ENTITY_PROPERTY_ANIMATION_ID_PREVIOUS   | VT_INTEGER | Read, Write  | 3
     | 8     | ENTITY_PROPERTY_ANIMATION_STATE         | VT_INTEGER | Read, Write  | 1
     | 9     | ENTITY_PROPERTY_ANIMATION_TIME          | VT_INTEGER | Read, Write  | 361
     | 10    | ENTITY_PROPERTY_ARROW_STATE             | VT_INTEGER | Read, Write  | 0
     | 11    | ENTITY_PROPERTY_ATTACK_ID_INCOMING      |     VT_PTR | Read         | 0F3BF79C
     | 12    | ENTITY_PROPERTY_ATTACK_ID_OUTGOING      | VT_INTEGER | Read, Write  | 0
     | 13    | ENTITY_PROPERTY_ATTACK_STATE            | VT_INTEGER | Read, Write  | 2
     | 14    | ENTITY_PROPERTY_AUTOKILL                | VT_INTEGER | Read, Write  | 0
     | 15    | ENTITY_PROPERTY_BACK_HIT_DIRECTION      | VT_INTEGER | Read, Write  | 0
     | 16    | ENTITY_PROPERTY_BIND                    |     VT_PTR | Read         | 0F3BF2A0
     | 17    | ENTITY_PROPERTY_BLAST_STATE             | VT_INTEGER | Read, Write  | 0
     | 18    | ENTITY_PROPERTY_BLINK                   | VT_INTEGER | Read, Write  | 0
     | 19    | ENTITY_PROPERTY_BLOCK_STATE             | VT_INTEGER | Read, Write  | 0
     | 20    | ENTITY_PROPERTY_BOSS                    | VT_INTEGER | Read, Write  | 0
     | 21    | ENTITY_PROPERTY_CHARGE_STATE            | VT_INTEGER | Read, Write  | 0
     | 22    | ENTITY_PROPERTY_CHILD                   |     VT_PTR | Read, Write  | 00000000
     | 23    | ENTITY_PROPERTY_COLORSET_DEFAULT        | VT_INTEGER | Read, Write  | 0
     | 24    | ENTITY_PROPERTY_COLORSET_DYING_HEALTH_1 | VT_INTEGER | Read, Write  | 0
     | 25    | ENTITY_PROPERTY_COLORSET_DYING_HEALTH_2 | VT_INTEGER | Read, Write  | 0
     | 26    | ENTITY_PROPERTY_COLORSET_DYING_INDEX_1  | VT_INTEGER | Read, Write  | 0
     | 27    | ENTITY_PROPERTY_COLORSET_DYING_INDEX_2  | VT_INTEGER | Read, Write  | 0
     | 28    | ENTITY_PROPERTY_COLORSET_TABLE          |     VT_PTR | Read, Write  | 0F3290F0
     | 29    | ENTITY_PROPERTY_COLORSET_TIME           | VT_INTEGER | Read, Write  | 0
     | 30    | ENTITY_PROPERTY_COMBO_STEP              |     VT_PTR | Read         | 0F3BF7B8
     | 31    | ENTITY_PROPERTY_COMBO_TIME              | VT_INTEGER | Read, Write  | 0
     | 32    | ENTITY_PROPERTY_COMMAND_TIME            | VT_INTEGER | Read, Write  | 400
     | 33    | ENTITY_PROPERTY_DAMAGE_ON_LANDING       |     VT_PTR | Read         | 0F3BF298
     | 34    | ENTITY_PROPERTY_DEATH_STATE             | VT_INTEGER | Read, Write  | 0
     | 35    | ENTITY_PROPERTY_DEFENSE                 |     VT_PTR | Read         | 0F440230
     | 36    | ENTITY_PROPERTY_DESTINATION_X           | VT_DECIMAL | Read, Write  | 0.000000
     | 37    | ENTITY_PROPERTY_DESTINATION_Z           | VT_DECIMAL | Read, Write  | 0.000000
     | 38    | ENTITY_PROPERTY_DIE_ON_LANDING          | VT_INTEGER | Read, Write  | 0
     | 39    | ENTITY_PROPERTY_DRAWMETHOD              |     VT_PTR | Read, Write  | 0F961ED0
     | 40    | ENTITY_PROPERTY_DROP                    | VT_INTEGER | Read, Write  | 0
     | 41    | ENTITY_PROPERTY_DUCK_STATE              | VT_INTEGER | Read, Write  | 0
     | 42    | ENTITY_PROPERTY_ENTVAR_COLLECTION       |     VT_PTR | Read, Write  | 0F332168
     | 43    | ENTITY_PROPERTY_ESCAPE_COUNT            | VT_INTEGER | Read, Write  | 0
     | 44    | ENTITY_PROPERTY_EXISTS                  | VT_INTEGER | Read, Write  | 1
     | 45    | ENTITY_PROPERTY_EXPLODE                 | VT_INTEGER | Read, Write  | 0
     | 46    | ENTITY_PROPERTY_FACTION                 |     VT_PTR | Read         | 0F3BF2F8
     | 47    | ENTITY_PROPERTY_FALL_STATE              | VT_INTEGER | Read, Write  | 0
     | 48    | ENTITY_PROPERTY_FREEZE_STATE            | VT_INTEGER | Read, Write  | 0
     | 49    | ENTITY_PROPERTY_FREEZE_TIME             | VT_INTEGER | Read, Write  | 0
     | 50    | ENTITY_PROPERTY_FUNCTION_TAKE_ACTION    |     VT_PTR | Read, Write  | 0044C110
     | 51    | ENTITY_PROPERTY_FUNCTION_TAKE_DAMAGE    |     VT_PTR | Read, Write  | 0045C930
     | 52    | ENTITY_PROPERTY_FUNCTION_THINK          |     VT_PTR | Read, Write  | 00456710
     | 53    | ENTITY_PROPERTY_FUNCTION_TRY_MOVE       |     VT_PTR | Read, Write  | 0044EE10
     | 54    | ENTITY_PROPERTY_GET_STATE               | VT_INTEGER | Read, Write  | 0
     | 55    | ENTITY_PROPERTY_GRAB_TARGET             |     VT_PTR | Read, Write  | 00000000
     | 56    | ENTITY_PROPERTY_GRAB_WALK_STATE         | VT_INTEGER | Read, Write  | 0
     | 57    | ENTITY_PROPERTY_GUARD_POINTS            | VT_INTEGER | Read, Write  | 0
     | 58    | ENTITY_PROPERTY_GUARD_TIME              | VT_INTEGER | Read, Write  | 0
     | 59    | ENTITY_PROPERTY_HP                      | VT_INTEGER | Read, Write  | 100
     | 60    | ENTITY_PROPERTY_HP_OLD                  | VT_INTEGER | Read, Write  | 100
     | 61    | ENTITY_PROPERTY_IDLE_STATE              | VT_INTEGER | Read, Write  | 0
     | 62    | ENTITY_PROPERTY_IN_PAIN                 | VT_INTEGER | Read, Write  | 0
     | 63    | ENTITY_PROPERTY_IN_PAIN_BACK            | VT_INTEGER | Read, Write  | 0
     | 64    | ENTITY_PROPERTY_INVINCIBLE_STATE        | VT_INTEGER | Read, Write  | 0
     | 65    | ENTITY_PROPERTY_INVINCIBLE_TIME         | VT_INTEGER | Read, Write  | 0
     | 66    | ENTITY_PROPERTY_ITEM_DATA               |     VT_PTR | Read, Write  | 00000000
     | 67    | ENTITY_PROPERTY_JUMP_ANIMATION_ID       | VT_INTEGER | Read, Write  | 3
     | 68    | ENTITY_PROPERTY_JUMP_STATE              | VT_INTEGER | Read, Write  | 1
     | 69    | ENTITY_PROPERTY_JUMP_VELOCITY_X         | VT_DECIMAL | Read, Write  | 512.000121
     | 70    | ENTITY_PROPERTY_JUMP_VELOCITY_Y         | VT_DECIMAL | Read, Write  | 0.000000
     | 71    | ENTITY_PROPERTY_JUMP_VELOCITY_Z         | VT_DECIMAL | Read, Write  | 0.000000
     | 72    | ENTITY_PROPERTY_KNOCKDOWN_COUNT         | VT_INTEGER | Read, Write  | 0
     | 73    | ENTITY_PROPERTY_KNOCKDOWN_TIME          | VT_INTEGER | Read, Write  | 0
     | 74    | ENTITY_PROPERTY_LAST_DAMAGE_TYPE        | VT_INTEGER | Read, Write  | 0
     | 75    | ENTITY_PROPERTY_LAST_HIT                |     VT_PTR | Read, Write  | 00000000
     | 76    | ENTITY_PROPERTY_LIFESPAN                | VT_INTEGER | Read, Write  | 2147483647
     | 77    | ENTITY_PROPERTY_LINK                    |     VT_PTR | Read, Write  | 00000000
     | 78    | ENTITY_PROPERTY_MODEL                   |     VT_PTR | Read, Write  | 0496B218
     | 79    | ENTITY_PROPERTY_MODEL_DATA              |     VT_PTR | Read         | 0F3BF314
     | 80    | ENTITY_PROPERTY_MODEL_DATA              |     VT_PTR | Read, Write  | 0496B218
     | 81    | ENTITY_PROPERTY_MOVE_TIME               | VT_INTEGER | Read, Write  | 351
     | 82    | ENTITY_PROPERTY_MOVE_X                  | VT_DECIMAL | Read, Write  | 0.000000
     | 83    | ENTITY_PROPERTY_MOVE_Z                  | VT_DECIMAL | Read, Write  | 0.007813
     | 84    | ENTITY_PROPERTY_MP                      | VT_INTEGER | Read, Write  | 100
     | 85    | ENTITY_PROPERTY_MP_CHARGE_TIME          | VT_INTEGER | Read, Write  | 0
     | 86    | ENTITY_PROPERTY_MP_OLD                  | VT_INTEGER | Read, Write  | 100
     | 87    | ENTITY_PROPERTY_MP_TIME                 | VT_INTEGER | Read, Write  | 401
     | 88    | ENTITY_PROPERTY_NAME                    |     VT_STR | Read, Write  | Valis_Yuan
     | 89    | ENTITY_PROPERTY_NEXT_ATTACK_TIME        | VT_INTEGER | Read, Write  | 0
     | 90    | ENTITY_PROPERTY_NEXT_HIT_TIME           | VT_INTEGER | Read, Write  | 0
     | 91    | ENTITY_PROPERTY_NOGRAB                  | VT_INTEGER | Read, Write  | 0
     | 92    | ENTITY_PROPERTY_NOGRAB_DEFAULT          | VT_INTEGER | Read, Write  | 0
     | 93    | ENTITY_PROPERTY_OBSTRUCTED              | VT_INTEGER | Read, Write  | 0
     | 94    | ENTITY_PROPERTY_OBSTRUCTION_OVERHEAD    | VT_INTEGER | Read, Write  | 0
     | 95    | ENTITY_PROPERTY_OFFENSE                 |     VT_PTR | Read, Write  | 0F3E75B0
     | 96    | ENTITY_PROPERTY_OPPONENT                |     VT_PTR | Read, Write  | 00000000
     | 97    | ENTITY_PROPERTY_OWNER                   |     VT_PTR | Read, Write  | 00000000
     | 98    | ENTITY_PROPERTY_PARENT                  |     VT_PTR | Read, Write  | 00000000
     | 99    | ENTITY_PROPERTY_PATH_OBSTRUCTED_WAIT    | VT_INTEGER | Read, Write  | 0
     | 100   | ENTITY_PROPERTY_PAUSE_TIME              | VT_INTEGER | Read, Write  | 0
     | 101   | ENTITY_PROPERTY_PLATFORM_LAND           |     VT_PTR | Read, Write  | 00000000
     | 102   | ENTITY_PROPERTY_PLAYER_INDEX            | VT_INTEGER | Read, Write  | 0
     | 103   | ENTITY_PROPERTY_POSITION_BASE           | VT_DECIMAL | Read, Write  | 0.000000
     | 104   | ENTITY_PROPERTY_POSITION_BASE_ALTERNATE | VT_DECIMAL | Read, Write  | 0.000000
     | 105   | ENTITY_PROPERTY_POSITION_DIRECTION      | VT_INTEGER | Read, Write  | 1
     | 106   | ENTITY_PROPERTY_POSITION_X              | VT_DECIMAL | Read, Write  | 3600909096000.003900
     | 107   | ENTITY_PROPERTY_POSITION_Y              | VT_DECIMAL | Read, Write  | 50668528395721144.000000
     | 108   | ENTITY_PROPERTY_POSITION_Z              | VT_DECIMAL | Read, Write  | 0.007813
     | 109   | ENTITY_PROPERTY_PROJECTILE_PRIME        | VT_INTEGER | Read, Write  | 0
     | 110   | ENTITY_PROPERTY_RECURSIVE_DAMAGE        |     VT_PTR | Read, Write  | 00000000
     | 111   | ENTITY_PROPERTY_RELEASE_TIME            | VT_INTEGER | Read, Write  | 0
     | 112   | ENTITY_PROPERTY_RISE_ATTACK_DELAY       | VT_INTEGER | Read, Write  | 0
     | 113   | ENTITY_PROPERTY_RISE_ATTACK_TIME        | VT_INTEGER | Read, Write  | 0
     | 114   | ENTITY_PROPERTY_RISE_DELAY              | VT_INTEGER | Read, Write  | 0
     | 115   | ENTITY_PROPERTY_RISE_STATE              | VT_INTEGER | Read, Write  | 0
     | 116   | ENTITY_PROPERTY_RUN_STATE               | VT_INTEGER | Read, Write  | 0
     | 117   | ENTITY_PROPERTY_RUSH                    |     VT_PTR | Read         | 0F3BF6A4
     | 118   | ENTITY_PROPERTY_SCRIPT                  |     VT_PTR | Read, Write  | 04962370
     | 119   | ENTITY_PROPERTY_SEAL_ENERGY             | VT_INTEGER | Read, Write  | 0
     | 120   | ENTITY_PROPERTY_SEAL_TIME               | VT_INTEGER | Read, Write  | 0
     | 121   | ENTITY_PROPERTY_SHADOW_CONFIG_FLAGS     | VT_INTEGER | Read, Write  | 24
     | 122   | ENTITY_PROPERTY_SLEEP_TIME              | VT_INTEGER | Read, Write  | 1350
     | 123   | ENTITY_PROPERTY_SORT_ID                 | VT_INTEGER | Read, Write  | 0
     | 124   | ENTITY_PROPERTY_SPACE_OTHER             |     VT_PTR | Read, Write  | 00000000
     | 125   | ENTITY_PROPERTY_SPAWN_TYPE              | VT_INTEGER | Read, Write  | 13
     | 126   | ENTITY_PROPERTY_SPEED_MULTIPLIER        | VT_DECIMAL | Read, Write  | 0.000000
     | 127   | ENTITY_PROPERTY_STALL_TIME              | VT_INTEGER | Read, Write  | 0
     | 128   | ENTITY_PROPERTY_THINK_TIME              | VT_INTEGER | Read, Write  | 353
     | 129   | ENTITY_PROPERTY_TIMESTAMP               | VT_INTEGER | Read, Write  | 0
     | 130   | ENTITY_PROPERTY_TO_COST                 | VT_INTEGER | Read, Write  | 0
     | 131   | ENTITY_PROPERTY_TOSS_TIME               | VT_INTEGER | Read, Write  | 351
     | 132   | ENTITY_PROPERTY_TURN_STATE              | VT_INTEGER | Read, Write  | 0
     | 133   | ENTITY_PROPERTY_TURN_TIME               | VT_INTEGER | Read, Write  | 0
     | 134   | ENTITY_PROPERTY_UPDATE_MARK             | VT_INTEGER | Read, Write  | 1
     | 135   | ENTITY_PROPERTY_VELOCITY_X              | VT_DECIMAL | Read, Write  | 0.175002
     | 136   | ENTITY_PROPERTY_VELOCITY_Y              | VT_DECIMAL | Read, Write  | 0.000000
     | 137   | ENTITY_PROPERTY_VELOCITY_Z              | VT_DECIMAL | Read, Write  | 0.000000
     | 138   | ENTITY_PROPERTY_WALK_STATE              | VT_INTEGER | Read, Write  | 0
     | 139   | ENTITY_PROPERTY_WAYPOINT                |     VT_PTR | Read, Write  | 00000000
     | 140   | ENTITY_PROPERTY_WAYPOINT_COUNT          | VT_INTEGER | Read, Write  | 0
     | 141   | ENTITY_PROPERTY_WEAPON_ITEM             |     VT_PTR | Read, Write  | 00000000
     | 142   | ENTITY_PROPERTY_WEAPON_STATE            | VT_INTEGER | Read, Write  | 0


I wrote this code - it's all on me. Sorry about that! :oops:

I'll post more details and fixes as I have them.

DC
 
Last edited:
All, I just discovered a very severe bug in the 4.0 script support. New functions are returning erroneous values for decimal/floating type. I haven't identified the cause yet. Maybe @SX, or @Kratus could spot something in it. The relative code is in common_property.c:

C:
HRESULT property_access_get_member(const s_property_access_map* property_map, ScriptVariant* pretvar)
{
    //printf("\n property_access_get_member() \n");
    char fixed_string[MAX_NAME_LEN] = { 0 };
    if (property_map == NULL || property_map->field == NULL) {
        printf("\n\n Error: Null pointer passed to a property access get function. \n");
        return E_FAIL;
    }
    //printf("\n property_map->type: %d", property_map->type);
    ScriptVariant_ChangeType(pretvar, property_map->type);

    switch (property_map->type)
    {
    case VT_INTEGER:
        //printf("\n\t VT_INTEGER");
        pretvar->lVal = *(LONG*)property_map->field; 
        break;
    case VT_PTR:
        //printf("\n\t VT_PTR");
        if (property_map->config_flags & PROPERTY_ACCESS_CONFIG_STATIC_POINTER)
        {
            pretvar->ptrVal = (void*)property_map->field;
        }
        else
        {
            pretvar->ptrVal = *(void**)property_map->field;
        }
        break;
    case VT_DECIMAL:
        //printf("\n\t VT_DECIMAL");
        pretvar->dblVal = *(DOUBLE*)property_map->field;
        break;
    case VT_STR: 
        //printf("\n\t VT_STR");
        if (property_map->config_flags & PROPERTY_ACCESS_CONFIG_STATIC_LENGTH) {     
            memcpy(fixed_string, *(char(*)[MAX_NAME_LEN])property_map->field, MAX_NAME_LEN);
            pretvar->strVal = StrCache_Pop(MAX_NAME_LEN);
            memcpy(StrCache_Get(pretvar->strVal), fixed_string, MAX_NAME_LEN);
        }
        else {
            pretvar->strVal = StrCache_CreateNewFrom(*(char**)property_map->field);
        }
        break;
    case VT_EMPTY:
        //printf("\n\t VT_EMPTY");
        break;
    }
    //printf("\n property_access_get_member OK.");
    return S_OK;
}

You can test by using the dump functionality:

C:
void acting_entity = getlocalvar("self");

get_entity_property(acting_entity, openborconstant("PROPERTY_ACCESS_DUMP"));

Note the obviously bad data on position here. The other decimals are wrong too, but position is probably easiest to test and verify:

Rich (BB code):
Property List: 0F3BF298
     | Index | ID                                      | Type       | Access       | Value
     | 0     | ENTITY_PROPERTY_AI_DISABLE              | VT_INTEGER | Read, Write  | 0
     | 1     | ENTITY_PROPERTY_AI_TARGET_ENTITY        |     VT_PTR | Read, Write  | 00000000
     | 2     | ENTITY_PROPERTY_ALTERNATE_IDLE          | VT_INTEGER | Read, Write  | 0
     | 3     | ENTITY_PROPERTY_ALTERNATE_WALK          | VT_INTEGER | Read, Write  | 0
     | 4     | ENTITY_PROPERTY_ANIMATION               |     VT_PTR | Read         | 0F3A2D30
     | 5     | ENTITY_PROPERTY_ANIMATION_FRAME         | VT_INTEGER | Read, Write  | 0
     | 6     | ENTITY_PROPERTY_ANIMATION_ID            | VT_INTEGER | Read, Write  | 17
     | 7     | ENTITY_PROPERTY_ANIMATION_ID_PREVIOUS   | VT_INTEGER | Read, Write  | 3
     | 8     | ENTITY_PROPERTY_ANIMATION_STATE         | VT_INTEGER | Read, Write  | 1
     | 9     | ENTITY_PROPERTY_ANIMATION_TIME          | VT_INTEGER | Read, Write  | 361
     | 10    | ENTITY_PROPERTY_ARROW_STATE             | VT_INTEGER | Read, Write  | 0
     | 11    | ENTITY_PROPERTY_ATTACK_ID_INCOMING      |     VT_PTR | Read         | 0F3BF79C
     | 12    | ENTITY_PROPERTY_ATTACK_ID_OUTGOING      | VT_INTEGER | Read, Write  | 0
     | 13    | ENTITY_PROPERTY_ATTACK_STATE            | VT_INTEGER | Read, Write  | 2
     | 14    | ENTITY_PROPERTY_AUTOKILL                | VT_INTEGER | Read, Write  | 0
     | 15    | ENTITY_PROPERTY_BACK_HIT_DIRECTION      | VT_INTEGER | Read, Write  | 0
     | 16    | ENTITY_PROPERTY_BIND                    |     VT_PTR | Read         | 0F3BF2A0
     | 17    | ENTITY_PROPERTY_BLAST_STATE             | VT_INTEGER | Read, Write  | 0
     | 18    | ENTITY_PROPERTY_BLINK                   | VT_INTEGER | Read, Write  | 0
     | 19    | ENTITY_PROPERTY_BLOCK_STATE             | VT_INTEGER | Read, Write  | 0
     | 20    | ENTITY_PROPERTY_BOSS                    | VT_INTEGER | Read, Write  | 0
     | 21    | ENTITY_PROPERTY_CHARGE_STATE            | VT_INTEGER | Read, Write  | 0
     | 22    | ENTITY_PROPERTY_CHILD                   |     VT_PTR | Read, Write  | 00000000
     | 23    | ENTITY_PROPERTY_COLORSET_DEFAULT        | VT_INTEGER | Read, Write  | 0
     | 24    | ENTITY_PROPERTY_COLORSET_DYING_HEALTH_1 | VT_INTEGER | Read, Write  | 0
     | 25    | ENTITY_PROPERTY_COLORSET_DYING_HEALTH_2 | VT_INTEGER | Read, Write  | 0
     | 26    | ENTITY_PROPERTY_COLORSET_DYING_INDEX_1  | VT_INTEGER | Read, Write  | 0
     | 27    | ENTITY_PROPERTY_COLORSET_DYING_INDEX_2  | VT_INTEGER | Read, Write  | 0
     | 28    | ENTITY_PROPERTY_COLORSET_TABLE          |     VT_PTR | Read, Write  | 0F3290F0
     | 29    | ENTITY_PROPERTY_COLORSET_TIME           | VT_INTEGER | Read, Write  | 0
     | 30    | ENTITY_PROPERTY_COMBO_STEP              |     VT_PTR | Read         | 0F3BF7B8
     | 31    | ENTITY_PROPERTY_COMBO_TIME              | VT_INTEGER | Read, Write  | 0
     | 32    | ENTITY_PROPERTY_COMMAND_TIME            | VT_INTEGER | Read, Write  | 400
     | 33    | ENTITY_PROPERTY_DAMAGE_ON_LANDING       |     VT_PTR | Read         | 0F3BF298
     | 34    | ENTITY_PROPERTY_DEATH_STATE             | VT_INTEGER | Read, Write  | 0
     | 35    | ENTITY_PROPERTY_DEFENSE                 |     VT_PTR | Read         | 0F440230
     | 36    | ENTITY_PROPERTY_DESTINATION_X           | VT_DECIMAL | Read, Write  | 0.000000
     | 37    | ENTITY_PROPERTY_DESTINATION_Z           | VT_DECIMAL | Read, Write  | 0.000000
     | 38    | ENTITY_PROPERTY_DIE_ON_LANDING          | VT_INTEGER | Read, Write  | 0
     | 39    | ENTITY_PROPERTY_DRAWMETHOD              |     VT_PTR | Read, Write  | 0F961ED0
     | 40    | ENTITY_PROPERTY_DROP                    | VT_INTEGER | Read, Write  | 0
     | 41    | ENTITY_PROPERTY_DUCK_STATE              | VT_INTEGER | Read, Write  | 0
     | 42    | ENTITY_PROPERTY_ENTVAR_COLLECTION       |     VT_PTR | Read, Write  | 0F332168
     | 43    | ENTITY_PROPERTY_ESCAPE_COUNT            | VT_INTEGER | Read, Write  | 0
     | 44    | ENTITY_PROPERTY_EXISTS                  | VT_INTEGER | Read, Write  | 1
     | 45    | ENTITY_PROPERTY_EXPLODE                 | VT_INTEGER | Read, Write  | 0
     | 46    | ENTITY_PROPERTY_FACTION                 |     VT_PTR | Read         | 0F3BF2F8
     | 47    | ENTITY_PROPERTY_FALL_STATE              | VT_INTEGER | Read, Write  | 0
     | 48    | ENTITY_PROPERTY_FREEZE_STATE            | VT_INTEGER | Read, Write  | 0
     | 49    | ENTITY_PROPERTY_FREEZE_TIME             | VT_INTEGER | Read, Write  | 0
     | 50    | ENTITY_PROPERTY_FUNCTION_TAKE_ACTION    |     VT_PTR | Read, Write  | 0044C110
     | 51    | ENTITY_PROPERTY_FUNCTION_TAKE_DAMAGE    |     VT_PTR | Read, Write  | 0045C930
     | 52    | ENTITY_PROPERTY_FUNCTION_THINK          |     VT_PTR | Read, Write  | 00456710
     | 53    | ENTITY_PROPERTY_FUNCTION_TRY_MOVE       |     VT_PTR | Read, Write  | 0044EE10
     | 54    | ENTITY_PROPERTY_GET_STATE               | VT_INTEGER | Read, Write  | 0
     | 55    | ENTITY_PROPERTY_GRAB_TARGET             |     VT_PTR | Read, Write  | 00000000
     | 56    | ENTITY_PROPERTY_GRAB_WALK_STATE         | VT_INTEGER | Read, Write  | 0
     | 57    | ENTITY_PROPERTY_GUARD_POINTS            | VT_INTEGER | Read, Write  | 0
     | 58    | ENTITY_PROPERTY_GUARD_TIME              | VT_INTEGER | Read, Write  | 0
     | 59    | ENTITY_PROPERTY_HP                      | VT_INTEGER | Read, Write  | 100
     | 60    | ENTITY_PROPERTY_HP_OLD                  | VT_INTEGER | Read, Write  | 100
     | 61    | ENTITY_PROPERTY_IDLE_STATE              | VT_INTEGER | Read, Write  | 0
     | 62    | ENTITY_PROPERTY_IN_PAIN                 | VT_INTEGER | Read, Write  | 0
     | 63    | ENTITY_PROPERTY_IN_PAIN_BACK            | VT_INTEGER | Read, Write  | 0
     | 64    | ENTITY_PROPERTY_INVINCIBLE_STATE        | VT_INTEGER | Read, Write  | 0
     | 65    | ENTITY_PROPERTY_INVINCIBLE_TIME         | VT_INTEGER | Read, Write  | 0
     | 66    | ENTITY_PROPERTY_ITEM_DATA               |     VT_PTR | Read, Write  | 00000000
     | 67    | ENTITY_PROPERTY_JUMP_ANIMATION_ID       | VT_INTEGER | Read, Write  | 3
     | 68    | ENTITY_PROPERTY_JUMP_STATE              | VT_INTEGER | Read, Write  | 1
     | 69    | ENTITY_PROPERTY_JUMP_VELOCITY_X         | VT_DECIMAL | Read, Write  | 512.000121
     | 70    | ENTITY_PROPERTY_JUMP_VELOCITY_Y         | VT_DECIMAL | Read, Write  | 0.000000
     | 71    | ENTITY_PROPERTY_JUMP_VELOCITY_Z         | VT_DECIMAL | Read, Write  | 0.000000
     | 72    | ENTITY_PROPERTY_KNOCKDOWN_COUNT         | VT_INTEGER | Read, Write  | 0
     | 73    | ENTITY_PROPERTY_KNOCKDOWN_TIME          | VT_INTEGER | Read, Write  | 0
     | 74    | ENTITY_PROPERTY_LAST_DAMAGE_TYPE        | VT_INTEGER | Read, Write  | 0
     | 75    | ENTITY_PROPERTY_LAST_HIT                |     VT_PTR | Read, Write  | 00000000
     | 76    | ENTITY_PROPERTY_LIFESPAN                | VT_INTEGER | Read, Write  | 2147483647
     | 77    | ENTITY_PROPERTY_LINK                    |     VT_PTR | Read, Write  | 00000000
     | 78    | ENTITY_PROPERTY_MODEL                   |     VT_PTR | Read, Write  | 0496B218
     | 79    | ENTITY_PROPERTY_MODEL_DATA              |     VT_PTR | Read         | 0F3BF314
     | 80    | ENTITY_PROPERTY_MODEL_DATA              |     VT_PTR | Read, Write  | 0496B218
     | 81    | ENTITY_PROPERTY_MOVE_TIME               | VT_INTEGER | Read, Write  | 351
     | 82    | ENTITY_PROPERTY_MOVE_X                  | VT_DECIMAL | Read, Write  | 0.000000
     | 83    | ENTITY_PROPERTY_MOVE_Z                  | VT_DECIMAL | Read, Write  | 0.007813
     | 84    | ENTITY_PROPERTY_MP                      | VT_INTEGER | Read, Write  | 100
     | 85    | ENTITY_PROPERTY_MP_CHARGE_TIME          | VT_INTEGER | Read, Write  | 0
     | 86    | ENTITY_PROPERTY_MP_OLD                  | VT_INTEGER | Read, Write  | 100
     | 87    | ENTITY_PROPERTY_MP_TIME                 | VT_INTEGER | Read, Write  | 401
     | 88    | ENTITY_PROPERTY_NAME                    |     VT_STR | Read, Write  | Valis_Yuan
     | 89    | ENTITY_PROPERTY_NEXT_ATTACK_TIME        | VT_INTEGER | Read, Write  | 0
     | 90    | ENTITY_PROPERTY_NEXT_HIT_TIME           | VT_INTEGER | Read, Write  | 0
     | 91    | ENTITY_PROPERTY_NOGRAB                  | VT_INTEGER | Read, Write  | 0
     | 92    | ENTITY_PROPERTY_NOGRAB_DEFAULT          | VT_INTEGER | Read, Write  | 0
     | 93    | ENTITY_PROPERTY_OBSTRUCTED              | VT_INTEGER | Read, Write  | 0
     | 94    | ENTITY_PROPERTY_OBSTRUCTION_OVERHEAD    | VT_INTEGER | Read, Write  | 0
     | 95    | ENTITY_PROPERTY_OFFENSE                 |     VT_PTR | Read, Write  | 0F3E75B0
     | 96    | ENTITY_PROPERTY_OPPONENT                |     VT_PTR | Read, Write  | 00000000
     | 97    | ENTITY_PROPERTY_OWNER                   |     VT_PTR | Read, Write  | 00000000
     | 98    | ENTITY_PROPERTY_PARENT                  |     VT_PTR | Read, Write  | 00000000
     | 99    | ENTITY_PROPERTY_PATH_OBSTRUCTED_WAIT    | VT_INTEGER | Read, Write  | 0
     | 100   | ENTITY_PROPERTY_PAUSE_TIME              | VT_INTEGER | Read, Write  | 0
     | 101   | ENTITY_PROPERTY_PLATFORM_LAND           |     VT_PTR | Read, Write  | 00000000
     | 102   | ENTITY_PROPERTY_PLAYER_INDEX            | VT_INTEGER | Read, Write  | 0
     | 103   | ENTITY_PROPERTY_POSITION_BASE           | VT_DECIMAL | Read, Write  | 0.000000
     | 104   | ENTITY_PROPERTY_POSITION_BASE_ALTERNATE | VT_DECIMAL | Read, Write  | 0.000000
     | 105   | ENTITY_PROPERTY_POSITION_DIRECTION      | VT_INTEGER | Read, Write  | 1
     | 106   | ENTITY_PROPERTY_POSITION_X              | VT_DECIMAL | Read, Write  | 3600909096000.003900
     | 107   | ENTITY_PROPERTY_POSITION_Y              | VT_DECIMAL | Read, Write  | 50668528395721144.000000
     | 108   | ENTITY_PROPERTY_POSITION_Z              | VT_DECIMAL | Read, Write  | 0.007813
     | 109   | ENTITY_PROPERTY_PROJECTILE_PRIME        | VT_INTEGER | Read, Write  | 0
     | 110   | ENTITY_PROPERTY_RECURSIVE_DAMAGE        |     VT_PTR | Read, Write  | 00000000
     | 111   | ENTITY_PROPERTY_RELEASE_TIME            | VT_INTEGER | Read, Write  | 0
     | 112   | ENTITY_PROPERTY_RISE_ATTACK_DELAY       | VT_INTEGER | Read, Write  | 0
     | 113   | ENTITY_PROPERTY_RISE_ATTACK_TIME        | VT_INTEGER | Read, Write  | 0
     | 114   | ENTITY_PROPERTY_RISE_DELAY              | VT_INTEGER | Read, Write  | 0
     | 115   | ENTITY_PROPERTY_RISE_STATE              | VT_INTEGER | Read, Write  | 0
     | 116   | ENTITY_PROPERTY_RUN_STATE               | VT_INTEGER | Read, Write  | 0
     | 117   | ENTITY_PROPERTY_RUSH                    |     VT_PTR | Read         | 0F3BF6A4
     | 118   | ENTITY_PROPERTY_SCRIPT                  |     VT_PTR | Read, Write  | 04962370
     | 119   | ENTITY_PROPERTY_SEAL_ENERGY             | VT_INTEGER | Read, Write  | 0
     | 120   | ENTITY_PROPERTY_SEAL_TIME               | VT_INTEGER | Read, Write  | 0
     | 121   | ENTITY_PROPERTY_SHADOW_CONFIG_FLAGS     | VT_INTEGER | Read, Write  | 24
     | 122   | ENTITY_PROPERTY_SLEEP_TIME              | VT_INTEGER | Read, Write  | 1350
     | 123   | ENTITY_PROPERTY_SORT_ID                 | VT_INTEGER | Read, Write  | 0
     | 124   | ENTITY_PROPERTY_SPACE_OTHER             |     VT_PTR | Read, Write  | 00000000
     | 125   | ENTITY_PROPERTY_SPAWN_TYPE              | VT_INTEGER | Read, Write  | 13
     | 126   | ENTITY_PROPERTY_SPEED_MULTIPLIER        | VT_DECIMAL | Read, Write  | 0.000000
     | 127   | ENTITY_PROPERTY_STALL_TIME              | VT_INTEGER | Read, Write  | 0
     | 128   | ENTITY_PROPERTY_THINK_TIME              | VT_INTEGER | Read, Write  | 353
     | 129   | ENTITY_PROPERTY_TIMESTAMP               | VT_INTEGER | Read, Write  | 0
     | 130   | ENTITY_PROPERTY_TO_COST                 | VT_INTEGER | Read, Write  | 0
     | 131   | ENTITY_PROPERTY_TOSS_TIME               | VT_INTEGER | Read, Write  | 351
     | 132   | ENTITY_PROPERTY_TURN_STATE              | VT_INTEGER | Read, Write  | 0
     | 133   | ENTITY_PROPERTY_TURN_TIME               | VT_INTEGER | Read, Write  | 0
     | 134   | ENTITY_PROPERTY_UPDATE_MARK             | VT_INTEGER | Read, Write  | 1
     | 135   | ENTITY_PROPERTY_VELOCITY_X              | VT_DECIMAL | Read, Write  | 0.175002
     | 136   | ENTITY_PROPERTY_VELOCITY_Y              | VT_DECIMAL | Read, Write  | 0.000000
     | 137   | ENTITY_PROPERTY_VELOCITY_Z              | VT_DECIMAL | Read, Write  | 0.000000
     | 138   | ENTITY_PROPERTY_WALK_STATE              | VT_INTEGER | Read, Write  | 0
     | 139   | ENTITY_PROPERTY_WAYPOINT                |     VT_PTR | Read, Write  | 00000000
     | 140   | ENTITY_PROPERTY_WAYPOINT_COUNT          | VT_INTEGER | Read, Write  | 0
     | 141   | ENTITY_PROPERTY_WEAPON_ITEM             |     VT_PTR | Read, Write  | 00000000
     | 142   | ENTITY_PROPERTY_WEAPON_STATE            | VT_INTEGER | Read, Write  | 0


I wrote this code - it's all on me. Sorry about that! :oops:

I'll post more details and fixes as I have them.

DC
What build are you using? I will take a look but I'm using the 7612.
I'm using some new properties too and so far they are working fine, however they are just flags like SHADOW_FLAGS and integer values like HP_OLD, not float/decimals.
 
What build are you using? I will take a look but I'm using the 7612.
I'm using some new properties too and so far they are working fine, however they are just flags like SHADOW_FLAGS and integer values like HP_OLD, not float/decimals.

The latest stable. Like I noted above, so far as I can tell, it is only floats that are affected. I assume both read and write are bugged, but only confirmed reading. Everything else does appear good.

DC
 
Back
Top Bottom