Different Directory Pak File Managment/Loading#1548
Conversation
src/mods/IntegrityCheckBypass.cpp
Outdated
| #define ENABLE_PAK_DIRECTORY_LOAD (TDB_VER >= 81) | ||
|
|
||
| static utility::ExhaustionResult do_exhaustion_scan_create_file_refs(utility::ExhaustionContext &ctx, uintptr_t target_search_func, std::vector<uintptr_t> &before_create_file_ptrs) { | ||
| if (ctx.instrux.Instruction == ND_INS_CALLNI || ctx.instrux.Instruction == ND_INS_CALLNR || ctx.instrux.Instruction == ND_INS_CALLFD || ctx.instrux.Instruction == ND_INS_CALLFI) { |
There was a problem hiding this comment.
Use if (ctx.instrux.Category == ND_CAT_CALL)
src/mods/IntegrityCheckBypass.cpp
Outdated
| } | ||
|
|
||
| // Try decode next instruction and see if it calls CreateFileW | ||
| auto next_instr_opt = utility::decode_one((std::uint8_t*)(ctx.addr + ctx.instrux.Length)); |
There was a problem hiding this comment.
Redundant decode can likely be folded into the if statement above and checking the current ctx.instrux rather than decoding again.
There was a problem hiding this comment.
Right, I have adjusted it
|
People on Discord (Haven) suggested to change the directory path to pak_mods so I changed it |
src/mods/IntegrityCheckBypass.cpp
Outdated
| } | ||
| if (ctx.instrux.Category == ND_CAT_CALL) { | ||
| auto displacement_opt = utility::resolve_displacement(ctx.addr); | ||
| if (displacement_opt && *(uintptr_t*)(*displacement_opt) == target_search_func) { |
There was a problem hiding this comment.
ND_CAT_CALL isn't guaranteed to always be indirect CALL instructions like you're looking for here. Use an inner if statement looking for if (ctx.instrux.Instruction == ND_INS_CALLNI)
There was a problem hiding this comment.
Adjusted that, thanks!
|
Is it intented that the new folder is |
|
Yeah, the path is suggested by modders and users on the modding discord (Havens Night) |
Fix #1544
Purpose
Code changes