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

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x120c
call fcn.00407610
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 0x401c57
cmp dword [ebp + 0x14], 0x80000003
jne 0x4014be
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 0x40160a
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 0x401559
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 0x40162f
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 0x40164a
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 0x401582
lea edx, [ebp - 0x50]
mov edi, str.ReplExceptSnapshot.log
jmp 0x401518
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 0x4015ae
lea edx, [ebp - 0x50]
mov edi, str.ReplExceptLogRdr.log
jmp 0x401518
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 0x4015da
lea edx, [ebp - 0x50]
mov edi, str.ReplExceptMerge.log
jmp 0x401518
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 0x401513
mov edi, str.ReplExcept.log
jmp 0x401518
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 0x4016a6
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 0x401732
lea ecx, [ebp - 0x10]
lea edx, [ebp - 0x304]
push ecx
push edx
push 0
push str.SQLPath
push str.SOFTWAREMicrosoftMSSQLServerSetup
push SysStringLen
call fcn.00401c70
add esp, 0x18
test eax, eax
jl 0x401732
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 0x401753
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 0x401c33
push 2
push 0
push 0
push ebx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp eax, 0xffffffff
je 0x401c33
push ebx
call fcn.00401cf0
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 0x401c57
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 0x401c36
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 0x4018ce
cmp byte [eax], 0
je 0x4018ce
lea ecx, [ebp - 4]
push 0
push ecx
push eax
call edi
mov edx, dword [ebp + 0x10]
push eax
push edx
jmp 0x4018f9
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 0x40190a
mov eax, dword [eax + 0xc]
jmp 0x40190c
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 0x401949
mov eax, dword [eax]
jmp 0x40194b
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 0x401c25
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 0x401a92
lea edi, [ebp - 0x724]
or ecx, 0xffffffff
xor eax, eax
repne scasb al, byte es:[edi]
not ecx
dec ecx
je 0x401a92
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, 0x40a27c
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 0x401ab5
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 0x401bd4
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 0x401c0a
lea edx, [ebp - 0x404]
test edx, edx
je 0x401b9e
lea eax, [ebp - 0x404]
lea ecx, [ebp - 0x150]
push eax
push 0x40a25c
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 0x401c0a
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 0x401c07
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 0x40a248
call esi
push eax
push 0x40a248
push ebx
call edi
jmp 0x4019aa
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 0x401c57
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