Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ode:
- // .data:004421D0 0000005B C Copyright (c) 1992-2004 by P.J. Plauger, licensed by Dinkumware, Ltd. ALL RIGHTS RESERVED.
- //.rdata:0043F288 00000050 C C:\\Users\\mimetnet\\Desktop\\paladin.client\\programs\\client\\Release\\cmn-client.pdb
- WinMain( )
- Creates named-pipe: Global\\cmn-client-%llu
- PHP Code:
- // Looks for local storage:
- if ( !SHGetFolderPathA(0, 28, 0, 0, "C:\\Users\\<user>\\AppData\\Local\\CMN") )
- strcat_s("C:\\Users\\<user>\\AppData\\Local\\CMN", 260u, "\\CMN");
- Retrieves list of running applications and their associated window handles:
- PHP Code:
- //.text:004011C0 ProcessEnum proc near ; CODE XREF: WinMain(x,x,x,x)+18Cp
- BOOL __cdecl ProcessEnum( )
- {
- //..
- result = Process32FirstW( hProcessSnap, &pe );
- if ( !result )
- return result;
- if ( !Process32NextW( hProcessSnap, &pe ) )
- return CloseHandle( hProcessSnap );
- //..
- while ( 1 )
- {
- hProc = OpenProcess( 0x410u, 0, pe.th32ProcessID ); // Probably VMREAD
- if ( hProc )
- break;
- LABEL_6:
- if ( !Process32NextW( hSnapshot, &pe ) )
- goto LABEL_9;
- }
- EnumWindows(EnumFunc, pe.th32ProcessID);
- //..
- return CloseHandle( hProcessSnap );
- }
- EnumFunc
- PHP Code:
- //.text:00401150 ; BOOL __stdcall EnumFunc(HWND, LPARAM)
- signed int __stdcall EnumFunc( HWND hWnd, int a2 )
- {
- HWND v2; // esi@1
- HWND i; // eax@3
- signed int result; // eax@5
- DWORD dwProcessId; // [sp+4h] [bp-4h]@1
- v2 = hWnd;
- dwProcessId = 0;
- GetWindowThreadProcessId( hWnd, &dwProcessId );
- if ( dwProcessId && dwProcessId == a2 )
- {
- for ( i = GetParent( hWnd ); i; i = GetParent( i ) )
- v2 = i;
- ShowWindow( v2, 1 );
- BringWindowToTop( v2 );
- SetForegroundWindow( v2 );
- result = 0;
- } else {
- result = 1;
- }
- return result;
- }
- Their InitInstance function:
- PHP Code:
- signed int __cdecl InitInstance( HINSTANCE hInstance, int nCmdShow )
- {
- // ...
- sub_411A60( &nWidth, &nHeight, &wpszName );
- if ( wpszName && GetProcessByName( ( const wchar_t * )&wpszName ) )
- {
- _snwprintf( &Text, 0x2000u, L"The application '%s' cannot be running before the Paladin client starts", &wpszName );
- MessageBoxW( 0, &Text, L"Paladin Error", 0x10u );
- return 0;
- }
- if ( BrowserCheck( ) )
- {
- MessageBoxW( 0, L"Paladin can only be launched through the browser-based match check-in.", L"Paladin Error", 0x10u );
- result = 0;
- }
- else
- {
- v3 = CreateWindowExW( 0, &ClassName, &WindowName, 0x2CA0000u, 0x80000000u, 0, nWidth, nHeight, 0, 0, hInstance, 0 );
- if ( !v3 )
- return 0;
- ShowWindow( v3, nCmdShow );
- UpdateWindow( v3 );
- result = 1;
- }
- return result;
- }
- Boring
- PHP Code:
- if ( !dword_444940 )
- {
- v3 = LoadLibraryW(L"USER32.DLL");
- v4 = v3;
- if ( !v3 || (v5 = GetProcAddress(v3, "MessageBoxW")) == 0 )
- return 0;
- dword_444940 = EncodePointer(v5);
- v6 = GetProcAddress(v4, "GetActiveWindow");
- dword_444944 = EncodePointer(v6);
- v7 = GetProcAddress(v4, "GetLastActivePopup");
- dword_444948 = EncodePointer(v7);
- v8 = GetProcAddress(v4, "GetUserObjectInformationW");
- dword_444950 = EncodePointer(v8);
- if ( dword_444950 )
- {
- v9 = GetProcAddress(v4, "GetProcessWindowStation");
- dword_44494C = EncodePointer(v9);
- }
- }
- cmn-dash.exe is a x64 build
- Code:
- //.rdata:0000000140004658 aC2012MatthewMe db '(c) 2012 Matthew Metnetsky',0Ah,0
- //.rdata:0000000140004CC4 00000056 C C:\\Users\\mimetnet\\Desktop\\paladin.client\\programs\\dash\\win32\\Release\\x64\\cmn-dash.pdb
- communicates on the named pipe
- Code:
- .text:0000000140001265 lea r8, aGlobalCmnDashU ; "Global\\cmn-dash-%u"
- .text:000000014000126C call cs:_snwprintf
- .text:0000000140001272 jmp short loc_140001281
- .text:0000000140001274 ; ---------------------------------------------------------------------------
- .text:0000000140001274
- .text:0000000140001274 loc_140001274: ; CODE XREF: sub_1400011B0+B3j
- .text:0000000140001274 lea r8, aGlobalCmnDash ; "Global\\cmn-dash"
- .text:000000014000127B call cs:_snwprintf
- .text:0000000140001281
- .text:0000000140001281 loc_140001281: ; CODE XREF: sub_1400011B0+C2j
- .text:0000000140001281 lea r8, [rsp+288h+Name] ; lpName
- .text:0000000140001286 xor edx, edx ; bInheritHandle
- .text:0000000140001288 mov ecx, 1F0001h ; dwDesiredAccess
- .text:000000014000128D call cs:OpenMutexW
- .text:00000001400031F8 call cs:OpenSCManagerW
- .text:00000001400031FE mov rsi, rax
- .text:0000000140003201 test rax, rax
- .text:0000000140003204 jz short loc_140003283
- .text:0000000140003206 lea r8d, [rbx+14h] ; dwDesiredAccess
- .text:000000014000320A lea rdx, ServiceName ; "cmn-dash"
- .text:0000000140003211 mov rcx, rax ; hSCManager
- .text:0000000140003253 call cs:StartServiceA
- .text:0000000140003259 mov edx, 2 ; int
- .text:000000014000325E mov rcx, rdi ; hService
- .text:0000000140003261 lea r8d, [rdx+2] ; int
- .text:0000000140003265 call sub_140002960
- .text:000000014000326A mov ebx, eax
Advertisement
Add Comment
Please, Sign In to add comment