Function at 0x541e40
Capabilities:
Clear file content

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x10
push ebx
push esi
mov esi, dword [ebp + 8]
push edi
mov dword [ebp - 4], 0
mov ecx, dword [esi + 0x30]
mov edi, dword [esi + 0x2c]
test ecx, ecx
je 0x541e61
sub edi, ecx
jmp 0x541e64
sub edi, dword [esi + 0x28]
mov eax, dword [esi + 0xe0]
mov ebx, edi
add ebx, eax
mov al, byte [esi + 0x11c]
cmp al, 1
je 0x541ecc
cmp al, 3
je 0x541ecc
test edi, edi
je 0x541ec2
test ecx, ecx
jne 0x541e87
mov ecx, dword [esi + 0x28]
cmp dword [esi + 0x100], 0xb
jne 0x541eaf
cmp al, 4
jne 0x541eaf
mov eax, dword [esi + 0x28]
push 1
push edi
push ecx
push esi
mov dword [esi + 0x2c], eax
call fcn.00541ca0
mov ebx, dword [esi + 0xe0]
add esp, 0x10
jmp 0x541eba
push edi
push ecx
push esi
call fcn.00541c30
add esp, 0xc
test eax, eax
jne 0x54217c
and dword [esi + 0x128], 0xfbffffff
movsx eax, byte [esi + 0x11c]
dec eax
cmp eax, 6
ja case.default.0x541edd
jmp dword [eax*4 + 0x542184]
mov ecx, dword [esi + 0xb4]
cmp edi, ecx
jae 0x541f09
sub ecx, edi
mov edi, dword [esi + 0x2c]
mov edx, ecx
xor eax, eax
shr ecx, 2
rep stosd dword es:[edi], eax
mov ecx, edx
and ecx, 3
rep stosb byte es:[edi], al
mov edi, dword [esi + 0xb4]
mov eax, dword [esi + 0x30]
push edi
test eax, eax
jne 0x541f14
mov eax, dword [esi + 0x28]
push eax
push esi
call fcn.00541c30
mov edx, dword [esi + 0x128]
add esp, 0xc
and edx, 0xfbffffff
test eax, eax
mov dword [esi + 0x128], edx
je case.0x541edd.5
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov eax, dword [esi + 0x114]
lea edi, [ebx - 4]
test eax, eax
mov eax, edi
je 0x541f50
neg eax
mov cl, byte [esi + 0x12c]
mov dword [ebp + 8], eax
test cl, 2
je 0x541f72
mov cl, byte [ebp + 0xb]
mov dl, byte [ebp + 0xa]
mov byte [ebp - 4], cl
mov byte [ebp - 3], dl
mov byte [ebp - 2], ah
mov byte [ebp - 1], al
jmp 0x541f84
mov cl, byte [ebp + 0xb]
mov byte [ebp - 4], al
mov al, byte [ebp + 0xa]
mov byte [ebp - 3], ah
mov byte [ebp - 2], al
mov byte [ebp - 1], cl
lea edx, [ebp - 4]
push 4
push edx
push esi
call fcn.005500b0
add esp, 0xc
cmp eax, 0xffffffff
je 0x5420fa
test dword [esi + 0x12c], 0x40000
jne case.0x541edd.5
mov eax, dword [esi + 0xa8]
push eax
call fcn.0054cbf0
mov ecx, dword [esi + 0xdc]
mov dword [ebp - 0xc], edx
mov edx, dword [esi + 0xd8]
mov ebx, eax
mov eax, dword [esi + 0xa8]
push 0
push ecx
push edx
push eax
call fcn.00555710
and eax, edx
add esp, 0x14
cmp eax, 0xffffffff
je 0x5420fa
mov eax, dword [esi + 0x134]
test eax, 0x1000000
je 0x542001
and eax, 0xfeffffff
mov dword [esi + 0x134], eax
neg edi
mov cl, byte [esi + 0x12c]
mov eax, edi
test cl, 2
mov dword [ebp + 8], eax
je 0x542025
mov cl, byte [ebp + 0xb]
mov dl, byte [ebp + 0xa]
mov byte [ebp - 4], cl
mov byte [ebp - 3], dl
mov byte [ebp - 2], ah
mov byte [ebp - 1], al
jmp 0x542037
mov cl, byte [ebp + 0xb]
mov byte [ebp - 4], al
mov al, byte [ebp + 0xa]
mov byte [ebp - 3], ah
mov byte [ebp - 2], al
mov byte [ebp - 1], cl
lea edx, [ebp - 4]
push 4
push edx
push esi
call fcn.005500b0
add esp, 0xc
cmp eax, 0xffffffff
je 0x5420fa
mov eax, dword [ebp - 0xc]
mov ecx, dword [esi + 0xa8]
push 0
push eax
push ebx
push ecx
call fcn.00555710
add esp, 0x10
and eax, edx
jmp 0x5420f5
mov ecx, dword [esi + 0x30]
lea eax, [edi - 2]
test ecx, ecx
je 0x54207d
mov byte [ecx], al
mov edx, dword [esi + 0x30]
jmp 0x542085
mov ecx, dword [esi + 0x28]
mov byte [ecx], al
mov edx, dword [esi + 0x28]
mov byte [edx + 1], ah
mov eax, dword [esi + 0x30]
test eax, eax
push edi
jne 0x542093
mov eax, dword [esi + 0x28]
push eax
push esi
call fcn.00541c30
mov edx, dword [esi + 0x128]
add esp, 0xc
and edx, 0xfbffffff
test eax, eax
mov dword [esi + 0x128], edx
jne 0x54217c
and edi, 0x80000001
jns 0x5420c4
dec edi
or edi, 0xfffffffe
inc edi
je case.0x541edd.5
lea ecx, [ebp + 0xb]
push 1
mov byte [ebp + 0xb], 0
push ecx
jmp 0x5420ec
lea edx, [ebp - 8]
push 2
mov byte [ebp - 8], 0xd
mov byte [ebp - 7], 0xa
push edx
jmp 0x5420ec
lea eax, [ebp - 8]
push 1
mov byte [ebp - 8], 0xd
push eax
push esi
call fcn.005500b0
add esp, 0xc
cmp eax, 0xffffffff
jne case.0x541edd.5
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi + 0xac], eax
pop edi
pop esi
mov eax, 0xc0000026
pop ebx
mov esp, ebp
pop ebp
ret
push 0xf5c
push 0x5827a8
push 2
push 0xc0000008
call fcn.005469f0
add esp, 0x10
test dword [esi + 0x128], 0x80000000
je 0x54217a
mov ecx, dword [esi + 0xa8]
xor edi, edi
push ecx
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
test eax, eax
jne 0x54215b
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov dword [esi + 0xac], eax
mov edi, 0xc0000026
mov ecx, dword [esi + 0x128]
and ecx, 0x7fffffff
test edi, edi
mov dword [esi + 0x128], ecx
je 0x54217a
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret