Function at 0x40ccf0
Capabilities:
Access the windows event log
Query environment variable
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x120c
call fcn.004193a0
mov eax, dword [ebp + 8]
push ebx
push esi
xor esi, esi
cmp eax, esi
push edi
mov dword [ebp - 8], esi
mov dword [ebp - 0xc], esi
mov dword [ebp - 4], esi
mov dword [ebp - 0x10], esi
je 0x40d4c7
cmp dword [ebp + 0x14], reloc.ODBC32.dll_SQLAllocStmt
jne 0x40cd2e
pop edi
pop esi
or eax, 0xffffffff
pop ebx
mov esp, ebp
pop ebp
ret 0x10
mov ecx, 0x40
xor eax, eax
lea edi, [ebp - 0x304]
push 0x100
rep stosd dword es:[edi], eax
lea eax, [ebp - 0x304]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
mov ebx, dword [ebp + 0x10]
cmp ebx, esi
je 0x40ce7a
mov edi, str.distrib
or ecx, 0xffffffff
xor eax, eax
mov esi, dword [sym.imp.MSVCRT.dll__strnicmp]
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
push str.distrib
push ebx
call esi
add esp, 0xc
test eax, eax
jne 0x40cdc9
lea edx, [ebp - 0x50]
mov edi, str.ReplExceptDist.log
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
mov al, byte [ebx]
and ecx, 3
test al, al
rep movsb byte es:[edi], byte [esi]
je 0x40ce9f
mov edx, dword [ebp + 0x14]
lea ecx, [ebp - 0x50]
push ecx
push edx
push ebx
lea eax, [ebp - 0x504]
push str.The__s_executable_is_terminating_abnormally_because_it_hit_an_exception._Exception_Code__lx._Check_file__s_for_details.
push eax
jmp 0x40ceba
mov edi, str.snapshot
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
push str.snapshot
push ebx
call esi
add esp, 0xc
test eax, eax
jne 0x40cdf2
lea edx, [ebp - 0x50]
mov edi, str.ReplExceptSnapshot.log
jmp 0x40cd88
mov edi, str.logread
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
push str.logread
push ebx
call esi
add esp, 0xc
test eax, eax
jne 0x40ce1e
lea edx, [ebp - 0x50]
mov edi, str.ReplExceptLogRdr.log
jmp 0x40cd88
mov edi, str.replmerg
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
push str.replmerg
push ebx
call esi
add esp, 0xc
test eax, eax
jne 0x40ce4a
lea edx, [ebp - 0x50]
mov edi, str.ReplExceptMerge.log
jmp 0x40cd88
mov edi, str.rdistcom
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
push ecx
push str.rdistcom
push ebx
call esi
add esp, 0xc
lea edx, [ebp - 0x50]
test eax, eax
je 0x40cd83
mov edi, str.ReplExcept.log
jmp 0x40cd88
mov edi, str.ReplExcept.log
or ecx, 0xffffffff
xor eax, eax
lea edx, [ebp - 0x50]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edx, dword [ebp + 0x14]
lea ecx, [ebp - 0x50]
push ecx
lea eax, [ebp - 0x304]
push edx
push eax
lea ecx, [ebp - 0x504]
push str.The__s_executable_is_terminating_abnormally_because_it_hit_an_exception._Exception_Code__lx._Check_file__s_for_details.
push ecx
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0x14
push str.SQLSERVERAGENT
push 0
call dword [sym.imp.ADVAPI32.dll_RegisterEventSourceA]
mov esi, eax
test esi, esi
je 0x40cf16
mov ecx, 0x10
xor eax, eax
lea edi, [ebp - 0x204]
push eax
rep stosd dword es:[edi], eax
lea eax, [ebp - 0x204]
lea edx, [ebp - 0x504]
push eax
push 0
push 1
push 0
push 0xc0000034
push 0
push 1
push esi
mov dword [ebp - 0x204], edx
call dword [sym.imp.ADVAPI32.dll_ReportEventA]
push esi
call dword [sym.imp.ADVAPI32.dll_DeregisterEventSource]
mov eax, dword [ebp + 0xc]
test eax, eax
jne 0x40cfa2
lea ecx, [ebp - 0x10]
lea edx, [ebp - 0x304]
push ecx
push edx
push 0
push str.SQLPath
push str.SOFTWAREMicrosoftMSSQLServerSetup
push reloc.ODBC32.dll_SQLAllocEnv
call fcn.0040d4e0
add esp, 0x18
test eax, eax
jl 0x40cfa2
mov edi, str.log_
or ecx, 0xffffffff
xor eax, eax
lea edx, [ebp - 0x304]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
lea edx, [ebp - 0x304]
and ecx, 3
rep movsb byte es:[edi], byte [esi]
lea edi, [ebp - 0x50]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov ebx, ecx
mov edi, edx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, ebx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, ebx
jmp 0x40cfc3
lea edi, [ebp - 0x50]
or ecx, 0xffffffff
xor eax, eax
lea edx, [ebp - 0x304]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
push 0
push 0x80
push 4
rep movsb byte es:[edi], byte [esi]
push 0
push 0
lea ecx, [ebp - 0x304]
push 0xc0000000
push ecx
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov ebx, eax
cmp ebx, 0xffffffff
je 0x40d4a3
push 2
push 0
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x40d4a3
push ebx
call fcn.0040d560
add esp, 4
push 0
call dword [sym.imp.IMAGEHLP.dll_SymSetOptions]
lea edx, [ebp - 0x120c]
push 0x800
push edx
push str.PATH
call dword [sym.imp.KERNEL32.dll_GetEnvironmentVariableA]
lea eax, [ebp - 0x120c]
push 1
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.IMAGEHLP.dll_SymInitialize]
test eax, eax
je 0x40d4c7
mov edx, dword [ebp + 8]
mov ecx, 0x1d
xor eax, eax
lea edi, [ebp - 0x1c4]
mov esi, dword [edx + 4]
push 0x117
rep stosd dword es:[edi], eax
mov ecx, 0xb3
lea edi, [ebp - 0xa0c]
rep movsd dword es:[edi], dword [esi]
mov eax, dword [ebp - 0x954]
mov ecx, dword [ebp - 0x958]
mov edx, dword [ebp - 0x948]
mov dword [ebp - 0x1c4], eax
mov eax, 3
push 8
mov dword [ebp - 0x1bc], eax
mov dword [ebp - 0x1ac], ecx
mov dword [ebp - 0x1a4], eax
mov dword [ebp - 0x1a0], edx
mov dword [ebp - 0x198], eax
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov esi, eax
test esi, esi
mov dword [ebp - 8], esi
je 0x40d4a6
mov ecx, 0x45
xor eax, eax
mov edi, esi
push str._r_n_r_n_r_nAn_exception_was_caught_r_nin
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [ebp - 0x150]
mov dword [esi], 0x18
push eax
mov dword [esi + 0x10], 0x100
call dword [sym.imp.MSVCRT.dll_sprintf]
mov edi, dword [sym.imp.KERNEL32.dll_lstrlenA]
add esp, 8
lea ecx, [ebp - 4]
lea edx, [ebp - 0x150]
push 0
push ecx
push edx
call edi
mov esi, dword [sym.imp.KERNEL32.dll_WriteFile]
push eax
lea eax, [ebp - 0x150]
push eax
push ebx
call esi
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x40d13e
cmp byte [eax], 0
je 0x40d13e
lea ecx, [ebp - 4]
push 0
push ecx
push eax
call edi
mov edx, dword [ebp + 0x10]
push eax
push edx
jmp 0x40d169
lea eax, [ebp - 0x304]
push 0x100
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea ecx, [ebp - 4]
push 0
lea edx, [ebp - 0x304]
push ecx
push edx
call edi
push eax
lea eax, [ebp - 0x304]
push eax
push ebx
call esi
mov ecx, dword [ebp + 8]
mov eax, dword [ecx]
test eax, eax
je 0x40d17a
mov eax, dword [eax + 0xc]
jmp 0x40d17c
xor eax, eax
push eax
lea edx, [ebp - 0x150]
push str._r_n_r_n_Exception_Address___08x_r_n
push edx
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0xc
lea eax, [ebp - 4]
lea ecx, [ebp - 0x150]
push 0
push eax
push ecx
call edi
lea edx, [ebp - 0x150]
push eax
push edx
push ebx
call esi
mov eax, dword [ebp + 8]
mov eax, dword [eax]
test eax, eax
je 0x40d1b9
mov eax, dword [eax]
jmp 0x40d1bb
xor eax, eax
push eax
lea ecx, [ebp - 0x150]
push str._Exception_Code___08x_r_n
push ecx
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0xc
lea edx, [ebp - 4]
lea eax, [ebp - 0x150]
push 0
push edx
push eax
call edi
lea ecx, [ebp - 0x150]
push eax
push ecx
push ebx
call esi
lea edx, [ebp - 0x150]
push str._r_n_r_n_r_nModule_Name_t_tReturn_Address_t_tLocation_r_n
push edx
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 8
lea eax, [ebp - 4]
lea ecx, [ebp - 0x150]
push 0
push eax
push ecx
call edi
lea edx, [ebp - 0x150]
push eax
push edx
push ebx
call esi
mov eax, dword [sym.imp.IMAGEHLP.dll_SymGetModuleBase]
mov ecx, dword [sym.imp.IMAGEHLP.dll_SymFunctionTableAccess]
mov edx, dword [sym.imp.KERNEL32.dll_ReadProcessMemory]
mov esi, dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push 0
push eax
push ecx
lea eax, [ebp - 0xa0c]
push edx
lea ecx, [ebp - 0x1c4]
push eax
push ecx
push 0
call esi
push eax
push 0x14c
call dword [sym.imp.IMAGEHLP.dll_StackWalk]
test eax, eax
je 0x40d495
mov eax, dword [ebp - 8]
mov edx, dword [ebp - 0x1c4]
mov ecx, 0x8e
lea edi, [ebp - 0x73c]
mov dword [eax + 4], edx
mov edx, dword [ebp - 0x1c4]
xor eax, eax
rep stosd dword es:[edi], eax
lea ecx, [ebp - 0x740]
mov dword [ebp - 0x740], 0x23c
push ecx
push edx
call esi
push eax
call dword [sym.imp.IMAGEHLP.dll_SymGetModuleInfo]
test eax, eax
je 0x40d302
lea edi, [ebp - 0x724]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
je 0x40d302
lea edi, [ebp - 0x724]
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
lea edx, [ebp - 0x150]
mov eax, ecx
mov esi, edi
mov edi, edx
lea edx, [ebp - 0x150]
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
xor eax, eax
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, 0x421020
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov esi, edi
mov edi, edx
mov edx, ecx
or ecx, 0xffffffff
repne scasb al, byte es:[edi]
mov ecx, edx
dec edi
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
jmp 0x40d325
mov edi, str._No_Module_Info__t_t
or ecx, 0xffffffff
xor eax, eax
lea edx, [ebp - 0x150]
repne scasb al, byte es:[edi]
not ecx
sub edi, ecx
mov eax, ecx
mov esi, edi
mov edi, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, eax
and ecx, 3
push 0
rep movsb byte es:[edi], byte [esi]
mov esi, dword [sym.imp.KERNEL32.dll_lstrlenA]
lea ecx, [ebp - 4]
lea edx, [ebp - 0x150]
push ecx
push edx
call esi
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
push eax
lea eax, [ebp - 0x150]
push eax
push ebx
call edi
mov ecx, dword [ebp - 8]
mov eax, dword [ebp - 0x1c4]
lea edx, [ebp - 0xc]
push ecx
push edx
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.IMAGEHLP.dll_SymGetSymFromAddr]
mov ecx, dword [ebp - 0x1b8]
lea edx, [ebp - 0x150]
push ecx
push str._08x_t_t
push edx
mov dword [ebp + 8], eax
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0xc
lea eax, [ebp - 4]
lea ecx, [ebp - 0x150]
push 0
push eax
push ecx
call esi
lea edx, [ebp - 0x150]
push eax
push edx
push ebx
call edi
mov eax, dword [ebp + 8]
test eax, eax
je 0x40d444
mov ecx, dword [ebp - 8]
lea eax, [ebp - 0x404]
push 0x100
push eax
push ecx
call dword [sym.imp.IMAGEHLP.dll_SymUnDName]
test eax, eax
je 0x40d47a
lea edx, [ebp - 0x404]
test edx, edx
je 0x40d40e
lea eax, [ebp - 0x404]
lea ecx, [ebp - 0x150]
push eax
push 0x421000
push ecx
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0xc
lea edx, [ebp - 4]
lea eax, [ebp - 0x150]
push 0
push edx
push eax
call esi
lea ecx, [ebp - 0x150]
push eax
push ecx
push ebx
call edi
mov eax, dword [ebp - 0xc]
test eax, eax
je 0x40d47a
push eax
lea edx, [ebp - 0x150]
push str.___x
push edx
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0xc
lea eax, [ebp - 4]
lea ecx, [ebp - 0x150]
push 0
push eax
push ecx
call esi
lea edx, [ebp - 0x150]
push eax
push edx
jmp 0x40d477
mov eax, dword [ebp - 0x1c4]
lea ecx, [ebp - 0x150]
push eax
push str._08x
push ecx
call dword [sym.imp.MSVCRT.dll_sprintf]
add esp, 0xc
lea edx, [ebp - 4]
lea eax, [ebp - 0x150]
push 0
push edx
push eax
call esi
lea ecx, [ebp - 0x150]
push eax
push ecx
push ebx
call edi
lea edx, [ebp - 4]
push 0
push edx
push 0x420fec
call esi
push eax
push 0x420fec
push ebx
call edi
jmp 0x40d21a
push ebx
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov esi, dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.IMAGEHLP.dll_SymCleanup]
test esi, esi
je 0x40d4c7
push esi
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
pop edi
pop esi
mov eax, 1
pop ebx
mov esp, ebp
pop ebp
ret 0x10