Function at 0x409f40
Capabilities:
Print debug messages
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x428ed8
push 0x40e3d4
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 8
mov eax, 0x303c
call fcn.0040e030
mov eax, dword [0x42e16c]
mov dword [ebp - 0x24], eax
push ebx
push esi
push edi
mov byte [ebp - 0x2028], 0
mov ecx, 0x3ff
xor eax, eax
lea edi, [ebp - 0x2027]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov byte [ebp - 0x1028], 0
mov ecx, 0x3ff
xor eax, eax
lea edi, [ebp - 0x1027]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
mov byte [ebp - 0x3028], 0
mov ecx, 0x3ff
xor eax, eax
lea edi, [ebp - 0x3027]
rep stosd dword es:[edi], eax
stosw word es:[edi], ax
stosb byte es:[edi], al
lea eax, [ebp + 0x1c]
mov dword [ebp - 0x1c], eax
cmp dword [ebp + 8], 0
jl 0x409fd2
cmp dword [ebp + 8], 3
jl 0x409fda
or eax, 0xffffffff
jmp 0x40a389
cmp dword [ebp + 8], 2
jne 0x40a084
push 0x42e100
call dword [sym.imp.KERNEL32.dll_InterlockedIncrement]
test eax, eax
jle 0x40a084
cmp dword [0x42f03c], 0
jne 0x40a042
push str.user32.dll
call dword [sym.imp.KERNEL32.dll_LoadLibraryA]
mov dword [ebp - 0x302c], eax
cmp dword [ebp - 0x302c], 0
je 0x40a03a
push str.wsprintfA
mov ecx, dword [ebp - 0x302c]
push ecx
call dword [sym.imp.KERNEL32.dll_GetProcAddress]
mov dword [0x42f03c], eax
cmp dword [0x42f03c], 0
jne 0x40a042
or eax, 0xffffffff
jmp 0x40a389
mov edx, dword [ebp + 0x10]
push edx
mov eax, dword [ebp + 0xc]
push eax
push str.Second_Chance_Assertion_Failed:_File__s__Line__d_n
lea ecx, [ebp - 0x1028]
push ecx
call dword [0x42f03c]
add esp, 0x10
lea edx, [ebp - 0x1028]
push edx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
push 0x42e100
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
call fcn.00409be0
or eax, 0xffffffff
jmp 0x40a389
cmp dword [ebp + 0x18], 0
je 0x40a0be
mov eax, dword [ebp - 0x1c]
push eax
mov ecx, dword [ebp + 0x18]
push ecx
push 0xfeb
lea edx, [ebp - 0x3028]
push edx
call fcn.0040e070
add esp, 0x10
test eax, eax
jge 0x40a0be
push str._CrtDbgReport:_String_too_long_or_IO_Error
lea eax, [ebp - 0x3028]
push eax
call fcn.0040f9b0
add esp, 8
cmp dword [ebp + 8], 2
jne 0x40a0f6
cmp dword [ebp + 0x18], 0
je 0x40a0d6
mov dword [ebp - 0x304c], str.Assertion_failed:
jmp 0x40a0e0
mov dword [ebp - 0x304c], str.Assertion_failed_
mov ecx, dword [ebp - 0x304c]
push ecx
lea edx, [ebp - 0x2028]
push edx
call fcn.0040f9b0
add esp, 8
lea eax, [ebp - 0x3028]
push eax
lea ecx, [ebp - 0x2028]
push ecx
call fcn.0040f9c0
add esp, 8
cmp dword [ebp + 8], 2
jne 0x40a149
mov edx, dword [ebp + 8]
mov eax, dword [edx*4 + 0x42e104]
and eax, 1
je 0x40a135
push 0x428e34
lea ecx, [ebp - 0x2028]
push ecx
call fcn.0040f9c0
add esp, 8
push 0x428e30
lea edx, [ebp - 0x2028]
push edx
call fcn.0040f9c0
add esp, 8
cmp dword [ebp + 0xc], 0
je 0x40a191
lea eax, [ebp - 0x2028]
push eax
mov ecx, dword [ebp + 0x10]
push ecx
mov edx, dword [ebp + 0xc]
push edx
push str._s__d__:__s
push 0x1000
lea eax, [ebp - 0x1028]
push eax
call fcn.0040def0
add esp, 0x18
test eax, eax
jge 0x40a18f
push str._CrtDbgReport:_String_too_long_or_IO_Error
lea ecx, [ebp - 0x1028]
push ecx
call fcn.0040f9b0
add esp, 8
jmp 0x40a1a7
lea edx, [ebp - 0x2028]
push edx
lea eax, [ebp - 0x1028]
push eax
call fcn.0040f9b0
add esp, 8
cmp dword [0x430950], 0
je 0x40a258
push 0xf
call fcn.0040f4f0
add esp, 4
mov dword [ebp - 4], 0
mov ecx, dword [0x430950]
mov dword [ebp - 0x3030], ecx
jmp 0x40a1e2
mov edx, dword [ebp - 0x3030]
mov eax, dword [edx + 4]
mov dword [ebp - 0x3030], eax
cmp dword [ebp - 0x3030], 0
je 0x40a23f
lea ecx, [ebp - 0x20]
push ecx
lea edx, [ebp - 0x1028]
push edx
mov eax, dword [ebp + 8]
push eax
mov ecx, dword [ebp - 0x3030]
call dword [ecx + 0xc]
add esp, 0xc
test eax, eax
je 0x40a23d
cmp dword [ebp + 8], 2
jne 0x40a21b
push 0x42e100
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
mov edx, dword [ebp - 0x20]
mov dword [ebp - 0x3050], edx
push 0xffffffffffffffff
lea eax, [ebp - 0x10]
push eax
call fcn.0040acda
add esp, 8
mov eax, dword [ebp - 0x3050]
jmp 0x40a389
jmp 0x40a1d3
mov dword [ebp - 4], 0xffffffff
call fcn.0040a24d
jmp 0x40a258
cmp dword [0x43094c], 0
je 0x40a296
lea ecx, [ebp - 0x20]
push ecx
lea edx, [ebp - 0x1028]
push edx
mov eax, dword [ebp + 8]
push eax
call dword [0x43094c]
add esp, 0xc
test eax, eax
je 0x40a296
cmp dword [ebp + 8], 2
jne 0x40a28e
push 0x42e100
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
mov eax, dword [ebp - 0x20]
jmp 0x40a389
mov ecx, dword [ebp + 8]
mov edx, dword [ecx*4 + 0x42e104]
and edx, 1
je 0x40a2e3
mov eax, dword [ebp + 8]
cmp dword [eax*4 + 0x42e110], 0xffffffff
je 0x40a2e3
push 0
lea ecx, [ebp - 0x3034]
push ecx
lea edx, [ebp - 0x1028]
push edx
call fcn.0040f920
add esp, 4
push eax
lea eax, [ebp - 0x1028]
push eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx*4 + 0x42e110]
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [ebp + 8]
mov ecx, dword [eax*4 + 0x42e104]
and ecx, 2
je 0x40a2ff
lea edx, [ebp - 0x1028]
push edx
call dword [sym.imp.KERNEL32.dll_OutputDebugStringA]
mov eax, dword [ebp + 8]
mov ecx, dword [eax*4 + 0x42e104]
and ecx, 4
je 0x40a376
cmp dword [ebp + 0x10], 0
je 0x40a331
push 0xa
lea edx, [ebp - 0x3048]
push edx
mov eax, dword [ebp + 0x10]
push eax
call fcn.0040f630
add esp, 0xc
mov dword [ebp - 0x3054], eax
jmp 0x40a33b
mov dword [ebp - 0x3054], 0
lea ecx, [ebp - 0x3028]
push ecx
mov edx, dword [ebp + 0x14]
push edx
mov eax, dword [ebp - 0x3054]
push eax
mov ecx, dword [ebp + 0xc]
push ecx
mov edx, dword [ebp + 8]
push edx
call fcn.0040a3b0
add esp, 0x14
mov dword [ebp - 0x20], eax
cmp dword [ebp + 8], 2
jne 0x40a371
push 0x42e100
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
mov eax, dword [ebp - 0x20]
jmp 0x40a389
cmp dword [ebp + 8], 2
jne 0x40a387
push 0x42e100
call dword [sym.imp.KERNEL32.dll_InterlockedDecrement]
xor eax, eax
mov ecx, dword [ebp - 0x10]
mov dword fs:[0], ecx
mov ecx, dword [ebp - 0x24]
call fcn.0040dcd0
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret