Function at 0x404a50
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1450
call fcn.0040c310
mov eax, dword [0x41398c]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
mov edi, dword [ebp + 0x14]
push 0x41f
lea eax, [ebp - 0x423]
push 0
push eax
mov dword [ebp - 0x1450], esi
mov dword [ebp - 0x143c], edi
mov byte [ebp - 0x424], 0
call sub.msvcrt.dll_memset
add esp, 0xc
mov dword [ebp - 0x1434], 1
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [ebp - 0x1438], eax
test esi, esi
je 0x404ab8
cmp esi, 0xffffffff
jne 0x404abe
mov esi, dword [0x415a74]
test esi, esi
je 0x404ac7
cmp esi, 0xffffffff
jne 0x404adb
push 0xfffffffffffffff4
mov esi, 0x411060
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov dword [0x411060], eax
jmp 0x404ae3
cmp esi, 0x411060
jne 0x404aed
mov dword [ebp - 0x1434], 0
mov ebx, dword [ebp + 0xc]
cmp ebx, dword [esi + 4]
jae 0x404b08
pop edi
pop esi
xor eax, eax
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040c2f4
mov esp, ebp
pop ebp
ret
mov eax, dword [0x415a78]
test eax, eax
je 0x404b18
push eax
call dword [sym.imp.KERNEL32.dll_EnterCriticalSection]
test edi, edi
je 0x404b6a
cmp dword [esi + 4], 0
je 0x404b27
cmp ebx, 3
jne 0x404b6a
push edi
call dword [sym.imp.KERNEL32.dll_lstrlenA]
lea ebx, [eax + edi - 1]
mov dword [ebp - 0x1428], ebx
cmp ebx, edi
je 0x404b7a
lea esp, [esp]
mov al, byte [ebx]
cmp al, 0x5c
je 0x404b57
cmp al, 0x2f
je 0x404b57
dec ebx
cmp ebx, edi
jne 0x404b40
mov dword [ebp - 0x1428], ebx
jmp 0x404b7a
mov dword [ebp - 0x1428], ebx
cmp ebx, edi
je 0x404b7a
inc ebx
mov dword [ebp - 0x1428], ebx
jmp 0x404b7a
mov dword [ebp - 0x1428], 0
mov ebx, dword [ebp - 0x1428]
mov eax, dword [ebp + 0x1c]
test eax, eax
jne 0x404bdc
mov eax, dword [ebp - 0x1438]
lea ecx, [ebp - 0x424]
test eax, eax
jne 0x404bbf
push str.Unknown_error_code
push ecx
call dword [sym.imp.KERNEL32.dll_lstrcpyA]
cmp dword [ebp + 0xc], 3
jne 0x404bee
mov edx, dword [ebp + 0x18]
push edx
push ebx
lea eax, [ebp - 0x412]
push str._occured_in___s:_d_
push eax
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
jmp 0x404bee
push 0
push 0x3e8
push ecx
push 0x400
push eax
push 0
push 0x1200
call dword [sym.imp.KERNEL32.dll_FormatMessageA]
jmp 0x404bee
lea edx, [ebp + 0x20]
push edx
push eax
lea eax, [ebp - 0x424]
push eax
call dword [sym.imp.USER32.dll_wvsprintfA]
lea ecx, [ebp - 0x424]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov edi, eax
mov dword [ebp - 0x1430], edi
test edi, edi
jle 0x404e68
cmp byte [ebp + edi - 0x425], 0xa
jne 0x404c24
dec edi
mov dword [ebp - 0x1430], edi
mov byte [ebp + edi - 0x424], 0
test edi, edi
jle 0x404c41
cmp byte [ebp + edi - 0x425], 0xd
jne 0x404c41
dec edi
mov dword [ebp - 0x1430], edi
mov byte [ebp + edi - 0x424], 0
mov eax, dword [esi]
test eax, eax
je 0x404e68
cmp eax, 0xffffffff
je 0x404e68
push 2
lea edx, [ebp - 0x142c]
push edx
push 0
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea eax, [ebp - 0x144c]
push eax
call dword [sym.imp.KERNEL32.dll_GetLocalTime]
cmp dword [ebp - 0x1434], 0
je 0x404cdc
mov ecx, dword [esi]
mov ebx, dword [sym.imp.KERNEL32.dll_LockFile]
xor edi, edi
push edi
push 0x200
push edi
push edi
push ecx
call ebx
test eax, eax
jne 0x404cbc
push 0xa
call dword [sym.imp.KERNEL32.dll_Sleep]
mov edx, edi
inc edi
cmp edx, 0x3e8
ja 0x404cbc
mov eax, dword [esi]
push 0
push 0x200
push 0
push 0
push eax
call ebx
test eax, eax
je 0x404c95
mov ecx, dword [esi]
push 2
push 0
push 0
push ecx
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
lea ecx, [ebp - 0x144c]
call fcn.00404650
mov ebx, dword [ebp - 0x1428]
cmp dword [ebp + 0x10], 0
mov edi, dword [sym.imp.KERNEL32.dll_WriteFile]
je 0x404d50
movzx edx, word [ebp - 0x1440]
movzx eax, word [ebp - 0x1442]
movzx ecx, word [ebp - 0x1444]
push edx
movzx edx, word [ebp - 0x1446]
push eax
movzx eax, word [ebp - 0x144a]
push ecx
movzx ecx, word [ebp - 0x144c]
push edx
push eax
push ecx
lea edx, [ebp - 0x1424]
push str.__d__02d__02d__02d:_02d:_02d_
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x20
push 0
lea eax, [ebp - 0x142c]
push eax
lea ecx, [ebp - 0x1424]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push eax
mov eax, dword [esi]
lea edx, [ebp - 0x1424]
push edx
push eax
call edi
mov edx, dword [ebp + 0xc]
mov eax, dword [edx*4 + 0x411048]
push 0
lea ecx, [ebp - 0x142c]
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov ecx, dword [ebp + 0xc]
mov edx, dword [ecx*4 + 0x411048]
push eax
mov eax, dword [esi]
push edx
push eax
call edi
test ebx, ebx
je 0x404dc2
cmp dword [esi + 4], 0
jne 0x404dc2
mov ecx, dword [ebp + 0x18]
push ecx
push ebx
lea edx, [ebp - 0x1424]
push str.__10s:__4d_
push edx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0x10
push 0
lea eax, [ebp - 0x142c]
push eax
lea ecx, [ebp - 0x1424]
push ecx
call dword [sym.imp.KERNEL32.dll_lstrlenA]
push eax
mov eax, dword [esi]
lea edx, [ebp - 0x1424]
push edx
push eax
call edi
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
lea ecx, [ebp - 0x1424]
push str.__5d_
push ecx
call dword [sym.imp.USER32.dll_wsprintfA]
add esp, 0xc
push 0
lea edx, [ebp - 0x142c]
push edx
lea eax, [ebp - 0x1424]
push eax
call dword [sym.imp.KERNEL32.dll_lstrlenA]
mov edx, dword [esi]
push eax
lea ecx, [ebp - 0x1424]
push ecx
push edx
call edi
mov eax, dword [ebp - 0x1430]
test eax, eax
je 0x404e21
push 0
lea ecx, [ebp - 0x142c]
push ecx
push eax
mov eax, dword [esi]
lea edx, [ebp - 0x424]
push edx
push eax
call edi
mov edx, dword [esi]
push 0
lea ecx, [ebp - 0x142c]
push ecx
push 2
push 0x40db98
push edx
call edi
cmp dword [ebp + 0xc], 0
je 0x404e45
mov eax, dword [esi]
push eax
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
cmp dword [ebp - 0x1434], 0
je 0x404e62
mov ecx, dword [esi]
push 0
push 0x200
push 0
push 0
push ecx
call dword [sym.imp.KERNEL32.dll_UnlockFile]
mov edi, dword [ebp - 0x1430]
mov eax, dword [0x415a78]
test eax, eax
je 0x404e78
push eax
call dword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov esi, dword [ebp - 0x1438]
push esi
call dword [sym.imp.KERNEL32.dll_SetLastError]
cmp dword [ebp + 0x1c], 0
je 0x404eb7
test esi, esi
je 0x404eb7
cmp dword [ebp + 0xc], 3
jne 0x404eb7
mov edx, dword [ebp + 0x18]
mov eax, dword [ebp - 0x143c]
mov ecx, dword [ebp + 0x10]
push 0
push edx
mov edx, dword [ebp - 0x1450]
push eax
push ecx
push 3
push edx
call fcn.00404a50
add esp, 0x18
mov ecx, dword [ebp - 4]
mov eax, edi
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0040c2f4
mov esp, ebp
pop ebp
ret