Function at 0x412bfc
Capabilities:
Clear file content
Get file attributes
Get file size

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
cmp byte [ebp + 8], 1
push ebx
push esi
mov esi, eax
movzx eax, byte [ebp + 8]
sete bl
cmp dword [esi + 0x10], 1
push edi
mov edi, dword [esi + 0x20]
mov dword [ebp - 0xc], eax
ja 0x412c27
mov ecx, dword [ebp + 0xc]
push esi
call fcn.004177c0
cmp byte [ebp + 0x18], 0
jne 0x412c46
cmp dword [esi + 0x10], 1
jbe 0x412c46
cmp byte [0x4825b7], 0
mov byte [ebp - 3], 1
je 0x412c4a
mov byte [ebp - 2], 1
jmp 0x412c54
mov byte [ebp - 3], 0
cmp byte [ebp - 3], 0
mov byte [ebp - 2], 0
je 0x412c61
cmp byte [0x4825b8], 0
mov byte [ebp - 1], 1
jne 0x412c65
mov byte [ebp - 1], 0
cmp byte [ebp - 2], 0
jne 0x412c7e
cmp byte [ebp + 8], 0
je 0x412c77
cmp byte [ebp + 8], 2
jne 0x412c7e
mov dword [ebp - 0xc], 5
test edi, edi
je 0x412ca6
mov al, byte [esi + 0x1d]
test al, 1
je 0x412c8f
cmp byte [ebp + 0x18], 0
jne 0x412c9f
test bl, bl
je 0x412f2f
test al, 2
jne 0x412f2f
mov ecx, esi
call fcn.00416977
mov ecx, dword [ebp + 0xc]
push esi
call fcn.004169fe
mov ecx, eax
mov dword [ebp - 8], ecx
mov edi, ecx
call fcn.00433e1d
test al, al
jne 0x412cc8
mov ecx, edi
call fcn.004344f6
mov edi, eax
mov ecx, edi
call fcn.00435dbe
mov ecx, dword [esi + 0xc]
cmp ecx, edx
jb 0x412cfc
ja 0x412cdf
mov ecx, dword [esi + 8]
cmp ecx, eax
jbe 0x412cfc
mov eax, dword [ebp + 0x10]
mov dword [eax], 0xdf
mov ecx, dword [ebp - 8]
test ecx, ecx
je 0x412cf4
call fcn.0043492c
or eax, 0xffffffff
jmp 0x412f31
test bl, bl
je 0x412d07
mov dword [ebp - 0xc], 6
mov edx, dword [ebp - 0xc]
mov ecx, dword [ebp - 8]
call fcn.004355cc
mov edi, eax
cmp edi, 0xffffffff
jne 0x412d6f
test bl, bl
je 0x412d3b
mov ecx, dword [ebp - 8]
call fcn.004361fc
test al, al
je 0x412d3b
mov edx, dword [ebp - 0xc]
mov ecx, dword [ebp - 8]
call fcn.004355cc
mov edi, eax
cmp edi, 0xffffffff
jne 0x412d6f
call dword [sym.imp.KERNEL32.DLL_GetLastError]
mov ecx, dword [ebp + 0x10]
mov dword [ecx], eax
cmp eax, 0x20
jne 0x412e6d
cmp dword [0x482540], 0
je 0x412e6d
dec dword [0x482540]
push 0xc8
call dword [sym.imp.KERNEL32.DLL_Sleep]
jmp 0x412d07
test bl, bl
je 0x412eca
cmp byte [ebp + 0x1c], 0
je 0x412da1
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.DLL_GetFileAttributesW]
test eax, 0x200
je 0x412dc1
xor eax, eax
push eax
lea ecx, [ebp - 0x10]
push ecx
push eax
push eax
mov byte [ebp - 4], 0
push 1
lea eax, [ebp - 4]
jmp 0x412db4
cmp byte [0x4825a4], 0
je 0x412dc1
xor eax, eax
push eax
lea ecx, [ebp - 0x10]
push ecx
push eax
push eax
push eax
push eax
push 0x900c4
push edi
call dword [sym.imp.KERNEL32.DLL_DeviceIoControl]
cmp dword [ebp - 0xc], 6
jne 0x412eca
mov eax, dword [ebp + 0xc]
cmp dword [eax + 0x48], 0
jne 0x412eca
lea eax, [ebp - 0x14]
push eax
push edi
mov byte [0x482573], 1
call dword [sym.imp.KERNEL32.DLL_GetFileSize]
mov dword [ebp - 0x18], eax
cmp eax, 0xffffffff
jne 0x412e00
call dword [sym.imp.KERNEL32.DLL_GetLastError]
test eax, eax
jne 0x412eac
mov eax, dword [esi + 8]
mov ecx, dword [esi + 0xc]
cmp dword [ebp - 0x18], eax
jne 0x412e12
mov edx, dword [ebp - 0x14]
cmp edx, ecx
je 0x412e2e
push ecx
push eax
mov ecx, edi
call fcn.004356c8
test eax, eax
jne 0x412eac
push edi
call dword [sym.imp.KERNEL32.DLL_SetEndOfFile]
test eax, eax
je 0x412eac
cmp byte [0x482570], 0
je 0x412e4d
cmp byte [0x4825a5], 0
je 0x412e4d
push dword [esi + 0xc]
push dword [esi + 8]
push edi
call dword [0x482548]
cmp byte [ebp - 1], 0
mov byte [0x482573], 0
je 0x412eca
mov ecx, edi
call fcn.004355fa
mov dword [ebp - 0xc], 1
jmp 0x412d07
cmp byte [ebp + 8], 3
je 0x412e79
cmp byte [ebp + 0x14], 0
je 0x412e96
cmp eax, 0x490
je 0x412ce8
cmp eax, 2
je 0x412ce8
cmp eax, 3
je 0x412ce8
push eax
push dword [ebp - 8]
push str.Error_opening___s_:__E
call fcn.0045c3cd
add esp, 0xc
jmp 0x412ce8
mov byte [0x482573], 0
call dword [sym.imp.KERNEL32.DLL_GetLastError]
mov ecx, dword [ebp + 0x10]
mov dword [ecx], eax
mov ecx, edi
call fcn.004355fa
jmp 0x412ce8
mov ecx, dword [ebp - 0xc]
add bl, bl
xor bl, byte [esi + 0x1d]
mov dword [esi + 0x20], edi
and bl, 2
xor byte [esi + 0x1d], bl
call fcn.004355ba
test al, al
sete al
xor al, byte [esi + 0x1d]
and al, 1
xor byte [esi + 0x1d], al
test byte [esi + 0x1d], 1
je 0x412f23
mov esi, dword [esi + 0x10]
cmp esi, 1
ja 0x412f23
movzx eax, byte [ebp - 1]
push eax
movzx eax, byte [ebp - 2]
push eax
movzx eax, byte [ebp - 3]
push eax
movzx eax, byte [ebp + 0x18]
push eax
push esi
push dword [ebp - 0xc]
push dword [ebp - 8]
push str.Incorrect_alignment_on_mode_set____s__mode:_d_alignment:_u_force_buffered:_d_file_bufferless:_d_unbuffered_read:_d_unbuffered_write:_d
call fcn.0045c3cd
add esp, 0x20
mov ecx, dword [ebp - 8]
test ecx, ecx
je 0x412f2f
call fcn.0043492c
mov eax, edi
pop edi
pop esi
pop ebx
leave
ret 0x18