How to use the Give Resource script
[ The code snippets below are from v1.1.1 version of the game. Just so you know in the future ]
Alright. Been working on this one for quite a while now, namely gathering data to be used with it. I've done quite a bit of debugging to determine where exactly Dunia is adding resources to your inventory (especially since the fuckers @ Ubi use VMProtect mutation in the function decoding/encoding the values; read here:
viewtopic.php?p=216819#p216819) and what would the function arguments be. Figured out the logic happens here:
Code: Select all
FC_m64d3d12.dll+1F04602 - 48 8B 07 - mov rax,[rdi]
FC_m64d3d12.dll+1F04605 - 45 8B C6 - mov r8d,r14d
FC_m64d3d12.dll+1F04608 - 44 8B 4C 24 34 - mov r9d,[rsp+34]
FC_m64d3d12.dll+1F0460D - 48 8B CF - mov rcx,rdi
FC_m64d3d12.dll+1F04610 - 48 8B 16 - mov rdx,[rsi]
FC_m64d3d12.dll+1F04613 - FF 90 58010000 - call qword ptr [rax+00000158]
FC_m64d3d12.dll+1F04619 - 44 8B E8 - mov r13d,eax
The dynamic CALL goes into this function:
Code: Select all
FC_m64d3d12.dll+2A5FD40 - 48 89 6C 24 10 - mov [rsp+10],rbp
FC_m64d3d12.dll+2A5FD45 - 48 89 74 24 18 - mov [rsp+18],rsi
FC_m64d3d12.dll+2A5FD4A - 48 89 7C 24 20 - mov [rsp+20],rdi
FC_m64d3d12.dll+2A5FD4F - 41 56 - push r14
FC_m64d3d12.dll+2A5FD51 - 48 83 EC 30 - sub rsp,30 { 48 }
FC_m64d3d12.dll+2A5FD55 - 48 8B F9 - mov rdi,rcx
FC_m64d3d12.dll+2A5FD58 - 49 63 E9 - movsxd rbp,r9d
FC_m64d3d12.dll+2A5FD5B - 48 8B CA - mov rcx,rdx
FC_m64d3d12.dll+2A5FD5E - 45 8B F0 - mov r14d,r8d
FC_m64d3d12.dll+2A5FD61 - 48 8B F2 - mov rsi,rdx
FC_m64d3d12.dll+2A5FD64 - E8 B72B8BFF - call FC_m64d3d12.dll+2312920
FC_m64d3d12.dll+2A5FD69 - 84 C0 - test al,al
FC_m64d3d12.dll+2A5FD6B - 74 25 - je FC_m64d3d12.dll+2A5FD92
FC_m64d3d12.dll+2A5FD6D - 48 8B CF - mov rcx,rdi
FC_m64d3d12.dll+2A5FD70 - E8 DB450200 - call FC_m64d3d12.dll+2A84350
FC_m64d3d12.dll+2A5FD75 - 48 85 C0 - test rax,rax
FC_m64d3d12.dll+2A5FD78 - 74 18 - je FC_m64d3d12.dll+2A5FD92
FC_m64d3d12.dll+2A5FD7A - 4C 8B 10 - mov r10,[rax]
FC_m64d3d12.dll+2A5FD7D - 44 8B CD - mov r9d,ebp
FC_m64d3d12.dll+2A5FD80 - 45 8B C6 - mov r8d,r14d
FC_m64d3d12.dll+2A5FD83 - 48 8B D6 - mov rdx,rsi
FC_m64d3d12.dll+2A5FD86 - 48 8B C8 - mov rcx,rax
FC_m64d3d12.dll+2A5FD89 - 41 FF 92 58010000 - call qword ptr [r10+00000158]
FC_m64d3d12.dll+2A5FD90 - EB 50 - jmp FC_m64d3d12.dll+2A5FDE2
FC_m64d3d12.dll+2A5FD92 - 44 8B CD - mov r9d,ebp
FC_m64d3d12.dll+2A5FD95 - 48 89 5C 24 40 - mov [rsp+40],rbx
FC_m64d3d12.dll+2A5FD9A - 45 8B C6 - mov r8d,r14d
FC_m64d3d12.dll+2A5FD9D - C6 44 24 20 01 - mov byte ptr [rsp+20],01 { 1 }
FC_m64d3d12.dll+2A5FDA2 - 48 8B D6 - mov rdx,rsi
FC_m64d3d12.dll+2A5FDA5 - 48 8B CF - mov rcx,rdi
FC_m64d3d12.dll+2A5FDA8 - E8 03130000 - call FC_m64d3d12.dll+2A610B0
FC_m64d3d12.dll+2A5FDAD - 8B D8 - mov ebx,eax
FC_m64d3d12.dll+2A5FDAF - 85 C0 - test eax,eax
FC_m64d3d12.dll+2A5FDB1 - 74 28 - je FC_m64d3d12.dll+2A5FDDB
FC_m64d3d12.dll+2A5FDB3 - 4D 8B CE - mov r9,r14
FC_m64d3d12.dll+2A5FDB6 - 48 89 6C 24 20 - mov [rsp+20],rbp
FC_m64d3d12.dll+2A5FDBB - 4C 8B C6 - mov r8,rsi
FC_m64d3d12.dll+2A5FDBE - 33 D2 - xor edx,edx
FC_m64d3d12.dll+2A5FDC0 - 48 8B CF - mov rcx,rdi
FC_m64d3d12.dll+2A5FDC3 - E8 78830600 - call FC_m64d3d12.dll+2AC8140
FC_m64d3d12.dll+2A5FDC8 - 48 8B 0D A9CC3C04 - mov rcx,[FC_m64d3d12.dll+6E2CA78] { (21618A84150) }
FC_m64d3d12.dll+2A5FDCF - 48 85 C9 - test rcx,rcx
FC_m64d3d12.dll+2A5FDD2 - 74 07 - je FC_m64d3d12.dll+2A5FDDB
FC_m64d3d12.dll+2A5FDD4 - 33 D2 - xor edx,edx
FC_m64d3d12.dll+2A5FDD6 - E8 D57A2CFF - call FC_m64d3d12.dll+1D278B0
FC_m64d3d12.dll+2A5FDDB - 8B C3 - mov eax,ebx
FC_m64d3d12.dll+2A5FDDD - 48 8B 5C 24 40 - mov rbx,[rsp+40]
FC_m64d3d12.dll+2A5FDE2 - 48 8B 6C 24 48 - mov rbp,[rsp+48]
FC_m64d3d12.dll+2A5FDE7 - 48 8B 74 24 50 - mov rsi,[rsp+50]
FC_m64d3d12.dll+2A5FDEC - 48 8B 7C 24 58 - mov rdi,[rsp+58]
FC_m64d3d12.dll+2A5FDF1 - 48 83 C4 30 - add rsp,30 { 48 }
FC_m64d3d12.dll+2A5FDF5 - 41 5E - pop r14
FC_m64d3d12.dll+2A5FDF7 - C3 - ret
And the args are:
- rcx == CInventoryComponent
So the function goes like this:
CInventoryComponent::GiveResourceByHash( hash, quantity, type ). Keep in mind rcx is self-implied, as this is a
virtual function. In Cheat Engine Lua you will see 4 arguments, as the class has to be explicitly declared (see Give Resource script):
Code: Select all
line 25: executeCodeEx( 0, nil, GiveResource, CInventoryComponent, hash, quantity, index )
To get to the
CInventoryComponent:
local CInventoryComponent = readQword( CPawn + 0x178 ) It's stored in our CPawn which my [ Enable ] script conveniently exposes.
So I started from the above figuring out how to add resources. Then I realized the function can grant a shit load of other stuff:
- time savers (revealing icons on map for chests, idols, roosters, usb sticks, jewelry boxes, fishing/hunting spots, etc.)
So I started collecting them:
Some are tested, left in comments, some aren't, so please chime in where possible with at least naming them. How to help: see the last section.
How to use the FC6_items.xlsx file in conjunction with above script
When you open the Excel file you will see 3 tabs:
The first two are to be used with Give Resource script. The last one has another purpose (explained here:
viewtopic.php?p=217584#p217584).
If you want to REVEAL ICONS ON THE MAP, then:
- right-click script > Change script
- edit line 19: index = 0x7 to index = 0x1B (see column E in the Excel sheet)
- click the checkbox in front of the script
- fill the input field with hash|qty values (e.g.: 00200792424EDCA6|1 -- will give you the Jewelry reveal time saver)
Repeat the above for
Resources sheet.
NOTES:
- for now there aren't any "quick" ways to get EVERYTHING you want, so please don't barge in asking for 'simpler' methods
- in general, if you don't need a specific quantity of an item, use the default 1 (e.g.: keys don't have quantities > 1; only resources do)
How to help out
The two sheets have several entries on column B that are blank. What you can do is open up the Excel file, get the item from a line and pay attention at the screen when granted. Then open Inventory, head to the item and type in its in-game name on this column. Like I did here:
The more you can fill in, the better. Share the updated file here or PM me.
Happy hacking,
Sun