Function at 0x406730
Capabilities:
Create directory
Hide graphical window
Initialize winsock library
Read .ini file

Disassembly:
push ebx
mov ebx, esp
sub esp, 8
and esp, 0xfffffff0
add esp, 4
push ebp
mov ebp, dword [ebx + 4]
mov dword [esp + 4], ebp
mov ebp, esp
sub esp, 0x354
mov eax, dword [0x43d008]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebx + 8]
push esi
push edi
mov dword [ebp - 0x32c], eax
jmp 0x406773
push 1
call dword [sym.imp.KERNEL32.dll_SetErrorMode]
push 0x411be0
call dword [sym.imp.KERNEL32.dll_SetUnhandledExceptionFilter]
mov edi, dword [ebp - 0x32c]
mov esi, dword [sym.imp.USER32.dll_LoadStringA]
push 0x64
push 0x5d5650
push 0x67
push edi
mov dword [0x5d56b4], eax
call esi
push 0x64
push 0x5d55e8
push 0x6d
push edi
call esi
mov esi, dword [sym.imp.USER32.dll_LoadImageA]
push 0
push 0x40
push 0x40
push 1
push 0x6b
push edi
mov dword [ebp - 0x40], 0x30
mov dword [ebp - 0x3c], 3
mov dword [ebp - 0x38], 0x406ce0
mov dword [ebp - 0x34], 0
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x2c], edi
call esi
push 0x7f00
push 0
mov dword [ebp - 0x28], eax
call dword [sym.imp.USER32.dll_LoadCursorA]
push 0
push 0x20
push 0x20
push 1
push 0x6c
push edi
mov dword [ebp - 0x24], eax
mov dword [ebp - 0x20], 6
mov dword [ebp - 0x1c], 0x6d
mov dword [ebp - 0x18], 0x5d55e8
call esi
mov dword [ebp - 0x14], eax
lea eax, [ebp - 0x40]
push eax
call dword [sym.imp.USER32.dll_RegisterClassExA]
push 0
push edi
push 0
push 0
push 0
push bind
push 0
push bind
push 0xcf0000
push 0x5d5650
push 0x5d55e8
push 0
mov dword [0x5d564c], edi
call dword [sym.imp.USER32.dll_CreateWindowExA]
mov esi, eax
test esi, esi
je 0x406cb6
push 1
push esi
mov dword [0x5d55e4], esi
call dword [sym.imp.USER32.dll_ShowWindow]
push esi
call dword [sym.imp.USER32.dll_UpdateWindow]
push 0
push 0x4378e8
call dword [sym.imp.KERNEL32.dll_CreateDirectoryA]
sub esp, 8
call fcn.00412a40
push str.Initializing...
push 0xff
push 0x43dad0
call fcn.00413200
add esp, 0xc
push str.14:13:33
push str.Nov__8_2023
push 0x437914
push str.Data_Server_version:__s_Compiled_at:__s__s
push 0x43dad0
call fcn.00413050
mov esi, dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringA]
add esp, 0x14
push str..DataServer.ini
push 0x20
push 0x5d55c4
push 0x437958
push str.CustomerName
push str.DataServerInfo
call esi
push str..DataServer.ini
push 0x24
push 0x5d55a0
push str.0000000_0000000_0000000_0000000
push str.CustomerHardwareId
push str.DataServerInfo
call esi
push str..DataServer.ini
push 0x32
push 0x5d556c
push str.Resets
push str.ResetTable
push str.DataServerInfo
call esi
push str.KG_Free
lea ecx, [ebp - 0x198]
call fcn.00402720
mov edx, 0x5d55c4
lea ecx, [edx + 1]
nop
mov al, byte [edx]
inc edx
test al, al
jne 0x406940
mov esi, dword [ebp - 0x188]
sub edx, ecx
cmp dword [ebp - 0x184], 0x10
lea ecx, [ebp - 0x198]
cmovae ecx, dword [ebp - 0x198]
cmp esi, edx
jne 0x4069df
mov edx, 0x5d55c4
sub esi, 4
jb 0x406982
mov eax, dword [ecx]
cmp eax, dword [edx]
jne 0x406987
add ecx, 4
add edx, 4
sub esi, 4
jae 0x406971
cmp esi, 0xfffffffc
je 0x4069bb
mov al, byte [ecx]
cmp al, byte [edx]
jne 0x4069b4
cmp esi, 0xfffffffd
je 0x4069bb
mov al, byte [ecx + 1]
cmp al, byte [edx + 1]
jne 0x4069b4
cmp esi, 0xfffffffe
je 0x4069bb
mov al, byte [ecx + 2]
cmp al, byte [edx + 2]
jne 0x4069b4
cmp esi, 0xffffffff
je 0x4069bb
mov al, byte [ecx + 3]
cmp al, byte [edx + 3]
je 0x4069bb
sbb eax, eax
or eax, 1
jmp 0x4069bd
xor eax, eax
test eax, eax
jne 0x4069df
push 0x5d55c4
push str.DataServer_Login_Free:__s
push 0xffff
push 0x43dad0
call fcn.00413200
add esp, 0x10
jmp 0x4069eb
push 0xf
mov ecx, 0x43da50
call fcn.00412170
lea eax, [ebp - 0x328]
push eax
push 0x202
call dword [sym.imp.WS2_32.dll_WSAStartup]
test eax, eax
jne 0x406b5d
mov esi, dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringA]
lea eax, [ebp - 0x30]
push str..DataServer.ini
push 0x20
push eax
xorps xmm0, xmm0
push 0x437564
push str.DataServerODBC
push str.DataServerInfo
movaps xmmword [ebp - 0x30], xmm0
movaps xmmword [ebp - 0x20], xmm0
movaps xmmword [ebp - 0x80], xmm0
movaps xmmword [ebp - 0x70], xmm0
movaps xmmword [ebp - 0x60], xmm0
movaps xmmword [ebp - 0x50], xmm0
call esi
push str..DataServer.ini
push 0x20
lea eax, [ebp - 0x80]
push eax
push 0x437564
push str.DataServerUSER
push str.DataServerInfo
call esi
push str..DataServer.ini
push 0x20
lea eax, [ebp - 0x60]
push eax
push 0x437564
push str.DataServerPASS
push str.DataServerInfo
call esi
mov esi, dword [sym.imp.KERNEL32.dll_GetPrivateProfileIntA]
push str..DataServer.ini
push 0xda98
push str.DataServerPort
push str.DataServerInfo
call esi
push str..DataServer.ini
push 5
push str.MaxCharacters
movzx eax, ax
push str.DataServerInfo
mov dword [ebp - 0x32c], eax
call esi
push str..DataServer.ini
push 0
push str.DisableCheckName
push str.DataServerInfo
mov dword [0x5d5568], eax
call esi
push str..DataServer.ini
push 0
push str.RecycleSerial
push str.DataServerInfo
mov dword [0x5d5564], eax
call esi
mov dword [0x5d5560], eax
mov ecx, 0x442698
lea eax, [ebp - 0x60]
push eax
lea eax, [ebp - 0x80]
push eax
lea eax, [ebp - 0x30]
push eax
call fcn.00413620
test al, al
jne 0x406b1a
push str.Could_not_connect_to_database
push 0xff
push 0x43dad0
call fcn.00413200
add esp, 0xc
jmp 0x406b7b
push dword [ebp - 0x32c]
call fcn.004148c0
test al, al
jne 0x406b35
mov ecx, 0x442698
call fcn.004136b0
jmp 0x406b7b
push ecx
call fcn.00401800
push ecx
call fcn.004028e0
push 0
push 0x3e8
push 0x64
push dword [0x5d55e4]
call dword [sym.imp.USER32.dll_SetTimer]
call fcn.0040fe20
jmp 0x406b7b
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push str.WSAStartup___failed_with_error:__d
push 0xff
push 0x43dad0
call fcn.00413200
add esp, 0x10
push 0x5d4508
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov esi, dword [0x5d4530]
push 0x5d4508
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
push esi
push 0x437914
lea eax, [ebp - 0x180]
push str.__s__KG_DataServer__QueueSize_:__d_
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
lea eax, [ebp - 0x180]
push eax
push dword [0x5d55e4]
call dword [sym.imp.USER32.dll_SetWindowTextA]
push 0
push 0x7d0
push 0x65
push dword [0x5d55e4]
call dword [sym.imp.USER32.dll_SetTimer]
push 0x6d
push edi
call dword [sym.imp.USER32.dll_LoadAcceleratorsA]
mov esi, dword [sym.imp.USER32.dll_GetMessageA]
push 0
push 0
mov dword [ebp - 0x32c], eax
lea eax, [ebp - 0x348]
push 0
push eax
call esi
test eax, eax
je 0x406c56
mov edi, dword [sym.imp.USER32.dll_TranslateMessage]
nop dword [eax + eax]
lea eax, [ebp - 0x348]
push eax
push dword [ebp - 0x32c]
push dword [ebp - 0x348]
call dword [sym.imp.USER32.dll_TranslateAcceleratorA]
test eax, eax
jne 0x406c43
lea eax, [ebp - 0x348]
push eax
call edi
lea eax, [ebp - 0x348]
push eax
call dword [sym.imp.USER32.dll_DispatchMessageA]
push 0
push 0
push 0
lea eax, [ebp - 0x348]
push eax
call esi
test eax, eax
jne 0x406c10
push dword [0x5d56b4]
call dword [sym.imp.KERNEL32.dll_SetUnhandledExceptionFilter]
jmp 0x406c74
mov eax, dword [ebp - 0x184]
mov esi, dword [ebp - 0x340]
cmp eax, 0x10
jb 0x406cb2
mov edx, dword [ebp - 0x198]
lea ecx, [eax + 1]
mov eax, edx
cmp ecx, 0x1000
jb 0x406ca8
mov edx, dword [edx - 4]
add ecx, 0x23
sub eax, edx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x406ccd
push ecx
push edx
call fcn.0041668b
add esp, 8
mov eax, esi
jmp 0x406cb8
xor eax, eax
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop esi
call fcn.004163e0
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret 0x10
call fcn.0041a032
int3