Function at 0x406bac
Capabilities:
Clear file content
Get file size
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x4120
call fcn.004012da
push ebx
mov eax, ecx
push esi
push edi
mov dword [ebp - 0x1c], edx
test eax, eax
jne 0x406be5
mov eax, dword [0x42bfa8]
push 2
pop ecx
cmp eax, 1
cmove eax, ecx
push 0x57
mov dword [0x42bfa8], eax
call dword [sym.imp.KERNEL32.dll_SetLastError]
jmp 0x406fe7
test edx, edx
je 0x406fe7
mov ecx, dword [0x472308]
xor edi, edi
inc edi
xor ebx, ebx
test ecx, ecx
je 0x406c1b
push ebx
push 0x80
push 3
push ebx
push edi
push 0x80000000
push eax
call ecx
mov ecx, dword [0x472308]
mov edx, dword [ebp - 0x1c]
mov esi, eax
jmp 0x406c1e
or esi, 0xffffffff
test esi, esi
je 0x406f85
cmp esi, 0xffffffff
je 0x406f85
test ecx, ecx
je 0x406c51
xor eax, eax
cmp byte [ebp + 8], al
push ebx
sete al
push 0x80
inc eax
push eax
push ebx
push ebx
push 0x40000000
push edx
call ecx
mov edi, eax
jmp 0x406c54
or edi, 0xffffffff
test edi, edi
je 0x406f67
cmp edi, 0xffffffff
je 0x406f67
push edi
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
mov eax, dword [0x42bfbc]
push 2
pop ecx
cmp eax, 1
push ebx
cmove eax, ecx
push esi
mov dword [ebp - 0x14], ebx
mov dword [0x42bfbc], eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov ecx, dword [0x42bf80]
mov ebx, eax
xor edx, edx
mov eax, ecx
mov dword [ebp - 8], 0x15
div dword [ebp - 8]
mov dword [ebp - 0x18], ebx
mov dword [edx*4 + 0x42bf80], ecx
inc dword [0x42bf80]
cmp ebx, 0xffffffff
je 0x406f30
test ebx, ebx
je 0x406f30
mov eax, dword [0x42bf9c]
push 2
cmp eax, 1
pop ecx
cmove eax, ecx
mov bl, 1
mov dword [0x42bf9c], eax
mov bh, bl
mov dword [ebp - 8], 1
mov eax, dword [ebp - 8]
cdq
sub eax, edx
sar eax, 1
cmp eax, 0x32
jle 0x406d00
push 0
push 0x42c7ec
push 0x42c7f4
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
mov ecx, dword [0x4728d0]
and dword [ebp - 0xc], 0
xor eax, eax
mov dword [ebp - 0x10], eax
test ecx, ecx
je 0x406d2e
push eax
lea eax, [ebp - 0x10]
push eax
push 0x4000
lea eax, [ebp - 0x411c]
push eax
push esi
call ecx
mov ecx, eax
mov eax, dword [ebp - 0x10]
jmp 0x406d30
xor ecx, ecx
test ecx, ecx
je 0x406e10
test eax, eax
je 0x406e10
test bh, bh
je 0x406dad
mov ecx, 0x100
cmp eax, ecx
jb 0x406dad
mov dword [ebp - 8], 1
mov eax, dword [ebp - 8]
cdq
sub eax, edx
sar eax, 1
cmp eax, 0x32
jle 0x406d7a
push 0
push 0x42c7ec
push 0x42c7f4
push 0
call dword [sym.imp.USER32.dll_MessageBoxA]
mov ecx, 0x100
push ecx
lea eax, [ebp - 0x411c]
push eax
lea eax, [ebp - 0x11c]
push eax
mov dword [ebp - 0x14], ecx
call fcn.00401225
add esp, 0xc
lea eax, [ebp - 0x411c]
push 0x100
push 0
push eax
call fcn.00401285
mov eax, dword [ebp - 0x10]
add esp, 0xc
mov ecx, dword [0x4722b0]
xor bh, bh
test ecx, ecx
je 0x406dcc
push 0
lea edx, [ebp - 0xc]
push edx
push eax
lea eax, [ebp - 0x411c]
push eax
push edi
call ecx
jmp 0x406dce
xor eax, eax
test eax, eax
je 0x406de9
cmp dword [ebp - 0xc], 0
je 0x406de9
mov eax, dword [ebp - 0x18]
sub eax, dword [ebp - 0xc]
mov dword [ebp - 0x18], eax
jne 0x406cd8
jmp 0x406e24
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x406dfb
push 0x1f
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor bl, bl
cmp dword [0x42bf90], 1
jne 0x406e24
push 2
pop eax
mov dword [0x42bf90], eax
jmp 0x406e24
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x406e22
push 0x1f
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor bl, bl
mov eax, dword [0x471904]
test eax, eax
je 0x406e30
push esi
call eax
mov eax, dword [0x42bfa8]
cmp eax, 1
push 2
pop ecx
cmove eax, ecx
mov dword [0x42bfa8], eax
mov eax, dword [0x42bf90]
cmp eax, 1
cmove eax, ecx
mov ecx, edi
mov dword [0x42bf90], eax
call fcn.0040663d
mov eax, dword [0x471904]
test eax, eax
je 0x406e66
push edi
call eax
test bl, bl
je 0x406f29
mov edi, dword [ebp - 0x14]
test edi, edi
je 0x406f29
mov eax, dword [0x472308]
test eax, eax
je 0x406e9c
xor ecx, ecx
push ecx
push 0x80
push 3
push ecx
push ecx
push 0x40000000
push dword [ebp - 0x1c]
call eax
mov esi, eax
jmp 0x406e9f
or esi, 0xffffffff
test esi, esi
je 0x406f15
cmp esi, 0xffffffff
je 0x406f15
push 0
lea eax, [ebp - 0xc]
push eax
push edi
lea eax, [ebp - 0x11c]
push eax
push esi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x406ec6
cmp dword [ebp - 0xc], edi
je 0x406eed
mov eax, dword [0x42bfc0]
push 2
cmp eax, 1
pop ecx
cmove eax, ecx
mov dword [0x42bfc0], eax
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x406eeb
push 0x1f
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor bl, bl
mov ecx, esi
call fcn.0040663d
mov eax, dword [0x42bf90]
cmp eax, 1
push 2
pop ecx
cmove eax, ecx
mov dword [0x42bf90], eax
mov eax, dword [0x471904]
test eax, eax
je 0x406f29
push esi
call eax
jmp 0x406f29
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x406f27
push 0x1f
call dword [sym.imp.KERNEL32.dll_SetLastError]
xor bl, bl
mov al, bl
jmp 0x406fe9
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x406f42
push 0x1f
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [0x471904]
test eax, eax
je 0x406fe7
push esi
call eax
mov eax, dword [0x471904]
test eax, eax
je 0x406fe7
push edi
call eax
jmp 0x406fe7
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x406f79
push 0x1f
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [0x471904]
test eax, eax
je 0x406fe7
push esi
jmp 0x406f60
mov dword [ebp - 8], edi
mov eax, dword [ebp - 8]
cdq
sub eax, edx
sar eax, 1
cmp eax, 0x32
jle 0x406fa7
push ebx
push 0x42c7ec
push 0x42c7f4
push ebx
call dword [sym.imp.USER32.dll_MessageBoxA]
mov ecx, dword [0x42bf80]
push 0x15
xor edx, edx
mov eax, ecx
pop esi
div esi
mov dword [edx*4 + 0x42bf80], ecx
inc dword [0x42bf80]
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jne 0x406fd5
push 0x1f
call dword [sym.imp.KERNEL32.dll_SetLastError]
mov eax, dword [0x42bfbc]
push 2
pop ecx
cmp eax, edi
cmove eax, ecx
mov dword [0x42bfbc], eax
xor al, al
pop edi
pop esi
pop ebx
leave
ret