Function at 0x401f00
Capabilities:
Create thread
Read .ini file

Disassembly:
sub esp, 0x274
push esi
push 0x40d5c0
call dword [sym.imp.KERNEL32.dll_InitializeCriticalSection]
lea eax, [esp + 0x80]
push 0x1f4
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea esi, [esp + eax + 0x80]
cmp eax, 4
mov byte [esi], 0
jbe 0x402275
cmp byte [esi - 4], 0x2e
jne 0x402275
lea ecx, [esp + 0x80]
push edi
push ecx
push 0x40a4fc
push 0x40d5d8
call fcn.00402433
add esp, 0xc
lea edx, [esp + 0x84]
mov byte [esi - 4], 0
push edx
push str._s.ini
push 0x40d1cc
call fcn.00402433
add esp, 0xc
lea eax, [esp + 0x84]
push eax
push str._s.log
push 0x40d7d0
call fcn.00402433
push 0x40d5d8
call fcn.00401000
push 0x40d1cc
call fcn.00401000
push 0x40d7d0
call fcn.00401000
add esp, 0x18
push 0x40d1cc
push 0x1f4
push 0x40d3c4
push str.DBSRVMGR
push str.ServiceName
push str.Settings
call dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringA]
push 0x40d3c4
call fcn.00401000
mov esi, dword [esp + 0x284]
add esp, 4
cmp esi, 2
jne 0x4020b6
mov esi, dword [esp + 0x284]
mov ecx, dword [esi + 4]
push ecx
push 0x40a4d0
call fcn.00402680
add esp, 8
test eax, eax
jne 0x402033
push 0x40d3c4
call fcn.00401b90
add esp, 4
push 0x40d5c0
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
pop edi
pop esi
add esp, 0x274
ret
mov edx, dword [esi + 4]
push edx
push 0x40a4cc
call fcn.00402680
add esp, 8
test eax, eax
jne 0x40206e
push 0x40d3c4
push 0x40d5d8
call fcn.00401c70
add esp, 8
push 0x40d5c0
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
pop edi
pop esi
add esp, 0x274
ret
mov eax, dword [esi + 4]
push eax
push 0x40a4c8
call fcn.00402680
add esp, 8
test eax, eax
jne 0x4021f8
push 0x40d3c4
call fcn.00401700
push 0
push 0
push 0x40d3c4
call fcn.00401810
add esp, 0x10
push 0x40d5c0
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
pop edi
pop esi
add esp, 0x274
ret
mov edi, dword [esp + 0x284]
cmp esi, 3
jne 0x402184
mov ecx, dword [edi + 4]
push ecx
push 0x40a4c8
call fcn.00402680
add esp, 8
test eax, eax
jne 0x40212b
mov edx, dword [edi + 8]
push edx
call fcn.00402428
mov esi, eax
push esi
push 0x40d3c4
call fcn.004015d0
add esp, 0xc
test eax, eax
push esi
je 0x402112
lea eax, [esp + 0xc]
push str.Bounced_process__d
push eax
call fcn.00402433
lea ecx, [esp + 0x14]
push ecx
jmp 0x402259
lea edx, [esp + 0xc]
push str.Failed_to_bounce_process__d
push edx
call fcn.00402433
lea eax, [esp + 0x14]
push eax
jmp 0x402259
mov ecx, dword [edi + 4]
push ecx
push 0x40a494
call fcn.00402680
add esp, 8
test eax, eax
jne 0x402189
mov edx, dword [edi + 8]
push edx
call fcn.00401700
add esp, 4
test eax, eax
mov eax, dword [edi + 8]
push eax
je 0x40216c
lea ecx, [esp + 0xc]
push str.Killed_service__s
push ecx
call fcn.00402433
lea edx, [esp + 0x14]
jmp 0x402258
lea ecx, [esp + 0xc]
push str.Failed_to_kill_service__s
push ecx
call fcn.00402433
lea edx, [esp + 0x14]
jmp 0x402258
cmp esi, 3
jl 0x4021f8
mov eax, dword [edi + 4]
push eax
push 0x40a460
call fcn.00402680
add esp, 8
test eax, eax
jne 0x4021f8
cmp esi, 3
jle 0x4021a8
lea ecx, [edi + 0xc]
jmp 0x4021aa
xor ecx, ecx
cmp esi, 3
jle 0x4021b4
lea eax, [esi - 3]
jmp 0x4021b6
xor eax, eax
push ecx
mov ecx, dword [edi + 8]
push eax
push ecx
call fcn.00401810
mov edx, dword [edi + 8]
add esp, 0xc
test eax, eax
push edx
je 0x4021e2
lea eax, [esp + 0xc]
push str.Ran_service__s
push eax
call fcn.00402433
lea ecx, [esp + 0x14]
push ecx
jmp 0x402259
lea eax, [esp + 0xc]
push str.Failed_to_run_service__s
push eax
call fcn.00402433
lea ecx, [esp + 0x14]
push ecx
jmp 0x402259
push 0
push 0
push 0x401d50
call fcn.00402500
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
add esp, 0xc
cmp eax, 0xffffffff
jne 0x402233
call esi
push eax
lea edx, [esp + 0xc]
push str._beginthread_failed__error_code___d
push edx
call fcn.00402433
lea eax, [esp + 0x14]
push eax
call fcn.00401000
add esp, 0x10
push 0x40a030
call dword [sym.imp.ADVAPI32.dll_StartServiceCtrlDispatcherA]
test eax, eax
jne 0x402261
call esi
push eax
lea ecx, [esp + 0xc]
push str.StartServiceCtrlDispatcher_failed__error_code___d
push ecx
call fcn.00402433
lea edx, [esp + 0x14]
push edx
call fcn.00401000
add esp, 0x10
push 0x40d5c0
call dword [sym.imp.KERNEL32.dll_DeleteCriticalSection]
pop edi
pop esi
add esp, 0x274
ret
lea eax, [esp + 0x80]
push eax
push str.Invalid_module_file_name:__s_r_n
call fcn.004024bf
add esp, 8
pop esi
add esp, 0x274
ret