fe2a6db786
rust / build / test / clippy / fmt (push) Has been cancelled
Layout:
- src/ .NET 10 x64 reference: MxNativeCodec, MxNativeClient,
MxAsbClient, probes, tests, harnesses. Executable spec.
- design/ Architectural plan for the Rust port (M0–M6), error
model, protocol invariants, risks (R1–R16), adversarial
review log (review.md).
- rust/ Rust workspace. M0 skeleton + M1 codec parity.
mxaccess-codec: 215 unit tests + 2 cross-implementation
parity tests (byte-identical against .NET reference).
Other crates are M0 stubs awaiting M2+.
- captures/ Frida + netsh + pcap evidence per CLAUDE.md
("captures are evidence, not throwaway logs").
- analysis/ Decompiled C# (frida/proxy/decompiled-*),
Ghidra exports for native DLLs (`exports/` only —
working state at `projects/` and AVEVA's input
binaries at `input/` are gitignored).
- docs/ Reverse-engineering reference docs.
- tools/ Setup-LiveProbeEnv.ps1 (Infisical credential fetcher),
Compute-Crc.ps1 (.NET parity helper).
- .github/workflows/ Rust CI: fmt + build + test + clippy on Windows.
- LICENSE MIT (Joseph Doherty, 2026).
Verified:
- cargo test --workspace → 217 passed (215 unit + 2 .NET parity), 0 failed
- cargo clippy --workspace -- -D warnings → clean
- cargo fmt --all -- --check → clean
- cargo publish --dry-run -p mxaccess-codec → packages cleanly
Excluded from history (see .gitignore):
- **/bin, **/obj, **/target — build artifacts
- analysis/ghidra/projects/ — Ghidra working state (regenerable)
- analysis/ghidra/input/ — AVEVA proprietary DLLs (vendor IP)
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
367 lines
15 KiB
Markdown
367 lines
15 KiB
Markdown
# LmxProxy.dll selected decompile
|
|
|
|
## FUN_1001121d at 1001121d
|
|
|
|
Signature: `int __stdcall FUN_1001121d(int * param_1, int param_2, BSTR param_3, undefined4 param_4, int * param_5)`
|
|
|
|
```c
|
|
|
|
/* WARNING: Function: __EH_prolog3 replaced with injection: EH_prolog3 */
|
|
/* WARNING: Function: __EH_epilog3 replaced with injection: EH_epilog3 */
|
|
|
|
int FUN_1001121d(int *param_1,int param_2,BSTR param_3,undefined4 param_4,int *param_5)
|
|
|
|
{
|
|
int *this;
|
|
int *piVar1;
|
|
char cVar2;
|
|
basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> bVar3;
|
|
undefined1 uVar4;
|
|
undefined *puVar5;
|
|
int iVar6;
|
|
int *piVar7;
|
|
basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> *pbVar8;
|
|
int *piVar9;
|
|
rsize_t rVar10;
|
|
int iVar11;
|
|
uint uVar12;
|
|
BSTR pOVar13;
|
|
undefined4 uVar14;
|
|
wchar_t *pwVar15;
|
|
_func_basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>_ptr_basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>_ptr
|
|
*p_Var16;
|
|
|
|
piVar7 = param_1;
|
|
this = param_1 + -2;
|
|
cVar2 = FUN_1000d2d6((int)this);
|
|
piVar1 = param_5;
|
|
if (cVar2 == '\0') {
|
|
uVar14 = 0;
|
|
uVar12 = 1;
|
|
puVar5 = FUN_10003248();
|
|
iVar6 = FUN_10003897(puVar5,uVar12);
|
|
puVar5 = FUN_10003248();
|
|
uVar12 = FUN_1000305b(puVar5,iVar6,uVar14);
|
|
if ((char)uVar12 != '\0') {
|
|
pwVar15 =
|
|
L"Failed to retrieve information from the MXAccess_Runtime license. Either MXAccess_Runtime license is not available or expired."
|
|
;
|
|
piVar7 = (int *)FUN_10003248();
|
|
FUN_100030ef(piVar7,pwVar15);
|
|
}
|
|
bVar3 = FUN_10003f01(*(basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> **)
|
|
(DAT_100294e0 + 0xc));
|
|
if (bVar3 != (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>)0x0) {
|
|
pwVar15 = L" No Valid License found - returning E_ACCESSDENIED HRESULT";
|
|
p_Var16 = endl_exref;
|
|
uVar4 = FUN_1000d2d6((int)this);
|
|
pbVar8 = (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> *)
|
|
FUN_10002dbf(*(int **)(DAT_100294e0 + 0xc),
|
|
L"CLMXProxyServer::AddBufferedItem - Valid License: ");
|
|
pbVar8 = std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<
|
|
(pbVar8,(bool)uVar4);
|
|
pbVar8 = (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> *)
|
|
FUN_10002dbf((int *)pbVar8,pwVar15);
|
|
std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<(pbVar8,p_Var16);
|
|
}
|
|
iVar6 = -0x7ff8fffb;
|
|
}
|
|
else if (param_3 == (BSTR)0x0) {
|
|
bVar3 = FUN_10003f01(*(basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> **)
|
|
(DAT_100294e0 + 0xc));
|
|
if (bVar3 != (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>)0x0) {
|
|
pwVar15 = L" Item name NULL - returning E_INVALIDARG HRESULT";
|
|
iVar6 = param_2;
|
|
p_Var16 = endl_exref;
|
|
pbVar8 = (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> *)
|
|
FUN_10002dbf(*(int **)(DAT_100294e0 + 0xc),
|
|
L"CLMXProxyServer::AddBufferedItem - Server Handle: ");
|
|
pbVar8 = std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<
|
|
(pbVar8,iVar6);
|
|
pbVar8 = (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> *)
|
|
FUN_10002dbf((int *)pbVar8,pwVar15);
|
|
std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<(pbVar8,p_Var16);
|
|
}
|
|
iVar6 = -0x7ff8ffa9;
|
|
}
|
|
else {
|
|
bVar3 = FUN_10003f01(*(basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> **)
|
|
(DAT_100294e0 + 0xc));
|
|
if (piVar1 == (int *)0x0) {
|
|
if (bVar3 != (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>)0x0) {
|
|
pwVar15 = L" Item handle is NULL - returning E_POINTER HRESULT";
|
|
iVar6 = param_2;
|
|
p_Var16 = endl_exref;
|
|
pbVar8 = (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> *)
|
|
FUN_10002dbf(*(int **)(DAT_100294e0 + 0xc),
|
|
L"CLMXProxyServer::AddBufferedItem - Server Handle: ");
|
|
pbVar8 = std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<
|
|
(pbVar8,iVar6);
|
|
pbVar8 = (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> *)
|
|
FUN_10002dbf((int *)pbVar8,pwVar15);
|
|
std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<(pbVar8,p_Var16);
|
|
}
|
|
iVar6 = -0x7fffbffd;
|
|
}
|
|
else {
|
|
if (bVar3 != (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>)0x0) {
|
|
pwVar15 = L" Item name: ";
|
|
iVar6 = param_2;
|
|
pOVar13 = param_3;
|
|
p_Var16 = endl_exref;
|
|
pbVar8 = (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> *)
|
|
FUN_10002dbf(*(int **)(DAT_100294e0 + 0xc),
|
|
L"CLMXProxyServer::AddBufferedItem - Server Handle: ");
|
|
pbVar8 = std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<
|
|
(pbVar8,iVar6);
|
|
piVar9 = (int *)FUN_10002dbf((int *)pbVar8,pwVar15);
|
|
pbVar8 = (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> *)
|
|
FUN_10002dbf(piVar9,pOVar13);
|
|
std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<(pbVar8,p_Var16);
|
|
}
|
|
param_3 = SysAllocString(param_3);
|
|
if (param_3 == (BSTR)0x0) {
|
|
FUN_10005da7(0x8007000e,(OLECHAR *)0x0,
|
|
"D:\\BldSrc\\6\\s\\SharedComponents\\Internal\\MagellanPublic\\Includes\\ClassUtilities\\AAComBSTR.h"
|
|
,0xc5);
|
|
}
|
|
rVar10 = lstrlenW(L".property(buffer)");
|
|
FUN_10010a84(¶m_3,L".property(buffer)",rVar10);
|
|
iVar6 = (**(code **)(*piVar7 + 0x44))(piVar7,param_2,param_3,param_4,piVar1);
|
|
if (-1 < iVar6) {
|
|
param_1 = (int *)0x0;
|
|
bVar3 = FUN_10003f01(*(basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> **)
|
|
(DAT_100294e0 + 0xc));
|
|
if (bVar3 != (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>)0x0) {
|
|
iVar6 = *piVar1;
|
|
pwVar15 = L" Item Handle ";
|
|
iVar11 = param_2;
|
|
p_Var16 = endl_exref;
|
|
pbVar8 = (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> *)
|
|
FUN_10002dbf(*(int **)(DAT_100294e0 + 0xc),
|
|
L"CLMXProxyServer::AddBufferedItem - Server Handle ");
|
|
pbVar8 = std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<
|
|
(pbVar8,iVar11);
|
|
pbVar8 = (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> *)
|
|
FUN_10002dbf((int *)pbVar8,pwVar15);
|
|
pbVar8 = std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<
|
|
(pbVar8,iVar6);
|
|
std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<(pbVar8,p_Var16);
|
|
}
|
|
iVar6 = FUN_1000fa3b(this,param_2,*piVar1,¶m_2,(int *)¶m_1);
|
|
if (-1 < iVar6) {
|
|
*(undefined1 *)(param_1 + 10) = 1;
|
|
}
|
|
}
|
|
SysFreeString(param_3);
|
|
}
|
|
}
|
|
return iVar6;
|
|
}
|
|
|
|
|
|
```
|
|
|
|
## FUN_100163c0 at 100163c0
|
|
|
|
Signature: `undefined __thiscall FUN_100163c0(void * this, long param_1, long param_2, undefined4 param_3)`
|
|
|
|
```c
|
|
|
|
/* WARNING: Function: __EH_prolog3 replaced with injection: EH_prolog3 */
|
|
/* WARNING: Function: __EH_epilog3 replaced with injection: EH_epilog3 */
|
|
|
|
void __thiscall FUN_100163c0(void *this,long param_1,long param_2,undefined4 param_3)
|
|
|
|
{
|
|
basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> bVar1;
|
|
undefined4 *puVar2;
|
|
int *piVar3;
|
|
basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> *pbVar4;
|
|
undefined4 *this_00;
|
|
undefined4 in_stack_00000040;
|
|
long lVar5;
|
|
wchar_t *pwVar6;
|
|
long lVar7;
|
|
_func_basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>_ptr_basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>_ptr
|
|
*p_Var8;
|
|
undefined4 *local_30;
|
|
undefined4 local_2c;
|
|
undefined4 local_28;
|
|
undefined4 local_24;
|
|
int *local_20;
|
|
int local_1c;
|
|
void *local_18;
|
|
int local_14;
|
|
undefined4 local_8;
|
|
undefined4 uStack_4;
|
|
|
|
uStack_4 = 0x20;
|
|
local_8 = 0x100163cc;
|
|
puVar2 = (undefined4 *)FUN_100170a4(0x74);
|
|
if (puVar2 == (undefined4 *)0x0) {
|
|
this_00 = (undefined4 *)0x0;
|
|
}
|
|
else {
|
|
this_00 = puVar2 + 1;
|
|
*puVar2 = 7;
|
|
_eh_vector_constructor_iterator_(this_00,0x10,7,FUN_10001517,FUN_10001f45);
|
|
}
|
|
local_1c = *(int *)((int)this + 8);
|
|
local_14 = 0;
|
|
if (0 < local_1c) {
|
|
local_18 = (void *)((int)this + 4);
|
|
do {
|
|
piVar3 = (int *)FUN_10007d02(local_18,local_14);
|
|
local_20 = piVar3;
|
|
if (piVar3 != (int *)0x0) {
|
|
(**(code **)(*piVar3 + 4))(piVar3);
|
|
}
|
|
local_8 = 1;
|
|
if (piVar3 != (int *)0x0) {
|
|
FUN_10015d08(this_00 + 0x18,param_1);
|
|
FUN_10015d08(this_00 + 0x14,param_2);
|
|
FUN_10015d08(this_00 + 0x10,param_3);
|
|
if ((CComVariant *)(this_00 + 0xc) != (CComVariant *)&stack0x00000010) {
|
|
ATL::CComVariant::InternalCopy
|
|
((CComVariant *)(this_00 + 0xc),(tagVARIANT *)&stack0x00000010);
|
|
}
|
|
if ((CComVariant *)(this_00 + 8) != (CComVariant *)&stack0x00000020) {
|
|
ATL::CComVariant::InternalCopy
|
|
((CComVariant *)(this_00 + 8),(tagVARIANT *)&stack0x00000020);
|
|
}
|
|
if ((CComVariant *)(this_00 + 4) != (CComVariant *)&stack0x00000030) {
|
|
ATL::CComVariant::InternalCopy
|
|
((CComVariant *)(this_00 + 4),(tagVARIANT *)&stack0x00000030);
|
|
}
|
|
*(undefined2 *)this_00 = 0x6024;
|
|
this_00[2] = in_stack_00000040;
|
|
local_2c = 0;
|
|
local_28 = 7;
|
|
local_24 = 0;
|
|
local_30 = this_00;
|
|
bVar1 = FUN_10003f01(*(basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> **)
|
|
(DAT_100294e0 + 0x10));
|
|
if (bVar1 != (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>)0x0) {
|
|
pwVar6 = L" Item Handle ";
|
|
lVar5 = param_1;
|
|
lVar7 = param_2;
|
|
p_Var8 = endl_exref;
|
|
pbVar4 = (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> *)
|
|
FUN_10002dbf(*(int **)(DAT_100294e0 + 0x10),
|
|
L"CProxy_ILMXProxyServerEvents2::Fire_OnBufferedDataChange firing event - Server Handle "
|
|
);
|
|
pbVar4 = std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<
|
|
(pbVar4,lVar5);
|
|
pbVar4 = (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> *)
|
|
FUN_10002dbf((int *)pbVar4,pwVar6);
|
|
pbVar4 = std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<
|
|
(pbVar4,lVar7);
|
|
std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<(pbVar4,p_Var8);
|
|
}
|
|
(**(code **)(*piVar3 + 0x18))(piVar3,1,&DAT_100201f8,0x400,1,&local_30,0,0,0);
|
|
}
|
|
local_8 = 0xffffffff;
|
|
if (piVar3 != (int *)0x0) {
|
|
(**(code **)(*piVar3 + 8))(piVar3);
|
|
}
|
|
local_14 = local_14 + 1;
|
|
} while (local_14 < local_1c);
|
|
}
|
|
if (this_00 != (undefined4 *)0x0) {
|
|
FUN_10015d66(this_00,3);
|
|
}
|
|
return;
|
|
}
|
|
|
|
|
|
```
|
|
|
|
## FUN_1000fc80 at 1000fc80
|
|
|
|
Signature: `undefined4 __stdcall FUN_1000fc80(int param_1, long param_2, int param_3)`
|
|
|
|
```c
|
|
|
|
undefined4 FUN_1000fc80(int param_1,long param_2,int param_3)
|
|
|
|
{
|
|
int iVar1;
|
|
basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> bVar2;
|
|
basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> *pbVar3;
|
|
undefined4 uVar4;
|
|
int *piVar5;
|
|
int iVar6;
|
|
long lVar7;
|
|
wchar_t *pwVar8;
|
|
wchar_t *pwVar9;
|
|
_func_basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>_ptr_basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>_ptr
|
|
*p_Var10;
|
|
|
|
iVar6 = param_3;
|
|
if (param_3 < 1) {
|
|
bVar2 = FUN_10003f01(*(basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> **)
|
|
(DAT_100294e0 + 0xc));
|
|
if (bVar2 != (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>)0x0) {
|
|
p_Var10 = endl_exref;
|
|
pbVar3 = (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> *)
|
|
FUN_10002dbf(*(int **)(DAT_100294e0 + 0xc),
|
|
L"CLMXProxyServer::SetBufferedUpdateInterval - returning E_INVALIDARG");
|
|
std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<(pbVar3,p_Var10);
|
|
}
|
|
uVar4 = 0x80070057;
|
|
}
|
|
else {
|
|
piVar5 = (int *)FUN_1000f663((void *)(param_1 + 0x24),¶m_3,¶m_2);
|
|
iVar1 = *piVar5;
|
|
if (iVar1 == *(int *)(param_1 + 0x28)) {
|
|
bVar2 = FUN_10003f01(*(basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> **)
|
|
(DAT_100294e0 + 0xc));
|
|
if (bVar2 != (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>)0x0) {
|
|
pwVar8 = L" not found.";
|
|
lVar7 = param_2;
|
|
p_Var10 = endl_exref;
|
|
pbVar3 = (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> *)
|
|
FUN_10002dbf(*(int **)(DAT_100294e0 + 0xc),
|
|
L"CLMXProxyServer::SetBufferedUpdateInterval - hLMXServer ");
|
|
pbVar3 = std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<
|
|
(pbVar3,lVar7);
|
|
pbVar3 = (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> *)
|
|
FUN_10002dbf((int *)pbVar3,pwVar8);
|
|
std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<(pbVar3,p_Var10);
|
|
}
|
|
uVar4 = 0x80070057;
|
|
}
|
|
else {
|
|
*(int *)(iVar1 + 0x5c) = (iVar6 + 99) / 100;
|
|
bVar2 = FUN_10003f01(*(basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> **)
|
|
(DAT_100294e0 + 0xc));
|
|
if (bVar2 != (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>)0x0) {
|
|
iVar6 = *(int *)(iVar1 + 0x5c) * 100;
|
|
pwVar9 = L" msec.";
|
|
pwVar8 = L" setting buffered update interval to ";
|
|
lVar7 = param_2;
|
|
p_Var10 = endl_exref;
|
|
pbVar3 = (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> *)
|
|
FUN_10002dbf(*(int **)(DAT_100294e0 + 0xc),
|
|
L"CLMXProxyServer::SetBufferedUpdateInterval - hLMXServer ");
|
|
pbVar3 = std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<
|
|
(pbVar3,lVar7);
|
|
pbVar3 = (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> *)
|
|
FUN_10002dbf((int *)pbVar3,pwVar8);
|
|
pbVar3 = std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<
|
|
(pbVar3,iVar6);
|
|
pbVar3 = (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> *)
|
|
FUN_10002dbf((int *)pbVar3,pwVar9);
|
|
std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<(pbVar3,p_Var10);
|
|
}
|
|
uVar4 = 0;
|
|
}
|
|
}
|
|
return uVar4;
|
|
}
|
|
|
|
|
|
```
|
|
|