Function at 0x412780
Capabilities:
Get file size
Print debug messages
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push 0xffffffffffffffff
push 0x4ddd01
mov eax, dword fs:[0]
push eax
sub esp, 0x198
mov eax, dword [0x53d9f8]
xor eax, ebp
mov dword [ebp - 0x10], eax
push ebx
push esi
push edi
push eax
lea eax, [ebp - 0xc]
mov dword fs:[0], eax
mov esi, ecx
mov eax, dword [ebp + 0xc]
mov edi, dword [ebp + 8]
mov ebx, dword [ebp + 0x14]
mov dword [ebp - 0x178], eax
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x1a0], eax
mov eax, dword [ebp + 0x18]
mov dword [ebp - 0x194], eax
mov eax, dword [ebp + 0x1c]
mov dword [ebp - 0x190], eax
lea eax, [esi + 0x30]
mov dword [ebp - 0x19c], ebx
mov dword [ebp - 0x198], eax
cmp edi, dword [eax]
jg 0x412cf8
push 0x6400000
call fcn.00413130
lea eax, [esi + 0x38]
push 0xffffffffffffffff
push dword [eax]
mov dword [ebp - 0x180], eax
call dword [sym.imp.KERNEL32.dll_WaitForSingleObject]
cmp dword [esi + 0x2c], 8
lea eax, [esi + 0x18]
jb 0x412819
mov eax, dword [eax]
push 0
push 0x80
push 4
push 0
push 1
push 0xc0000000
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov dword [ebp - 0x17c], eax
cmp eax, 0xffffffff
jne 0x412850
mov eax, dword [ebp - 0x180]
push dword [eax]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
jmp 0x412cf8
lea ecx, [ebp - 0x18c]
mov dword [ebp - 0x18c], 0
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
test eax, eax
jne 0x412892
push eax
lea eax, [ebp - 0x184]
mov word [ebp - 0x174], 0xfeff
push eax
push 2
lea eax, [ebp - 0x174]
push eax
push dword [ebp - 0x17c]
call dword [sym.imp.KERNEL32.dll_WriteFile]
xor eax, eax
mov dword [ebp - 0x148], 0
mov dword [ebp - 0x144], 7
mov word [ebp - 0x158], ax
push 0x500
lea ecx, [ebp - 0x158]
mov dword [ebp - 4], eax
call fcn.004034c0
lea eax, [ebp - 0x188]
push eax
call dword [sym.imp.api_ms_win_crt_time_l1_1_0.dll__time64]
mov dword [ebp - 0x188], eax
lea eax, [ebp - 0x188]
push eax
mov dword [ebp - 0x184], edx
call dword [sym.imp.api_ms_win_crt_time_l1_1_0.dll__localtime64]
push 0x102
mov dword [ebp - 0x174], eax
lea eax, [ebp - 0x140]
push 0
push eax
call sub.VCRUNTIME140.dll_memset
add esp, 0x14
cmp dword [esi + 0x14], 8
jb 0x41290c
mov esi, dword [esi]
call dword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
push eax
call dword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov ecx, dword [ebp - 0x174]
push eax
movsx eax, byte [edi + str.ENNNIWARNT]
push esi
push eax
push dword [ecx]
mov eax, dword [ecx + 0x10]
push dword [ecx + 4]
inc eax
push dword [ecx + 8]
push dword [ecx + 0xc]
push eax
mov eax, dword [ecx + 0x14]
add eax, 0x76c
push eax
push str._d__02d__02d__02d:_02d:_02d__t_c__t_s__t_08x:_08x__t
lea eax, [ebp - 0x140]
push 0x80
push eax
call fcn.00412200
lea ecx, [ebp - 0x140]
add esp, 0x34
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x412964
sub ecx, edx
lea eax, [ebp - 0x140]
sar ecx, 1
push ecx
push eax
lea ecx, [ebp - 0x158]
call fcn.004033b0
push 0xc802
call fcn.004bee3b
mov edi, eax
add esp, 4
test edi, edi
je 0x4129ab
push 0xc802
push 0
push edi
call sub.VCRUNTIME140.dll_memset
add esp, 0xc
jmp 0x4129ad
xor edi, edi
mov dword [ebp - 0x184], edi
push dword [ebp - 0x190]
mov byte [ebp - 4], 1
push 0
push dword [ebp - 0x194]
push 0x6400
push 0x6401
push edi
call fcn.00412140
push dword [eax + 4]
push dword [eax]
call dword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll___stdio_common_vsnwprintf_s]
mov eax, dword [ebp - 0x198]
add esp, 0x20
cmp dword [eax], 4
jg 0x412a09
mov ecx, edi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x4129f3
sub ecx, edx
sar ecx, 1
push ecx
push edi
jmp 0x412c0c
push 1
push 0x4f184c
lea ecx, [ebp - 0x158]
call fcn.00403230
mov esi, dword [sym.imp.KERNEL32.dll_lstrlenA]
test ebx, ebx
jne 0x412a29
xor ebx, ebx
jmp 0x412a56
push ebx
call esi
lea esi, [eax + 1]
lea eax, [esi + esi]
call fcn.004bf6c0
mov ebx, esp
xor eax, eax
push esi
push ebx
push 0xffffffffffffffff
push dword [ebp - 0x19c]
mov word [ebx], ax
push eax
push eax
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov esi, dword [sym.imp.KERNEL32.dll_lstrlenA]
mov ecx, ebx
lea edx, [ecx + 2]
jmp 0x412a60
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x412a60
sub ecx, edx
sar ecx, 1
push ecx
push ebx
lea ecx, [ebp - 0x158]
call fcn.00403230
push 1
push 0x4f1850
lea ecx, [ebp - 0x158]
call fcn.00403230
mov ecx, edi
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x412a93
sub ecx, edx
sar ecx, 1
push ecx
push edi
lea ecx, [ebp - 0x158]
call fcn.00403230
push 5
push 0x4f1854
lea ecx, [ebp - 0x158]
call fcn.00403230
mov eax, dword [ebp - 0x178]
test eax, eax
jne 0x412acf
xor ebx, ebx
jmp 0x412af9
push eax
call esi
lea esi, [eax + 1]
lea eax, [esi + esi]
call fcn.004bf6c0
mov ebx, esp
xor eax, eax
push esi
push ebx
push 0xffffffffffffffff
mov word [ebx], ax
mov eax, dword [ebp - 0x178]
push eax
push 0
push 0
call dword [sym.imp.KERNEL32.dll_MultiByteToWideChar]
mov ecx, ebx
lea edx, [ecx + 2]
mov edi, edi
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x412b00
sub ecx, edx
sar ecx, 1
push ecx
push ebx
lea ecx, [ebp - 0x158]
call fcn.00403230
push 1
push 0x4f1860
lea ecx, [ebp - 0x158]
call fcn.00403230
mov eax, dword [ebp - 0x1a0]
test eax, eax
jns 0x412b51
neg eax
push eax
lea eax, [ebp - 0x12]
push eax
call fcn.00412180
lea ecx, [eax - 2]
mov eax, 0x2d
mov word [ecx], ax
jmp 0x412b5d
push eax
lea eax, [ebp - 0x12]
push eax
call fcn.00412180
mov ecx, eax
xor eax, eax
xor edx, edx
mov word [ebp - 0x170], ax
add esp, 8
lea eax, [ebp - 0x12]
mov dword [ebp - 0x160], edx
mov esi, 7
mov dword [ebp - 0x15c], esi
cmp ecx, eax
je 0x412ba0
sub eax, ecx
sar eax, 1
push eax
push ecx
lea ecx, [ebp - 0x170]
call fcn.004033b0
mov esi, dword [ebp - 0x15c]
mov edx, dword [ebp - 0x160]
cmp esi, 8
mov byte [ebp - 4], 2
lea eax, [ebp - 0x170]
cmovae eax, dword [ebp - 0x170]
lea ecx, [ebp - 0x158]
push edx
push eax
call fcn.00403230
mov edx, dword [ebp - 0x15c]
mov byte [ebp - 4], 1
cmp edx, 8
jb 0x412c05
mov ecx, dword [ebp - 0x170]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x412bfb
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
ja 0x412ce8
push edx
push ecx
call fcn.004bee2d
add esp, 8
push 1
push 0x4f1864
lea ecx, [ebp - 0x158]
call fcn.00403230
mov byte [ebp - 4], 0
test edi, edi
je 0x412c28
push edi
call fcn.004bee44
add esp, 4
push 2
push 0x4f1868
lea ecx, [ebp - 0x158]
call fcn.00403230
cmp dword [ebp - 0x144], 8
lea eax, [ebp - 0x158]
cmovae eax, dword [ebp - 0x158]
push eax
call dword [sym.imp.KERNEL32.dll_OutputDebugStringW]
mov eax, dword [ebp - 0x148]
mov ebx, dword [ebp - 0x17c]
push 2
push 0
push 0
push ebx
mov dword [ebp - 0x1a4], 0
lea esi, [eax + eax]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
cmp dword [ebp - 0x144], 8
lea ecx, [ebp - 0x1a4]
push 0
push ecx
lea eax, [ebp - 0x158]
cmovae eax, dword [ebp - 0x158]
push esi
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_WriteFile]
push ebx
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, dword [ebp - 0x180]
push dword [eax]
call dword [sym.imp.KERNEL32.dll_ReleaseMutex]
mov edx, dword [ebp - 0x144]
cmp edx, 8
jb 0x412cf8
mov ecx, dword [ebp - 0x158]
lea edx, [edx*2 + 2]
mov eax, ecx
cmp edx, 0x1000
jb 0x412cee
mov ecx, dword [ecx - 4]
add edx, 0x23
sub eax, ecx
add eax, 0xfffffffc
cmp eax, 0x1f
jbe 0x412cee
call dword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
push edx
push ecx
call fcn.004bee2d
add esp, 8
lea esp, [ebp - 0x1b4]
mov ecx, dword [ebp - 0xc]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 0x10]
xor ecx, ebp
call fcn.004bee49
mov esp, ebp
pop ebp
ret 0x18