Csimbi wrote: ↑Mon Nov 04, 2019 3:03 pm
Dunno what the devs where smoking:
- EXE size is way over the roof
- Game starts slower than the entire OS
I wonder if these things has something to do with that Denuvo poison...
Since the EXE is almost the size of a CD image, the AOB scans will take a while.
This is normal, so do not panic.
And make sure you are using at least CE 7.0, of course.
I was looking for a solution. And I have this:
Code: Select all
aobscanmodule(aobPlayerControllerGrabber,Borderlands3.exe,80 B9 ?? ?? 00 00 00 48 ?? ?? 75 ?? E8 ?? ?? ?? ?? 83) //OPTIM(0.6,0.8)
aobscanmodule(aobControllerPawnOffset,Borderlands3.exe,48 83 B9 ?? ?? 00 00 00 41 0F B6 ?? 44) //OPTIM(0.6,0.8)
aobscanmodule(aobControllerCharOffset,Borderlands3.exe,48 3B ?? ?? ?? 00 00 ?? 01 00 00 00 40 ?? ?? ?? 0F) //OPTIM(0.6,0.8)
aobscanmodule(aobCharMovementOffset,Borderlands3.exe,48 8B 89 ?? ?? 00 00 48 85 C9 0F 84 ?? ?? 00 00 F6 83 ?? ?? 00 00 04) //OPTIM(0.6,0.8)
aobscanmodule(aobCharWpnSlotOffset,Borderlands3.exe,48 8D B9 ?? ?? 00 00 48 89 D3 48 89 F9 E8 ?? ?? ?? ?? 84 C0 74 ?? 48 85 DB 75) //OPTIM(0.4,0.6)
aobscanmodule(aobMoveSpeedCalc,Borderlands3.exe,F3 0F 59 B3 ?? ?? 00 00 0F 28 C6 0F 28 74 24 ?? 48 83 C4 ?? 5B C3) //OPTIM(0.7,0.9)
aobscanmodule(aobJumpSpeedCalc,Borderlands3.exe,F3 0F 11 87 94 01 00 00 48) //OPTIM(0.6,0.8)
aobscanmodule(aobInvAmmoTaker,Borderlands3.exe,66 41 0F 6E F6 0F 5B F6 E8 ?? ?? ?? ?? 48 89 C1) //OPTIM(0.7,0.9)
aobscanmodule(aobClipAmmoTaker,Borderlands3.exe,48 89 74 24 38 8B F2) //OPTIM(0,0.2)
aobscanmodule(aobFireDelayCalc,Borderlands3.exe,F3 0F 5E B3 ?? ?? 00 00 0F 28 C6 0F 28 74 24 ?? 48 83 C4 ?? 5B C3) //OPTIM(0.7,0.9)
aobscanmodule(aobRecoilCalc,Borderlands3.exe,F3 0F 10 44 24 ?? B2 01 F3 0F 11 83 ?? ?? 00 00) //OPTIM(0.7,0.9)
aobscanmodule(aobSpreadGainCalc,Borderlands3.exe,0F 28 C1 41 B0 01 F3 0F 10 89 ?? ?? 00 00) //OPTIM(0.7,0.9)
aobscanmodule(aobWeaponHeatGainCalc,Borderlands3.exe,F3 0F 10 81 ?? ?? 00 00 0F 57 C9 0F 2E C1 48 89 CB) //OPTIM(0.7,0.9)
aobscanmodule(aobSpreadReader,Borderlands3.exe,F3 0F 10 81 ?? ?? 00 00 C3 49 C7 C4) //OPTIM(0.7,0.9)
aobscanmodule(aobPlayerHealthGrabber,Borderlands3.exe,48 89 C1 48 8D 54 24 ?? E8 ?? ?? ?? ?? 0F B6 44 24) //OPTIM(0.4,0.6)
aobscanmodule(aobHealthUpdateCalc,Borderlands3.exe,F3 0F 11 91 ?? ?? 00 00 45 84 C0 0F 85 ?? ?? ?? ?? 0F 2E A9 ?? ?? 00 00) //OPTIM(0,0.2)
aobscanmodule(aobChestChecker,Borderlands3.exe,80 79 ?? 01 48 0F 45 90 ?? ?? 00 00 48 83 C1 ?? E8) //OPTIM(0.7,0.9)
aobscanmodule(aobChestCostOffset,Borderlands3.exe,F3 41 0F 10 46 ?? 48 8D 55 ?? 48 89 D9 F3 0F 11 45 ?? C6 45 ?? 00) //OPTIM(0.7,0.9)
aobscanmodule(aobMagSpinRateCalc,Borderlands3.exe,F3 0F 58 86 ?? ?? 00 00 0F 2F C6 73 ?? 0F 57 C0 EB) //OPTIM(0.7,0.9)
Scanning time changed from 30 seconds to 4 seconds.
Of course there has to be additional Lua code which will interpret those OPTIM parameters.
Lua code would be this:
Code: Select all
local moduleInfos = {}
local function getModuleStartAndSize(moduleName)
local moduleAddress,moduleSize
if moduleInfos[moduleName]==nil then
moduleAddress = getAddressSafe(moduleName)
moduleSize = getModuleSize(moduleName)
moduleSize = ((moduleSize // 4096) + 1) * 4096
moduleInfos[moduleName] = {}
moduleInfos[moduleName].moduleAddress=moduleAddress
moduleInfos[moduleName].moduleSize=moduleSize
return moduleAddress,moduleSize
end
return moduleInfos[moduleName].moduleAddress,moduleInfos[moduleName].moduleSize
end
local function aobscanOptimized(script,syntaxcheck)
-- debugging
-- if not syntaxcheck then print(script.Text) end
local i=0
local params
while i<script.Count do
params = script[i]:lower():match'aobscanmodule%(.-%) //optim%(.-%)' and script[i]:match'%((.-)%)'
if params then
local varName,moduleName,pattern = params:match'%s*(.*%S)%s*,%s*(.*%S)%s*,%s*(.*%S)'
local low,high = script[i]:lower():match'//optim%(%s*(.*%S)%s*,%s*(.*%S)%s*%)'
local moduleAddress,moduleSize=getModuleStartAndSize(moduleName)
low = (tonumber(low ) * moduleSize + moduleAddress) //1
high = (tonumber(high) * moduleSize + moduleAddress) //1
low = string.format('%08X',low)
high = string.format('%08X',high)
script[i] = 'aobscanregion('..varName..','..low..','..high..','..pattern..')'
end
i=i+1
end
-- debugging
-- if not syntaxcheck then print(script.Text) end
end
if aobscanOptimizedRegistered then unregisterAutoAssemblerPrologue(aobscanOptimizedRegistered);aobscanOptimizedRegistered=nil end
aobscanOptimizedRegistered = registerAutoAssemblerPrologue(aobscanOptimized)
You can place it at the beginning of AA script, between {$Lua} and {$Asm} keywords.
Lua extension: AOBScanModuleOptimizer
[Link]
Has both methods:
Add this to autorun folder
Code: Select all
local moduleInfos = {}
local function getModuleStartAndSize(moduleName)
local moduleAddress,moduleSize
if moduleInfos[moduleName]==nil then
moduleAddress = getAddressSafe(moduleName)
moduleSize = getModuleSize(moduleName)
moduleSize = ((moduleSize // 4096) + 1) * 4096
moduleInfos[moduleName] = {}
moduleInfos[moduleName].moduleAddress=moduleAddress
moduleInfos[moduleName].moduleSize=moduleSize
return moduleAddress,moduleSize
end
return moduleInfos[moduleName].moduleAddress,moduleInfos[moduleName].moduleSize
end
--before aobscans
local function optimizatorStage1(script,syntaxcheck)
if not aobscanmoduleOPTIMIZATORenabled then return end
if syntaxcheck then return end
local i=0
AOBSCANMODULEOPTIMIZATOR = {}
while i<script.Count do
local entry = {}
entry.fullLine = script[i]
entry.lineNumber = i
local params = script[i]:lower():match'aobscanmodule%(.-%)' and script[i]:match'%((.-)%)'
if params then
local varName,moduleName,pattern = params:match'%s*(.*%S)%s*,%s*(.*%S)%s*,%s*(.*%S)'
entry.params = {varName=varName,moduleName=moduleName,pattern=pattern}
entry.fullLine = script[i]:sub(1,13)..'('..params..')'
end
AOBSCANMODULEOPTIMIZATOR[1+#AOBSCANMODULEOPTIMIZATOR] = entry
i=i+1
end
end
--after aobscans
local function optimizatorStage2(script,syntaxcheck)
if not aobscanmoduleOPTIMIZATORenabled then return end
if syntaxcheck then return end
for i,v in ipairs(AOBSCANMODULEOPTIMIZATOR) do
local params = script[v.lineNumber]:lower():match'define%(.*%)'
and script[v.lineNumber]:match'%((.*)%)'
if (params) and (v.params) then
local varName,address = params:match'%s*(.*%S)%s*,%s*(.*%S)%s*'
address = tonumber(address,16)
local moduleAddress,moduleSize=getModuleStartAndSize(v.params.moduleName)
local low = (((address-moduleAddress) / moduleSize) //aobscanmoduleOPTIMIZATORRadius *aobscanmoduleOPTIMIZATORRadius ) - aobscanmoduleOPTIMIZATORRadius
low = (low < 0 ) and 0 or low
local high = low + aobscanmoduleOPTIMIZATORRadius*2
v.fullLine = v.fullLine..' //OPTIM('..low..','..high..')'
end
end
for i,v in ipairs(AOBSCANMODULEOPTIMIZATOR) do
print(v.fullLine)
end
print("________________________________________________________")
end
optimizatorStage1Registered = registerAutoAssemblerPrologue(optimizatorStage1)
optimizatorStage2Registered = registerAutoAssemblerPrologue(optimizatorStage2,true)
Create new AA memory record with only aobscanmodule commands.
Execute this code in Lua Engine window:
Code: Select all
aobscanmoduleOPTIMIZATORenabled = true
aobscanmoduleOPTIMIZATORRadius = 0.20
you can experiment with aobscanmoduleOPTIMIZATORRadius value.
e.g. 0.20 for 600MB EXE file will give radius=120MB
activate memory record, wait, you should get results inside Lua Engine window. Select, copy and paste to any AA memory record you want. Save CT file.
Execute this code in Lua Engine window to disable optimizator (or just exit CE):
Code: Select all
aobscanmoduleOPTIMIZATORenabled = false