Function at 0x40d22d
Capabilities:
Initialize winsock library
Print debug messages
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x7ec
mov eax, dword [0x423694]
push ebx
xor eax, ebp
push esi
push edi
mov edi, dword [ebp + 0x10]
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
xor ebx, ebx
push ebx
mov dword [ebp - 0x7d0], eax
call dword [sym.imp.ole32.dll_CoInitialize]
mov esi, dword [sym.imp.KERNEL32.dll_SetErrorMode]
push ebx
call esi
or eax, 2
push eax
call esi
push edi
lea ecx, [ebp - 0x3c]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::constructor_wchar_t_const__]
push ebx
mov esi, 0x41aed8
push esi
lea ecx, [ebp - 0x3c]
call dword [sym.imp.MSVCP71.dll_public:_unsigned_int___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::find_wchar_t_const___unsigned_int_const]
cmp eax, 0xffffffff
je 0x40d2ee
mov ecx, dword [sym.imp.MSVCP71.dll_unsigned_int_const_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::npos]
push dword [ecx]
inc eax
push eax
lea eax, [ebp - 0x7ec]
push eax
lea ecx, [ebp - 0x3c]
call dword [sym.imp.MSVCP71.dll_public:_class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t_____thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::substr_unsigned_int__unsigned_int_]
push eax
lea ecx, [ebp - 0x3c]
call dword [0x4192fc]
lea ecx, [ebp - 0x7ec]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
push ebx
push esi
lea ecx, [ebp - 0x3c]
call dword [sym.imp.MSVCP71.dll_public:_unsigned_int___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::find_wchar_t_const___unsigned_int_const]
cmp eax, 0xffffffff
je 0x40d2ee
push eax
push ebx
lea eax, [ebp - 0x7ec]
push eax
lea ecx, [ebp - 0x3c]
call dword [sym.imp.MSVCP71.dll_public:_class_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t_____thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::substr_unsigned_int__unsigned_int_]
push eax
lea ecx, [ebp - 0x3c]
call dword [0x4192fc]
lea ecx, [ebp - 0x7ec]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
lea eax, [ebp - 0x3c]
push eax
call fcn.0040e916
push 8
mov ecx, eax
pop edi
add ecx, edi
call dword [0x4192fc]
call fcn.0040e916
xor esi, esi
add eax, edi
inc esi
cmp dword [eax + 0x14], esi
jae 0x40d323
push 0x41b578
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
jmp 0x40d576
call fcn.0040e916
mov ecx, eax
call fcn.0040e95b
test al, al
je 0x40d576
lea ecx, [ebp - 0x20]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::constructor_void_]
push str.BugReport.xml
call fcn.0040e916
add eax, edi
push eax
lea eax, [ebp - 0x7ec]
push eax
call fcn.004023ed
add esp, 0xc
push eax
lea ecx, [ebp - 0x20]
call dword [0x4192fc]
lea ecx, [ebp - 0x7ec]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
cmp dword [ebp - 8], edi
mov eax, dword [ebp - 0x1c]
jae 0x40d37d
lea eax, [ebp - 0x1c]
push eax
call fcn.0040e916
mov ecx, eax
add ecx, 0x28
call fcn.0040677f
push str.BugDetail.txt
call fcn.0040e916
add eax, edi
push eax
lea eax, [ebp - 0x7ec]
push eax
call fcn.004023ed
add esp, 0xc
push eax
lea ecx, [ebp - 0x20]
call dword [0x4192fc]
lea ecx, [ebp - 0x7ec]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
cmp dword [ebp - 8], edi
mov eax, dword [ebp - 0x1c]
jae 0x40d3ca
lea eax, [ebp - 0x1c]
push 0x41b538
push eax
call dword [sym.imp.MSVCR71.dll__wfopen]
mov edi, eax
cmp edi, ebx
pop ecx
pop ecx
je 0x40d439
push edi
push 2
push esi
mov esi, dword [sym.imp.MSVCR71.dll_fwrite]
lea eax, [ebp - 0x7cc]
push eax
mov byte [ebp - 0x7cc], 0xff
mov byte [ebp - 0x7cb], 0xfe
call esi
add esp, 0x10
push edi
call fcn.0040e916
mov ecx, eax
add ecx, 0x28
call fcn.00407271
push eax
call dword [sym.imp.MSVCR71.dll_wcslen]
pop ecx
push eax
push 2
call fcn.0040e916
mov ecx, eax
add ecx, 0x28
call fcn.00407271
push eax
call esi
push edi
call dword [sym.imp.MSVCR71.dll_fclose]
add esp, 0x14
push ebx
push ebx
push ebx
push ebx
call dword [sym.imp.USER32.dll_DefWindowProcW]
push 4
call fcn.0040be1f
pop ecx
push ebx
push dword [ebp - 0x7d0]
mov esi, 0x4240e8
push ebx
mov ecx, esi
call fcn.0040c0f4
xor edi, edi
inc edi
mov byte [ebp - 0x7c5], bl
mov byte [ebp - 0x7cb], bl
call fcn.0040e916
mov ecx, eax
call fcn.0040e828
test eax, eax
jne 0x40d4cd
lea ecx, [ebp - 0x634]
call fcn.0040d09d
push ebx
call dword [sym.imp.USER32.dll_GetActiveWindow]
push eax
lea ecx, [ebp - 0x634]
call fcn.0040c1a0
mov edi, eax
cmp edi, 1
jne 0x40d4c0
cmp byte [ebp - 0x614], bl
je 0x40d4b1
mov byte [ebp - 0x7c5], al
cmp byte [ebp - 0x613], bl
je 0x40d4c0
mov byte [ebp - 0x7cb], 1
lea ecx, [ebp - 0x634]
call fcn.0040d1dc
jmp 0x40d4e4
call fcn.0040e916
mov ecx, eax
call fcn.0040e851
test al, al
je 0x40d4f8
mov byte [ebp - 0x7cb], 1
cmp byte [ebp - 0x7cb], bl
je 0x40d4f8
call fcn.0040e916
mov ecx, eax
call fcn.0040e866
call fcn.0040e916
mov ecx, eax
call fcn.0040e82f
test al, al
je 0x40d50f
mov byte [ebp - 0x7c5], 1
call fcn.0040e916
mov ecx, eax
call fcn.0040e836
test al, al
je 0x40d525
mov byte [ebp - 0x7c5], bl
cmp byte [ebp - 0x7c5], bl
je 0x40d55e
lea eax, [ebp - 0x7c4]
push eax
push 0x202
call dword [sym.imp.WS2_32.dll_WSAStartup]
test eax, eax
jne 0x40d55e
call fcn.0040bf41
test al, al
je 0x40d558
call fcn.0040e916
mov ecx, eax
call fcn.0040edbf
call dword [sym.imp.WS2_32.dll_WSACleanup]
mov ecx, esi
call fcn.0040c525
call dword [sym.imp.ole32.dll_CoUninitialize]
lea ecx, [ebp - 0x20]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
mov esi, edi
lea ecx, [ebp - 0x3c]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_wchar_t__struct_std::char_traits_wchar_t___class_std::allocator_wchar_t__::destructor_void_]
mov ecx, dword [ebp - 4]
pop edi
mov eax, esi
pop esi
xor ecx, ebp
pop ebx
call fcn.00417249
leave
ret 0x10