Function at 0x404990
Capabilities:
Initialize winsock library
Read .ini file

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x32c
mov eax, dword [0x413018]
xor eax, esp
mov dword [esp + 0x328], eax
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
jmp 0x4049c2
mov ebx, 1
push ebx
call dword [sym.imp.KERNEL32.dll_SetErrorMode]
push 0x407c20
call dword [sym.imp.KERNEL32.dll_SetUnhandledExceptionFilter]
mov esi, dword [sym.imp.USER32.dll_LoadStringA]
push 0x64
push 0x4e1710
push 0x65
push edi
mov dword [0x4e1794], eax
call esi
push 0x64
push 0x4e16a8
push 0x69
push edi
call esi
mov eax, edi
call fcn.00404ea0
mov eax, dword [ebp + 0x14]
push eax
mov ecx, edi
call fcn.00404f20
add esp, 4
test eax, eax
jne 0x404a2c
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x328]
xor ecx, esp
call fcn.0040bb18
mov esp, ebp
pop ebp
ret 0x10
mov esi, dword [sym.imp.KERNEL32.dll_GetPrivateProfileIntA]
push str..JoinServer.ini
push 0
push str.CustomerLicenseId
push str.JoinServerInfo
call esi
mov word [0x4e169c], ax
test byte [0x4dfe78], bl
jne 0x404a6b
or dword [0x4dfe78], ebx
call fcn.00407d30
push 0x40d070
call fcn.0040bc27
add esp, 4
push 0x1b
mov ecx, 0x4dfe80
call fcn.004081b0
push 0x40f740
push str.S4_Ep_1
lea ecx, [esp + 0x238]
push str._JoinServer__SSeMU_Emulator___s__s___Ver:_2.2.0_
push ecx
call dword [sym.imp.USER32.dll_wsprintfA]
mov eax, dword [0x4e16a0]
add esp, 0x10
lea edx, [esp + 0x230]
push edx
push eax
call dword [sym.imp.USER32.dll_SetWindowTextA]
test byte [0x4dff5c], bl
jne 0x404acb
or dword [0x4dff5c], ebx
call fcn.00409980
push 0x40d080
call fcn.0040bc27
add esp, 4
mov ecx, dword [0x4e16a0]
push ecx
mov ecx, 0x4dff60
call fcn.00409a20
lea edx, [esp + 0x30]
push edx
push 0x202
call dword [sym.imp.WS2_32.dll_WSAStartup]
test eax, eax
jne 0x404dcf
mov ebx, dword [sym.imp.KERNEL32.dll_GetPrivateProfileStringA]
push str..JoinServer.ini
push 0x20
mov byte [esp + 0x218], al
mov dword [esp + 0x219], eax
mov dword [esp + 0x21d], eax
mov dword [esp + 0x221], eax
mov dword [esp + 0x225], eax
mov dword [esp + 0x229], eax
mov dword [esp + 0x22d], eax
mov dword [esp + 0x231], eax
mov word [esp + 0x235], ax
mov byte [esp + 0x237], al
mov byte [esp + 0x1f8], al
mov dword [esp + 0x1f9], eax
mov dword [esp + 0x1fd], eax
mov dword [esp + 0x201], eax
mov dword [esp + 0x205], eax
mov dword [esp + 0x209], eax
mov dword [esp + 0x20d], eax
mov dword [esp + 0x211], eax
mov word [esp + 0x215], ax
mov byte [esp + 0x217], al
mov byte [esp + 0x1d8], al
mov dword [esp + 0x1d9], eax
mov dword [esp + 0x1dd], eax
mov dword [esp + 0x1e1], eax
mov dword [esp + 0x1e5], eax
mov dword [esp + 0x1e9], eax
mov dword [esp + 0x1ed], eax
mov dword [esp + 0x1f1], eax
mov word [esp + 0x1f5], ax
mov byte [esp + 0x1f7], al
lea eax, [esp + 0x218]
push eax
push 0x40f96d
push str.JoinServerODBC
push str.JoinServerInfo
call ebx
push str..JoinServer.ini
push 0x20
lea ecx, [esp + 0x1f8]
push ecx
push 0x40f96d
push str.JoinServerUSER
push str.JoinServerInfo
call ebx
push str..JoinServer.ini
push 0x20
lea edx, [esp + 0x1d8]
push edx
push 0x40f96d
push str.JoinServerPASS
push str.JoinServerInfo
call ebx
push str..JoinServer.ini
push 0xdaa2
push str.JoinServerPort
push str.JoinServerInfo
call esi
push str..JoinServer.ini
push 0x10
lea ecx, [esp + 0x1c8]
push ecx
movzx eax, ax
push str.127.0.0.1
mov dword [esp + 0x20], eax
xor eax, eax
push str.ConnectServerAddress
push str.JoinServerInfo
mov byte [esp + 0x1d8], 0
mov dword [esp + 0x1d9], eax
mov dword [esp + 0x1dd], eax
mov dword [esp + 0x1e1], eax
mov word [esp + 0x1e5], ax
mov byte [esp + 0x1e7], al
call ebx
push str..JoinServer.ini
push 0xd905
push str.ConnectServerPort
push str.JoinServerInfo
call esi
push str..JoinServer.ini
push 0
push str.MaxConnectionPerIP
push str.JoinServerInfo
movzx ebx, ax
call esi
push str..JoinServer.ini
push 0
push str.MaxConnectionPerHID
push str.JoinServerInfo
mov word [0x4e1698], ax
call esi
push str..JoinServer.ini
push 0
push str.MD5Encryption
push str.JoinServerInfo
mov word [0x4e1694], ax
call esi
test byte [0x414ea8], 1
mov dword [0x4e1690], eax
jne 0x404d1f
or dword [0x414ea8], 1
call fcn.00408b50
push 0x40cf00
call fcn.0040bc27
add esp, 4
lea edx, [esp + 0x1d0]
push edx
lea eax, [esp + 0x1f4]
push eax
lea eax, [esp + 0x218]
mov ecx, 0x414eb0
call fcn.00408c50
test al, al
jne 0x404d58
push str.Could_not_connect_to_database__ODBC_Error_
push 1
call fcn.0040b700
add esp, 8
jmp 0x404de4
mov ecx, dword [esp + 0x10]
push ecx
call fcn.004048d0
mov ecx, eax
call fcn.0040a3a0
test al, al
jne 0x404d7b
call fcn.00401e40
mov esi, eax
call fcn.00408ce0
jmp 0x404de4
push ebx
call fcn.00404940
lea ebx, [esp + 0x1c4]
call fcn.0040b420
test al, al
jne 0x404dab
call fcn.004048d0
mov esi, eax
call fcn.0040a430
call fcn.00401e40
mov esi, eax
call fcn.00408ce0
jmp 0x404de4
call fcn.00404830
mov ecx, eax
call fcn.00403950
mov edx, dword [0x4e16a0]
push 0
push 0x3e8
push 0x64
push edx
call dword [sym.imp.USER32.dll_SetTimer]
jmp 0x404de4
call dword [sym.imp.WS2_32.dll_WSAGetLastError]
push eax
push str.WSAStartup___failed_with_error:__d
push ebx
call fcn.0040b700
add esp, 0xc
mov eax, dword [0x4e16a0]
push 0
push 0x7d0
push 0x65
push eax
call dword [sym.imp.USER32.dll_SetTimer]
push 0x69
push edi
call dword [sym.imp.USER32.dll_LoadAcceleratorsA]
mov edi, dword [sym.imp.USER32.dll_GetMessageA]
push 0
push 0
push 0
lea ecx, [esp + 0x20]
push ecx
mov esi, eax
call edi
test eax, eax
je 0x404e59
mov ebx, dword [sym.imp.USER32.dll_TranslateAcceleratorA]
mov eax, dword [esp + 0x14]
lea edx, [esp + 0x14]
push edx
push esi
push eax
call ebx
test eax, eax
jne 0x404e48
lea ecx, [esp + 0x14]
push ecx
call dword [sym.imp.USER32.dll_TranslateMessage]
lea edx, [esp + 0x14]
push edx
call dword [sym.imp.USER32.dll_DispatchMessageA]
push 0
push 0
push 0
lea eax, [esp + 0x20]
push eax
call edi
test eax, eax
jne 0x404e21
mov ecx, dword [0x4e1794]
push ecx
call dword [sym.imp.KERNEL32.dll_SetUnhandledExceptionFilter]
jmp 0x404e78
mov ecx, dword [esp + 0x334]
mov eax, dword [esp + 0x1c]
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0040bb18
mov esp, ebp
pop ebp
ret 0x10