Function at 0x40caa5
Capabilities:
Initialize winsock library
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x7ec
mov eax, dword [0x416180]
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_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::constructor_unsigned_short_int_const__]
push ebx
mov esi, 0x41233c
push esi
lea ecx, [ebp - 0x3c]
call dword [sym.imp.MSVCP71.dll_public:_unsigned_int___thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::find_unsigned_short_int_const___unsigned_int_const]
cmp eax, 0xffffffff
je 0x40cb66
mov ecx, dword [sym.imp.MSVCP71.dll_unsigned_int_const_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::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_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int_____thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::substr_unsigned_int__unsigned_int_]
push eax
lea ecx, [ebp - 0x3c]
call dword [sym.imp.MSVCP71.dll_public:_class_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int______thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::operator_class_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int___const__]
lea ecx, [ebp - 0x7ec]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::destructor_void_]
push ebx
push esi
lea ecx, [ebp - 0x3c]
call dword [sym.imp.MSVCP71.dll_public:_unsigned_int___thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::find_unsigned_short_int_const___unsigned_int_const]
cmp eax, 0xffffffff
je 0x40cb66
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_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int_____thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::substr_unsigned_int__unsigned_int_]
push eax
lea ecx, [ebp - 0x3c]
call dword [sym.imp.MSVCP71.dll_public:_class_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int______thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::operator_class_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int___const__]
lea ecx, [ebp - 0x7ec]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::destructor_void_]
lea eax, [ebp - 0x3c]
push eax
call fcn.0040e18e
push 8
mov ecx, eax
pop edi
add ecx, edi
call dword [sym.imp.MSVCP71.dll_public:_class_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int______thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::operator_class_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int___const__]
call fcn.0040e18e
xor esi, esi
add eax, edi
inc esi
cmp dword [eax + 0x14], esi
jae 0x40cb9b
push 0x412320
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
jmp 0x40cdee
call fcn.0040e18e
mov ecx, eax
call fcn.0040e1d3
test al, al
je 0x40cdee
lea ecx, [ebp - 0x20]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::constructor_void_]
push str.BugReport.xml
call fcn.0040e18e
add eax, edi
push eax
lea eax, [ebp - 0x7ec]
push eax
call fcn.004023d4
add esp, 0xc
push eax
lea ecx, [ebp - 0x20]
call dword [sym.imp.MSVCP71.dll_public:_class_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int______thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::operator_class_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int___const__]
lea ecx, [ebp - 0x7ec]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::destructor_void_]
cmp dword [ebp - 8], edi
mov eax, dword [ebp - 0x1c]
jae 0x40cbf5
lea eax, [ebp - 0x1c]
push eax
call fcn.0040e18e
mov ecx, eax
add ecx, 0x28
call fcn.00406766
push str.BugDetail.txt
call fcn.0040e18e
add eax, edi
push eax
lea eax, [ebp - 0x7ec]
push eax
call fcn.004023d4
add esp, 0xc
push eax
lea ecx, [ebp - 0x20]
call dword [sym.imp.MSVCP71.dll_public:_class_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int______thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::operator_class_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int___const__]
lea ecx, [ebp - 0x7ec]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::destructor_void_]
cmp dword [ebp - 8], edi
mov eax, dword [ebp - 0x1c]
jae 0x40cc42
lea eax, [ebp - 0x1c]
push 0x4122e0
push eax
call dword [sym.imp.MSVCR71.dll__wfopen]
mov edi, eax
cmp edi, ebx
pop ecx
pop ecx
je 0x40ccb1
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.0040e18e
mov ecx, eax
add ecx, 0x28
call fcn.00407258
push eax
call dword [sym.imp.MSVCR71.dll_wcslen]
pop ecx
push eax
push 2
call fcn.0040e18e
mov ecx, eax
add ecx, 0x28
call fcn.00407258
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.0040b697
pop ecx
push ebx
push dword [ebp - 0x7d0]
mov esi, 0x416bd8
push ebx
mov ecx, esi
call fcn.0040b96c
xor edi, edi
inc edi
mov byte [ebp - 0x7c5], bl
mov byte [ebp - 0x7cb], bl
call fcn.0040e18e
mov ecx, eax
call fcn.0040e0a0
test eax, eax
jne 0x40cd45
lea ecx, [ebp - 0x634]
call fcn.0040c915
push ebx
call dword [sym.imp.USER32.dll_GetActiveWindow]
push eax
lea ecx, [ebp - 0x634]
call fcn.0040ba18
mov edi, eax
cmp edi, 1
jne 0x40cd38
cmp byte [ebp - 0x614], bl
je 0x40cd29
mov byte [ebp - 0x7c5], al
cmp byte [ebp - 0x613], bl
je 0x40cd38
mov byte [ebp - 0x7cb], 1
lea ecx, [ebp - 0x634]
call fcn.0040ca54
jmp 0x40cd5c
call fcn.0040e18e
mov ecx, eax
call fcn.0040e0c9
test al, al
je 0x40cd70
mov byte [ebp - 0x7cb], 1
cmp byte [ebp - 0x7cb], bl
je 0x40cd70
call fcn.0040e18e
mov ecx, eax
call fcn.0040e0de
call fcn.0040e18e
mov ecx, eax
call fcn.0040e0a7
test al, al
je 0x40cd87
mov byte [ebp - 0x7c5], 1
call fcn.0040e18e
mov ecx, eax
call fcn.0040e0ae
test al, al
je 0x40cd9d
mov byte [ebp - 0x7c5], bl
cmp byte [ebp - 0x7c5], bl
je 0x40cdd6
lea eax, [ebp - 0x7c4]
push eax
push 0x202
call dword [sym.imp.WS2_32.dll_WSAStartup]
test eax, eax
jne 0x40cdd6
call fcn.0040b7b9
test al, al
je 0x40cdd0
call fcn.0040e18e
mov ecx, eax
call fcn.0040e637
call dword [sym.imp.WS2_32.dll_WSACleanup]
mov ecx, esi
call fcn.0040bd9d
call dword [sym.imp.ole32.dll_CoUninitialize]
lea ecx, [ebp - 0x20]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::destructor_void_]
mov esi, edi
lea ecx, [ebp - 0x3c]
call dword [sym.imp.MSVCP71.dll_public:_void___thiscall_std::basic_string_unsigned_short_int__struct_std::char_traits_unsigned_short_int___class_std::allocator_unsigned_short_int__::destructor_void_]
mov ecx, dword [ebp - 4]
pop edi
mov eax, esi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040f50d
leave
ret 0x10