├── .gitattributes
├── .gitignore
├── BetterConsole.vcxproj
├── BetterConsole.vcxproj.filters
├── BetterConsole.vcxproj.user
├── Console.cpp
├── Console.h
├── GameData.cpp
├── GameData.h
├── HookUtil.cpp
├── HookUtil.h
├── README.md
├── RTTI.txt
├── Resource.aps
├── Resource.rc
├── Scaleform.cpp
├── Scaleform.h
├── Settings.cpp
├── Settings.h
├── archive.txt
├── exports.def
├── main.cpp
├── papyrus.txt
└── resource.h
/.gitattributes:
--------------------------------------------------------------------------------
1 | # Auto detect text files and perform LF normalization
2 | * text=auto
3 |
4 | # Custom for Visual Studio
5 | *.cs diff=csharp
6 |
7 | # Standard to msysgit
8 | *.doc diff=astextplain
9 | *.DOC diff=astextplain
10 | *.docx diff=astextplain
11 | *.DOCX diff=astextplain
12 | *.dot diff=astextplain
13 | *.DOT diff=astextplain
14 | *.pdf diff=astextplain
15 | *.PDF diff=astextplain
16 | *.rtf diff=astextplain
17 | *.RTF diff=astextplain
18 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | # Windows image file caches
2 | Thumbs.db
3 | ehthumbs.db
4 |
5 | # Folder config file
6 | Desktop.ini
7 |
8 | # Recycle Bin used on file shares
9 | $RECYCLE.BIN/
10 |
11 | # Windows Installer files
12 | *.cab
13 | *.msi
14 | *.msm
15 | *.msp
16 | *.log
17 | *.tlog
18 | *.obj
19 | *.pdb
20 | *.idb
21 | *.res
22 |
23 |
24 | # Windows shortcuts
25 | *.lnk
26 |
27 | # =========================
28 | # Operating System Files
29 | # =========================
30 |
31 | # OSX
32 | # =========================
33 |
34 | .DS_Store
35 | .AppleDouble
36 | .LSOverride
37 |
38 | # Thumbnails
39 | ._*
40 |
41 | # Files that might appear in the root of a volume
42 | .DocumentRevisions-V100
43 | .fseventsd
44 | .Spotlight-V100
45 | .TemporaryItems
46 | .Trashes
47 | .VolumeIcon.icns
48 |
49 | # Directories potentially created on remote AFP share
50 | .AppleDB
51 | .AppleDesktop
52 | .x64
53 | Network Trash Folder
54 | Temporary Items
55 | .apdisk
56 |
--------------------------------------------------------------------------------
/BetterConsole.vcxproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Debug
6 | Win32
7 |
8 |
9 | Release
10 | Win32
11 |
12 |
13 | Debug
14 | x64
15 |
16 |
17 | Release
18 | x64
19 |
20 |
21 |
22 | {A92D7D6B-1517-4FE5-B419-422C055062AB}
23 | Win32Proj
24 | BetterConsole
25 | 10.0.16299.0
26 |
27 |
28 |
29 | DynamicLibrary
30 | true
31 | v141
32 | Unicode
33 |
34 |
35 | DynamicLibrary
36 | false
37 | v141
38 | true
39 | Unicode
40 |
41 |
42 | DynamicLibrary
43 | true
44 | v141
45 | MultiByte
46 |
47 |
48 | DynamicLibrary
49 | false
50 | v141
51 | true
52 | MultiByte
53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 |
72 |
73 | true
74 |
75 |
76 | true
77 | ..\..\..\SteamLibrary\steamapps\common\Fallout 4\Data\F4SE\Plugins
78 |
79 |
80 | false
81 |
82 |
83 | false
84 | E:\SteamLibrary\steamapps\common\Fallout 4\Data\F4SE\Plugins\
85 |
86 |
87 |
88 |
89 |
90 | Level3
91 | Disabled
92 | WIN32;_DEBUG;_WINDOWS;_USRDLL;BETTERCONSOLE_EXPORTS;%(PreprocessorDefinitions)
93 |
94 |
95 | Windows
96 | true
97 | exports.def
98 |
99 |
100 |
101 |
102 |
103 |
104 | Level3
105 | Disabled
106 | _DEBUG;_WINDOWS;_USRDLL;BETTERCONSOLE_EXPORTS;%(PreprocessorDefinitions)
107 | $(SolutionDir);$(SolutionDir)\..
108 | common/IPrefix.h
109 | MultiThreadedDebug
110 |
111 |
112 | Windows
113 | true
114 | exports.def
115 |
116 |
117 |
118 |
119 | Level3
120 |
121 |
122 | MaxSpeed
123 | true
124 | true
125 | WIN32;NDEBUG;_WINDOWS;_USRDLL;BETTERCONSOLE_EXPORTS;%(PreprocessorDefinitions)
126 |
127 |
128 | Windows
129 | true
130 | true
131 | true
132 | exports.def
133 |
134 |
135 |
136 |
137 | Level3
138 |
139 |
140 | MaxSpeed
141 | true
142 | true
143 | NDEBUG;_WINDOWS;_USRDLL;BETTERCONSOLE_EXPORTS;%(PreprocessorDefinitions)
144 | $(SolutionDir);$(SolutionDir)\..
145 | common/IPrefix.h
146 | MultiThreaded
147 | false
148 |
149 |
150 | Windows
151 | true
152 | true
153 | true
154 | exports.def
155 |
156 |
157 |
158 |
159 |
160 |
161 |
162 |
163 |
164 |
165 |
166 |
167 | {d4c128a1-73dc-4941-a453-ce55af239ba8}
168 |
169 |
170 | {a236f69d-8ff9-4491-ac5f-45bf49448bbe}
171 |
172 |
173 | {20c6411c-596f-4b85-be4e-8bc91f59d8a6}
174 |
175 |
176 | {83d27534-600c-47b8-8c39-05ba34c3224e}
177 |
178 |
179 |
180 |
181 |
182 |
183 |
184 |
185 |
186 |
187 |
188 |
189 |
190 |
191 |
192 |
193 |
194 |
195 |
196 |
197 |
198 |
199 |
200 |
201 |
202 |
--------------------------------------------------------------------------------
/BetterConsole.vcxproj.filters:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF}
6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx
7 |
8 |
9 | {93995380-89BD-4b04-88EB-625FBE52EBFB}
10 | h;hh;hpp;hxx;hm;inl;inc;xsd
11 |
12 |
13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01}
14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms
15 |
16 |
17 |
18 |
19 | Source Files
20 |
21 |
22 | Source Files
23 |
24 |
25 | Source Files
26 |
27 |
28 | Source Files
29 |
30 |
31 | Source Files
32 |
33 |
34 | Source Files
35 |
36 |
37 |
38 |
39 | Header Files
40 |
41 |
42 | Header Files
43 |
44 |
45 | Header Files
46 |
47 |
48 | Header Files
49 |
50 |
51 | Header Files
52 |
53 |
54 | Header Files
55 |
56 |
57 |
58 |
59 | Resource Files
60 |
61 |
62 | Resource Files
63 |
64 |
65 | Resource Files
66 |
67 |
68 | Resource Files
69 |
70 |
71 |
72 |
73 | Resource Files
74 |
75 |
76 |
77 |
78 | Resource Files
79 |
80 |
81 |
--------------------------------------------------------------------------------
/BetterConsole.vcxproj.user:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | false
5 | WindowsLocalDebugger
6 | E:\SteamLibrary\steamapps\common\Fallout 4\Fallout4.exe
7 | Mixed
8 |
9 |
10 | E:\SteamLibrary\steamapps\common\Fallout 4\Fallout4.exe
11 | ..\..\..\SteamLibrary\steamapps\common\Fallout 4\Data\F4SE\Plugins
12 | NativeOnly
13 | WindowsLocalDebugger
14 |
15 |
--------------------------------------------------------------------------------
/Console.cpp:
--------------------------------------------------------------------------------
1 | //#include "Console.h"
2 | //#include "GameData.h"
3 | //#include "F4SE/ObScript.h"
4 | //
5 | //
6 | //#include "F4SE_common/SafeWrite.h"
7 | //
8 | //#include
9 | //
10 | //bool DumpClass_Execute(const ObScriptParam * paramInfo, ObScriptCommand::ScriptData * scriptData, TESObjectREFR * thisObj, void * containingObj, void * scriptObj, void * locals, double& result, UInt32& opcodeOffsetPtr)
11 | //{
12 | // ObScriptCommand::StringChunk *strChunk = (ObScriptCommand::StringChunk*)scriptData->GetChunk();
13 | //
14 | // std::string target = strChunk->GetString();
15 | //
16 | // char * pTerminal = &target[target.size() - 1];
17 | //
18 | // long iTarget = strtol(&target[0], &pTerminal, 0x10);
19 | //
20 | // ObScriptCommand::IntegerChunk *intChunk = (ObScriptCommand::IntegerChunk*)strChunk->GetNext();
21 | // int val = intChunk->GetInteger();
22 | //
23 | // _MESSAGE("%s %08X %d", __FUNCTION__, iTarget, val);
24 | //
25 | // DumpClass(reinterpret_cast(iTarget), val);
26 | //
27 | // return true;
28 | //}
29 | //
30 | //
31 | //
32 | //
33 | //void CollectEffects(Actor* actor)
34 | //{
35 | // auto pMaigicTarget = &actor->magicTarget;
36 | // auto fnGetEffectList = (BSSimpleList * (**)(MagicTarget*))(*(uintptr_t*)pMaigicTarget + 0x38);
37 | // BSSimpleList * pEffectList = (*fnGetEffectList)(pMaigicTarget);
38 | //
39 | // if (pEffectList != nullptr)
40 | // {
41 | // ++pEffectList->refCount;
42 | // _MESSAGE("");
43 | // for (size_t i = 0; i < pEffectList->count; ++i)
44 | // {
45 | // _MESSAGE(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>> DumpIndex: %d", i);
46 | // auto pEffect = pEffectList->items[i];
47 | // if (pEffect != nullptr)
48 | // {
49 | // _MESSAGE("className: %s VTBL: %016I64X", GetObjectClassName(pEffect), *(uintptr_t*)pEffect);
50 | // //_MESSAGE(" %.2f | %d | %08X %.2f | %d | %08X %.2f | %d | %08X %.2f | %d | %08X", pEffect->effect->magnitude, pEffect->effect->magnitude, pEffect->effect->magnitude, pEffect->effect->area, pEffect->effect->area, pEffect->effect->area, pEffect->effect->duration, pEffect->effect->duration, pEffect->effect->duration, pEffect->effect->unk0C, pEffect->effect->unk0C, pEffect->effect->unk0C);
51 | // //_MESSAGE(" %.2f | %d | %08X %.2f | %d | %08X %.2f | %d | %08X %.2f | %d | %08X", pEffect->elapsed, pEffect->elapsed, pEffect->elapsed, pEffect->duration, pEffect->duration, pEffect->duration, pEffect->magnitude, pEffect->magnitude, pEffect->magnitude, pEffect->flags, pEffect->flags, pEffect->flags);
52 | // RelocAddr fnGetEffectSetting = 0xC351A0;
53 | // auto pEffectSetting = fnGetEffectSetting(pEffect);
54 | // if (pEffectSetting != nullptr)
55 | // {
56 | // RelocAddr fnLookUpRefByHandle = 0x23870;
57 | // _MESSAGE("MagicEffect:");
58 | // _MESSAGE("duratin: %.2f", pEffect->duration);
59 | // _MESSAGE("elapsed: %.2f", pEffect->elapsed);
60 | // _MESSAGE("magnitude: %.2f", pEffect->magnitude);
61 | // _MESSAGE("flags: %08X", pEffect->flags);
62 | // if (pEffect->item)
63 | // {
64 | // TESFullName* pFullName = DYNAMIC_CAST(pEffect->item, MagicItem, TESFullName);
65 | // if (pFullName != nullptr)
66 | // {
67 | // _MESSAGE("spellID: %08X", pEffect->item->formID);
68 | // _MESSAGE("spellName: %s", pFullName->name.c_str());
69 | // }
70 | // }
71 | // TESFullName* pFullName = DYNAMIC_CAST(pEffectSetting, EffectSetting, TESFullName);
72 | // if (pFullName != nullptr)
73 | // {
74 | // _MESSAGE("EffectSetting:");
75 | // _MESSAGE("mgefName: %s", pFullName->name.c_str());
76 | // _MESSAGE("effectFlag: %08X", pEffectSetting->flags);
77 | // _MESSAGE("formID: %08X", pEffectSetting->formID);
78 | // }
79 | // }
80 | // _MESSAGE("");
81 | // }
82 | // }
83 | // --pEffectList->refCount;
84 | // }
85 | //}
86 | //
87 | //bool DumpConsoleTarget_Execute(const ObScriptParam * paramInfo, ObScriptCommand::ScriptData * scriptData, TESObjectREFR * thisObj, void * containingObj, void * scriptObj, void * locals, double& result, UInt32& opcodeOffsetPtr)
88 | //{
89 | // TESObjectREFR* pRef = nullptr;
90 | // LookupREFRByHandle(g_consoleHandle, &pRef);
91 | // if (pRef != nullptr)
92 | // {
93 | // Console_Print(" ");
94 | // Console_Print("> refFormID: %08X", pRef->formID);
95 | // Console_Print("> refFormType: %d", pRef->formType);
96 | // Console_Print("> refAddress: %016I64X", (uintptr_t)pRef);
97 | // Console_Print("> fullName: %s", CALL_MEMBER_FN(pRef, GetReferenceName)());
98 | // Console_Print("> refEditorID: %s", pRef->GetEditorID());
99 | // }
100 | //
101 | // return true;
102 | //}
103 | //
104 | //
105 | //void RegisterCommands()
106 | //{
107 | // RelocAddr fnDumpScriptCommands = 0x4EB660;
108 | // for (uint32_t i = 0; i < 0x1333; ++i)
109 | // {
110 | // ObScriptCommand* pCommand = fnDumpScriptCommands(i);
111 | //
112 | // if (pCommand != nullptr && pCommand->longName && pCommand->longName[0] && pCommand->opcode)
113 | // {
114 | // _MESSAGE("");
115 | // _MESSAGE("longName : %s", pCommand->longName);
116 | // _MESSAGE("shortName: %s", pCommand->shortName);
117 | // _MESSAGE("opCode: %d", pCommand->opcode);
118 | // _MESSAGE("command: %08I64X", (uintptr_t)pCommand - (uintptr_t)GetModuleHandle(NULL));
119 | // }
120 | //
121 | // if (pCommand != nullptr && pCommand->longName && !strcmp(pCommand->longName, "CellInfo"))
122 | // {
123 | // static ObScriptParam params[] = {
124 | // { "String", ObScriptParam::kType_String, 0 },
125 | // { "Integer", ObScriptParam::kType_Integer, 0 }
126 | // };
127 | //
128 | // ObScriptCommand cmd = *pCommand;
129 | //
130 | // cmd.longName = "DumpClass";
131 | // cmd.shortName = "dc";
132 | // cmd.helpText = "";
133 | // cmd.needsParent = 0;
134 | // cmd.numParams = 2;
135 | // cmd.params = params;
136 | // cmd.execute = (ObScript_Execute)DumpClass_Execute;
137 | // cmd.flags = 0;
138 | //
139 | // SafeWriteBuf((uintptr_t)pCommand, &cmd, sizeof(cmd));
140 | // }
141 | //
142 | // if (pCommand != nullptr && pCommand->longName && !strcmp(pCommand->longName, "SetGamma"))
143 | // {
144 | // ObScriptCommand cmd = *pCommand;
145 | //
146 | // cmd.longName = "DumpConsoleClass";
147 | // cmd.shortName = "dcc";
148 | // cmd.helpText = "";
149 | // cmd.needsParent = 0;
150 | // cmd.numParams = 0;
151 | // cmd.params = nullptr;
152 | // cmd.execute = (ObScript_Execute)DumpConsoleTarget_Execute;
153 | // cmd.flags = 0;
154 | //
155 | // SafeWriteBuf((uintptr_t)pCommand, &cmd, sizeof(cmd));
156 | // }
157 | // }
158 | //
159 | //
160 | //}
--------------------------------------------------------------------------------
/Console.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 |
3 | void RegisterCommands();
--------------------------------------------------------------------------------
/GameData.cpp:
--------------------------------------------------------------------------------
1 | #include "GameData.h"
2 | #include "F4SE_common/F4SE_version.h"
3 | #include "F4SE_common/Relocation.h"
4 | #include "F4SE_common/SafeWrite.h"
5 |
6 | //RelocAddr g_actorValues(0x585B270);
7 |
8 | uintptr_t HasPerkVisitor::Accept(Entry* pEntry) //bool, don't use bool,VS2015 compiler seems has a bug.
9 | {
10 | if (pEntry != nullptr && pEntry->perk != nullptr)
11 | {
12 | result.push_back(Entry{ pEntry->perk, pEntry->rank });
13 | }
14 | return 1;
15 | }
16 |
17 |
--------------------------------------------------------------------------------
/GameData.h:
--------------------------------------------------------------------------------
1 | #pragma once
2 | #include "F4SE/GameData.h"
3 | #include "F4SE/GameReferences.h"
4 | #include "F4SE/GameAPI.h"
5 | #include "F4SE/GameRTTI.h"
6 | #include "F4SE/GameExtraData.h"
7 |
8 |
9 | #include