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>
325 lines
13 KiB
Markdown
325 lines
13 KiB
Markdown
# LmxProxy.dll selected decompile
|
|
|
|
## FUN_1001399f at 1001399f
|
|
|
|
Signature: `undefined __stdcall FUN_1001399f(int param_1, long param_2, wchar_t * param_3, undefined4 param_4, long * param_5)`
|
|
|
|
```c
|
|
|
|
/* WARNING: Function: __EH_prolog3_catch_GS replaced with injection: EH_prolog3 */
|
|
|
|
void FUN_1001399f(int param_1,long param_2,wchar_t *param_3,undefined4 param_4,long *param_5)
|
|
|
|
{
|
|
long *plVar1;
|
|
basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> bVar2;
|
|
basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> *pbVar3;
|
|
int *piVar4;
|
|
int iVar5;
|
|
wchar_t *pwVar6;
|
|
wchar_t *pwVar7;
|
|
long lVar8;
|
|
char cVar9;
|
|
_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;
|
|
undefined4 local_6c;
|
|
undefined4 local_68;
|
|
undefined4 uStack_64;
|
|
undefined4 uStack_60;
|
|
undefined4 uStack_5c;
|
|
undefined1 local_54 [8];
|
|
undefined4 local_4c;
|
|
undefined4 local_48;
|
|
int local_44;
|
|
long local_40 [2];
|
|
BSTR local_38;
|
|
int *local_34;
|
|
long *local_30;
|
|
_func_void_uint__EXCEPTION_POINTERS_ptr *local_2c;
|
|
undefined4 local_28;
|
|
undefined4 uStack_24;
|
|
undefined4 uStack_20;
|
|
undefined4 uStack_1c;
|
|
int local_8;
|
|
undefined4 uStack_4;
|
|
|
|
uStack_4 = 100;
|
|
local_40[0] = param_2;
|
|
local_48 = param_4;
|
|
local_30 = param_5;
|
|
local_8 = 0;
|
|
FUN_10011b07(&local_2c);
|
|
local_34 = (int *)0x0;
|
|
local_38 = (BSTR)0x0;
|
|
local_8 = CONCAT31((int3)((uint)local_8 >> 8),4);
|
|
bVar2 = FUN_10003f01(*(basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> **)
|
|
(DAT_100294e0 + 0xc));
|
|
if (param_5 == (long *)0x0) {
|
|
if (bVar2 != (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>)0x0) {
|
|
pwVar7 = L" UserID ptr NULL - returning E_POINTER HRESULT";
|
|
p_Var10 = endl_exref;
|
|
pbVar3 = (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> *)
|
|
FUN_10002dbf(*(int **)(DAT_100294e0 + 0xc),
|
|
L"CLMXProxyServer::AuthenticateUser - Server Handle: ");
|
|
pbVar3 = std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<
|
|
(pbVar3,param_2);
|
|
pbVar3 = (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> *)
|
|
FUN_10002dbf((int *)pbVar3,pwVar7);
|
|
std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<(pbVar3,p_Var10);
|
|
}
|
|
local_8._0_1_ = 3;
|
|
SysFreeString(local_38);
|
|
local_8._0_1_ = 1;
|
|
if (local_34 != (int *)0x0) {
|
|
(**(code **)(*local_34 + 8))(local_34);
|
|
}
|
|
local_8 = (uint)local_8._1_3_ << 8;
|
|
_set_se_translator(local_2c);
|
|
FUN_10013cbd();
|
|
return;
|
|
}
|
|
if (bVar2 != (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>)0x0) {
|
|
pwVar6 = L" User name ";
|
|
pwVar7 = param_3;
|
|
p_Var10 = endl_exref;
|
|
pbVar3 = (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> *)
|
|
FUN_10002dbf(*(int **)(DAT_100294e0 + 0xc),
|
|
L"CLMXProxyServer::AuthenticateUser - Server Handle: ");
|
|
pbVar3 = std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<
|
|
(pbVar3,param_2);
|
|
piVar4 = (int *)FUN_10002dbf((int *)pbVar3,pwVar6);
|
|
pbVar3 = (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> *)FUN_10002dbf(piVar4,pwVar7)
|
|
;
|
|
std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<(pbVar3,p_Var10);
|
|
}
|
|
FUN_1000f663((void *)(param_1 + 0x24),&local_44,local_40);
|
|
if (local_44 != *(int *)(param_1 + 0x28)) {
|
|
(**(code **)(**(int **)(local_44 + 0x2c) + 0x20))
|
|
(*(int **)(local_44 + 0x2c),&DAT_1001b5c0,local_40);
|
|
iVar5 = (**(code **)(**(int **)(local_44 + 0x2c) + 0xc))
|
|
(*(int **)(local_44 + 0x2c),&DAT_1001b5c0,&DAT_1001b5c0,param_3,local_48,0,0,
|
|
local_54,&local_38,&local_34);
|
|
if ((-1 < iVar5) && (local_34 != (int *)0x0)) {
|
|
iVar5 = (**(code **)(*local_34 + 0xc))(local_34,&local_28);
|
|
iVar5 = FUN_1000f8d9((undefined4 *)(uint)(iVar5 == 0),iVar5,0x390,"LMXProxyServer.cpp");
|
|
if (iVar5 != 0) {
|
|
*(int *)(local_44 + 0x18) = *(int *)(local_44 + 0x18) + 1;
|
|
local_6c = *(undefined4 *)(local_44 + 0x18);
|
|
local_68 = local_28;
|
|
uStack_64 = uStack_24;
|
|
uStack_60 = uStack_20;
|
|
uStack_5c = uStack_1c;
|
|
cVar9 = '\0';
|
|
piVar4 = (int *)FUN_1000f475((void *)(local_44 + 0x4c),&local_6c);
|
|
FUN_1000f3c6((void *)(local_44 + 0x4c),&local_4c,piVar4,cVar9);
|
|
plVar1 = local_30;
|
|
*local_30 = *(long *)(local_44 + 0x18);
|
|
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) {
|
|
lVar8 = *plVar1;
|
|
p_Var10 = endl_exref;
|
|
pbVar3 = (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> *)
|
|
FUN_10002dbf(*(int **)(DAT_100294e0 + 0xc),
|
|
L"CLMXProxyServer::AuthenticateUser - returning HRESULT S_OK UserId "
|
|
);
|
|
pbVar3 = std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<
|
|
(pbVar3,lVar8);
|
|
std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<(pbVar3,p_Var10);
|
|
}
|
|
local_8._0_1_ = 3;
|
|
SysFreeString(local_38);
|
|
local_8._0_1_ = 1;
|
|
if (local_34 != (int *)0x0) {
|
|
(**(code **)(*local_34 + 8))(local_34);
|
|
}
|
|
local_8 = (uint)local_8._1_3_ << 8;
|
|
_set_se_translator(local_2c);
|
|
FUN_10013cbd();
|
|
return;
|
|
}
|
|
}
|
|
}
|
|
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::AuthenticateUser - returning HRESULT E_INVALIDARG");
|
|
std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<(pbVar3,p_Var10);
|
|
}
|
|
local_8._0_1_ = 3;
|
|
SysFreeString(local_38);
|
|
local_8._0_1_ = 1;
|
|
if (local_34 != (int *)0x0) {
|
|
(**(code **)(*local_34 + 8))(local_34);
|
|
}
|
|
local_8 = (uint)local_8._1_3_ << 8;
|
|
_set_se_translator(local_2c);
|
|
FUN_10013cbd();
|
|
return;
|
|
}
|
|
|
|
|
|
```
|
|
|
|
## FUN_10014572 at 10014572
|
|
|
|
Signature: `undefined __stdcall FUN_10014572(int param_1, long param_2, OLECHAR * param_3, long * param_4)`
|
|
|
|
```c
|
|
|
|
/* WARNING: Function: __EH_prolog3_catch_GS replaced with injection: EH_prolog3 */
|
|
|
|
void FUN_10014572(int param_1,long param_2,OLECHAR *param_3,long *param_4)
|
|
|
|
{
|
|
long *plVar1;
|
|
basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> bVar2;
|
|
basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> *pbVar3;
|
|
BSTR lpsz;
|
|
int *piVar4;
|
|
wchar_t *pwVar5;
|
|
long lVar6;
|
|
char cVar7;
|
|
_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_60;
|
|
ulong local_5c;
|
|
ushort uStack_58;
|
|
ushort uStack_56;
|
|
uchar auStack_54 [4];
|
|
uchar auStack_50 [12];
|
|
undefined4 local_44;
|
|
int local_40;
|
|
long local_3c;
|
|
long *local_38;
|
|
BSTR local_30;
|
|
_func_void_uint__EXCEPTION_POINTERS_ptr *local_2c;
|
|
CLSID local_28 [2];
|
|
uint local_8;
|
|
undefined4 uStack_4;
|
|
|
|
uStack_4 = 0x58;
|
|
local_3c = param_2;
|
|
local_38 = param_4;
|
|
local_8 = 0;
|
|
FUN_10011b07(&local_2c);
|
|
local_8 = CONCAT31(local_8._1_3_,1);
|
|
bVar2 = FUN_10003f01(*(basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> **)
|
|
(DAT_100294e0 + 0xc));
|
|
if (param_4 == (long *)0x0) {
|
|
if (bVar2 == (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>)0x0) goto LAB_100145ea;
|
|
pwVar5 = L" UserID ptr NULL - returning E_POINTER HRESULT";
|
|
}
|
|
else {
|
|
if (param_3 != (OLECHAR *)0x0) {
|
|
if (bVar2 != (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>)0x0) {
|
|
p_Var8 = endl_exref;
|
|
pbVar3 = (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> *)
|
|
FUN_10002dbf(*(int **)(DAT_100294e0 + 0xc),
|
|
L"CLMXProxyServer::ArchestrAUserToId - Server Handle: ");
|
|
pbVar3 = std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<
|
|
(pbVar3,param_2);
|
|
std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<(pbVar3,p_Var8);
|
|
}
|
|
local_28[0].Data1 = DAT_100201f8;
|
|
local_28[0].Data2 = (ushort)DAT_100201fc;
|
|
local_28[0].Data3 = DAT_100201fc._2_2_;
|
|
local_28[0].Data4[0] = (uchar)DAT_10020200;
|
|
local_28[0].Data4[1] = DAT_10020200._1_1_;
|
|
local_28[0].Data4[2] = DAT_10020200._2_1_;
|
|
local_28[0].Data4[3] = DAT_10020200._3_1_;
|
|
local_28[0].Data4[4] = (uchar)DAT_10020204;
|
|
local_28[0].Data4[5] = DAT_10020204._1_1_;
|
|
local_28[0].Data4[6] = DAT_10020204._2_1_;
|
|
local_28[0].Data4[7] = DAT_10020204._3_1_;
|
|
lpsz = SysAllocString(param_3);
|
|
local_30 = lpsz;
|
|
if (lpsz == (BSTR)0x0) {
|
|
/* WARNING: Subroutine does not return */
|
|
FUN_1000134e(0x8007000e);
|
|
}
|
|
local_8 = CONCAT31(local_8._1_3_,2);
|
|
CLSIDFromString(lpsz,local_28);
|
|
FUN_1000f663((void *)(param_1 + 0x24),&local_40,&local_3c);
|
|
if (local_40 != *(int *)(param_1 + 0x28)) {
|
|
*(int *)(local_40 + 0x18) = *(int *)(local_40 + 0x18) + 1;
|
|
local_60 = *(undefined4 *)(local_40 + 0x18);
|
|
local_5c = local_28[0].Data1;
|
|
uStack_58 = local_28[0].Data2;
|
|
uStack_56 = local_28[0].Data3;
|
|
auStack_54[0] = local_28[0].Data4[0];
|
|
auStack_54[1] = local_28[0].Data4[1];
|
|
auStack_54[2] = local_28[0].Data4[2];
|
|
auStack_54[3] = local_28[0].Data4[3];
|
|
auStack_50[0] = local_28[0].Data4[4];
|
|
auStack_50[1] = local_28[0].Data4[5];
|
|
auStack_50[2] = local_28[0].Data4[6];
|
|
auStack_50[3] = local_28[0].Data4[7];
|
|
cVar7 = '\0';
|
|
piVar4 = (int *)FUN_1000f475((void *)(local_40 + 0x4c),&local_60);
|
|
FUN_1000f3c6((void *)(local_40 + 0x4c),&local_44,piVar4,cVar7);
|
|
plVar1 = local_38;
|
|
*local_38 = *(long *)(local_40 + 0x18);
|
|
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) {
|
|
lVar6 = *plVar1;
|
|
p_Var8 = endl_exref;
|
|
pbVar3 = (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> *)
|
|
FUN_10002dbf(*(int **)(DAT_100294e0 + 0xc),
|
|
L"CLMXProxyServer::ArchestrAUserToId - returning HRESULT S_OK, UserId "
|
|
);
|
|
pbVar3 = std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<
|
|
(pbVar3,lVar6);
|
|
std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<(pbVar3,p_Var8);
|
|
}
|
|
local_8._0_1_ = 1;
|
|
SysFreeString(local_30);
|
|
local_8 = (uint)local_8._1_3_ << 8;
|
|
_set_se_translator(local_2c);
|
|
FUN_100147ea();
|
|
return;
|
|
}
|
|
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_Var8 = endl_exref;
|
|
pbVar3 = (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> *)
|
|
FUN_10002dbf(*(int **)(DAT_100294e0 + 0xc),
|
|
L"CLMXProxyServer::ArchestrAUserToId - returning HRESULT E_INVALIDARG for invalid Server Handle"
|
|
);
|
|
std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<(pbVar3,p_Var8);
|
|
}
|
|
local_8._0_1_ = 1;
|
|
SysFreeString(lpsz);
|
|
local_8 = (uint)local_8._1_3_ << 8;
|
|
_set_se_translator(local_2c);
|
|
FUN_100147ea();
|
|
return;
|
|
}
|
|
if (bVar2 == (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>)0x0) goto LAB_100145ea;
|
|
pwVar5 = L" UserGuidAsString ptr NULL - returning E_POINTER HRESULT";
|
|
}
|
|
p_Var8 = endl_exref;
|
|
pbVar3 = (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> *)
|
|
FUN_10002dbf(*(int **)(DAT_100294e0 + 0xc),
|
|
L"CLMXProxyServer::ArchestrAUserToId - Server Handle: ");
|
|
pbVar3 = std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<(pbVar3,param_2)
|
|
;
|
|
pbVar3 = (basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_> *)
|
|
FUN_10002dbf((int *)pbVar3,pwVar5);
|
|
std::basic_ostream<wchar_t,struct_std::char_traits<wchar_t>_>::operator<<(pbVar3,p_Var8);
|
|
LAB_100145ea:
|
|
local_8 = local_8 & 0xffffff00;
|
|
_set_se_translator(local_2c);
|
|
FUN_100147ea();
|
|
return;
|
|
}
|
|
|
|
|
|
```
|
|
|