Function at 0x41b7eb
Capabilities:
Clear file content

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x40
mov dword [ebp - 8], edi
mov edi, eax
mov dword [ebp - 0xc], ebx
mov dword [ebp - 4], esi
mov dword [ebp - 0x10], 0
mov edx, dword [edi + 0x40]
test edx, edx
mov ebx, dword [edi + 0x3c]
je 0x41b746
sub ebx, edx
jmp 0x41b74b
mov eax, dword [edi + 0x38]
sub ebx, eax
mov esi, ebx
add esi, dword [edi + 0x118]
movsx eax, byte [edi + 0x154]
cmp eax, 1
je 0x41b7d6
cmp eax, 3
je 0x41b7d6
test ebx, ebx
je 0x41b7cf
test edx, edx
jne 0x41b76f
mov edx, dword [edi + 0x38]
cmp dword [edi + 0x138], 0xb
jne 0x41b7aa
cmp eax, 5
je 0x41b785
cmp eax, 4
jne 0x41b7aa
cmp eax, 5
mov eax, dword [edi + 0x38]
mov dword [edi + 0x3c], eax
je 0x41baff
mov eax, edi
mov ecx, ebx
mov dword [esp + 0xc], 1
call fcn.0041b330
mov esi, dword [edi + 0x118]
jmp 0x41b7c0
push ebx
push edx
push edi
call fcn.0042b630
add esp, 0xc
cmp eax, 0xffffffff
je 0x41bb2c
xor eax, eax
test eax, eax
jne 0x41baa9
movsx eax, byte [edi + 0x154]
and byte [edi + 0x16c], 0xbf
lea edx, [eax - 1]
cmp edx, 7
ja case.default.0x41b7e9
mov edx, dword [edx*4 + 0x4c8bd4]
jmp edx
push 1
mov byte [ebp - 0x17], 0xd
lea eax, [ebp - 0x17]
push eax
push edi
call fcn.0042b630
add esp, 0xc
cmp eax, 0xffffffff
je 0x41bb42
jmp case.0x41b7e9.5
cmp eax, 8
je 0x41bb60
xor edx, edx
lea eax, [ebp - 0x17]
mov byte [ebp + edx - 0x17], 0xa
inc edx
push edx
push eax
push edi
call fcn.0042b630
add esp, 0xc
cmp eax, 0xffffffff
je 0x41bb42
jmp case.0x41b7e9.5
mov edx, dword [edi + 0x40]
lea eax, [ebx - 2]
mov word [ebp - 0x30], ax
test edx, edx
je 0x41bb93
mov byte [edx], al
mov edx, dword [edi + 0x40]
shr eax, 8
mov byte [edx + 1], al
mov eax, dword [edi + 0x40]
test eax, eax
jne 0x41b860
mov eax, dword [edi + 0x38]
push ebx
push eax
push edi
call fcn.0042b630
add esp, 0xc
cmp eax, 0xffffffff
je 0x41bb6e
and byte [edi + 0x16c], 0xbf
and ebx, 0x80000001
jge 0x41b88a
sub ebx, 1
or ebx, 0xfffffffe
inc ebx
test ebx, ebx
je case.0x41b7e9.5
push 1
mov byte [ebp - 0x18], 0
lea eax, [ebp - 0x18]
push eax
push edi
call fcn.0042b630
add esp, 0xc
cmp eax, 0xffffffff
je 0x41bb42
jmp case.0x41b7e9.5
add esi, 0xfffffffc
cmp dword [edi + 0x14c], 0
je 0x41b8c8
mov eax, esi
neg eax
mov dword [ebp - 0x30], eax
jmp 0x41b8cb
mov dword [ebp - 0x30], esi
test byte [edi + 0x16d], 0x20
je 0x41b8f2
movzx eax, byte [ebp - 0x2d]
movzx edx, byte [ebp - 0x2e]
movzx ecx, byte [ebp - 0x2f]
movzx ebx, byte [ebp - 0x30]
mov byte [ebp - 0x10], al
mov byte [ebp - 0xf], dl
mov byte [ebp - 0xe], cl
mov byte [ebp - 0xd], bl
jmp 0x41b90e
movzx eax, byte [ebp - 0x30]
movzx edx, byte [ebp - 0x2f]
movzx ecx, byte [ebp - 0x2e]
movzx ebx, byte [ebp - 0x2d]
mov byte [ebp - 0x10], al
mov byte [ebp - 0xf], dl
mov byte [ebp - 0xe], cl
mov byte [ebp - 0xd], bl
push 4
lea eax, [ebp - 0x10]
push eax
push edi
call fcn.0042b630
add esp, 0xc
cmp eax, 0xffffffff
je 0x41bb42
test byte [edi + 0x16f], 2
jne case.0x41b7e9.5
push 1
xor edx, edx
lea eax, [ebp - 0x24]
push eax
push edx
mov dword [ebp - 0x28], edx
mov dword [ebp - 0x24], edx
push dword [edi + 0xe4]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov ebx, eax
mov dword [ebp - 0x28], ebx
cmp ebx, 0xffffffff
je 0x41bbee
mov eax, dword [ebp - 0x24]
mov dword [ebp - 0x18], eax
push 0
mov ecx, dword [edi + 0x110]
lea edx, [ebp - 0x1c]
push edx
mov eax, dword [edi + 0x114]
push ecx
push dword [edi + 0xe4]
mov dword [ebp - 0x20], ecx
mov dword [ebp - 0x1c], eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [ebp - 0x20], eax
cmp eax, 0xffffffff
je 0x41bbc9
mov ecx, dword [ebp - 0x1c]
mov edx, 0xffffffff
sub eax, edx
sub ecx, edx
or eax, ecx
je 0x41bb42
movzx eax, byte [edi + 0x172]
test al, 0x20
je 0x41b9c2
and eax, 0xffffffdf
neg esi
mov byte [edi + 0x172], al
mov dword [ebp - 0x30], esi
jmp 0x41b9c5
mov dword [ebp - 0x30], esi
test byte [edi + 0x16d], 0x20
je 0x41b9ec
movzx eax, byte [ebp - 0x2d]
mov byte [ebp - 0x10], al
movzx edx, byte [ebp - 0x2e]
movzx ecx, byte [ebp - 0x2f]
movzx eax, byte [ebp - 0x30]
mov byte [ebp - 0xf], dl
mov byte [ebp - 0xe], cl
mov byte [ebp - 0xd], al
jmp 0x41ba08
movzx eax, byte [ebp - 0x30]
mov byte [ebp - 0x10], al
movzx edx, byte [ebp - 0x2f]
movzx ecx, byte [ebp - 0x2e]
movzx eax, byte [ebp - 0x2d]
mov byte [ebp - 0xf], dl
mov byte [ebp - 0xe], cl
mov byte [ebp - 0xd], al
push 4
lea eax, [ebp - 0x10]
push eax
push edi
call fcn.0042b630
add esp, 0xc
cmp eax, 0xffffffff
je 0x41bb42
push 0
mov eax, dword [ebp - 0x18]
lea edx, [ebp - 0x2c]
push edx
push ebx
mov dword [ebp - 0x30], ebx
mov dword [ebp - 0x2c], eax
push dword [edi + 0xe4]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [ebp - 0x30], eax
cmp eax, 0xffffffff
je 0x41bba7
mov ecx, dword [ebp - 0x2c]
mov edx, 0xffffffff
sub eax, edx
sub ecx, edx
or eax, ecx
jne case.0x41b7e9.5
jmp 0x41bb42
mov eax, dword [edi + 0xf8]
cmp ebx, eax
jae 0x41ba7d
sub eax, ebx
push eax
push 0
push dword [edi + 0x3c]
call fcn.004a8410
add esp, 0xc
mov ebx, dword [edi + 0xf8]
mov eax, dword [edi + 0x40]
test eax, eax
je 0x41bc2f
push ebx
push eax
push edi
call fcn.0042b630
add esp, 0xc
cmp eax, 0xffffffff
je 0x41bc19
xor eax, eax
and byte [edi + 0x16c], 0xbf
test eax, eax
je case.0x41b7e9.5
mov ebx, dword [ebp - 0xc]
mov esi, dword [ebp - 4]
mov edi, dword [ebp - 8]
mov esp, ebp
pop ebp
ret
push 0xf6d
push str.for_wseq.c
push 2
push 8
call fcn.0040e0a0
add esp, 0x10
test byte [edi + 0x16d], 8
je 0x41baf0
push dword [edi + 0xe4]
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
test eax, eax
je 0x41bc46
and byte [edi + 0x16d], 0xf7
xor eax, eax
mov ebx, dword [ebp - 0xc]
mov esi, dword [ebp - 4]
mov edi, dword [ebp - 8]
mov esp, ebp
pop ebp
ret
push ebx
push edx
push edi
call fcn.0042b630
add esp, 0xc
cmp eax, 0xffffffff
je 0x41bb16
xor eax, eax
jmp 0x41b7a2
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [edi + 0xe8], eax
mov eax, 0x26
jmp 0x41b7a2
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [edi + 0xe8], eax
mov eax, 0x26
jmp 0x41b7c0
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [edi + 0xe8], eax
mov eax, 0x26
mov ebx, dword [ebp - 0xc]
mov esi, dword [ebp - 4]
mov edi, dword [ebp - 8]
mov esp, ebp
pop ebp
ret
mov byte [ebp - 0x17], 0xd
mov edx, 1
jmp 0x41b817
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [edi + 0xe8], eax
mov eax, 0x26
and byte [edi + 0x16c], 0xbf
mov ebx, dword [ebp - 0xc]
mov esi, dword [ebp - 4]
mov edi, dword [ebp - 8]
mov esp, ebp
pop ebp
ret
mov esi, dword [edi + 0x38]
mov byte [esi], al
mov edx, dword [edi + 0x38]
movzx eax, byte [ebp - 0x2f]
mov byte [edx + 1], al
jmp 0x41b856
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x41bbbe
mov eax, 0xffffffff
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x2c], eax
jmp 0x41bb42
mov eax, dword [ebp - 0x30]
mov ecx, dword [ebp - 0x2c]
jmp 0x41ba4b
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x41bbe3
mov eax, 0xffffffff
mov dword [ebp - 0x20], eax
mov dword [ebp - 0x1c], eax
jmp 0x41bb42
mov eax, dword [ebp - 0x20]
mov ecx, dword [ebp - 0x1c]
jmp 0x41b996
call dword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
je 0x41bc0b
mov ebx, 0xffffffff
mov dword [ebp - 0x18], ebx
mov dword [ebp - 0x28], ebx
mov dword [ebp - 0x24], ebx
jmp 0x41b962
mov edx, dword [ebp - 0x24]
mov ebx, dword [ebp - 0x28]
mov dword [ebp - 0x18], edx
jmp 0x41b962
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [edi + 0xe8], eax
mov eax, 0x26
jmp 0x41ba9e
push ebx
push dword [edi + 0x38]
push edi
call fcn.0042b630
add esp, 0xc
cmp eax, 0xffffffff
je 0x41bc19
jmp 0x41ba9c
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [edi + 0xe8], eax
mov eax, 0x26
and byte [edi + 0x16d], 0xf7
mov ebx, dword [ebp - 0xc]
mov esi, dword [ebp - 4]
mov edi, dword [ebp - 8]
mov esp, ebp
pop ebp
ret