Function at 0x542eb0
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 0x542ed1
sub edi, ecx
jmp 0x542ed4
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 0x542f3c
cmp al, 3
je 0x542f3c
test edi, edi
je 0x542f32
test ecx, ecx
jne 0x542ef7
mov ecx, dword [esi + 0x28]
cmp dword [esi + 0x100], 0xb
jne 0x542f1f
cmp al, 4
jne 0x542f1f
mov eax, dword [esi + 0x28]
push 1
push edi
push ecx
push esi
mov dword [esi + 0x2c], eax
call fcn.00542d10
mov ebx, dword [esi + 0xe0]
add esp, 0x10
jmp 0x542f2a
push edi
push ecx
push esi
call fcn.00542ca0
add esp, 0xc
test eax, eax
jne 0x5431ec
and dword [esi + 0x128], 0xfbffffff
movsx eax, byte [esi + 0x11c]
dec eax
cmp eax, 6
ja case.default.0x542f4d
jmp dword [eax*4 + 0x5431f4]
mov ecx, dword [esi + 0xb4]
cmp edi, ecx
jae 0x542f79
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 0x542f84
mov eax, dword [esi + 0x28]
push eax
push esi
call fcn.00542ca0
mov edx, dword [esi + 0x128]
add esp, 0xc
and edx, 0xfbffffff
test eax, eax
mov dword [esi + 0x128], edx
je case.0x542f4d.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 0x542fc0
neg eax
mov cl, byte [esi + 0x12c]
mov dword [ebp + 8], eax
test cl, 2
je 0x542fe2
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 0x542ff4
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.00551100
add esp, 0xc
cmp eax, 0xffffffff
je 0x54316a
test dword [esi + 0x12c], 0x40000
jne case.0x542f4d.5
mov eax, dword [esi + 0xa8]
push eax
call fcn.0054dc40
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.00556760
and eax, edx
add esp, 0x14
cmp eax, 0xffffffff
je 0x54316a
mov eax, dword [esi + 0x134]
test eax, 0x1000000
je 0x543071
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 0x543095
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 0x5430a7
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.00551100
add esp, 0xc
cmp eax, 0xffffffff
je 0x54316a
mov eax, dword [ebp - 0xc]
mov ecx, dword [esi + 0xa8]
push 0
push eax
push ebx
push ecx
call fcn.00556760
add esp, 0x10
and eax, edx
jmp 0x543165
mov ecx, dword [esi + 0x30]
lea eax, [edi - 2]
test ecx, ecx
je 0x5430ed
mov byte [ecx], al
mov edx, dword [esi + 0x30]
jmp 0x5430f5
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 0x543103
mov eax, dword [esi + 0x28]
push eax
push esi
call fcn.00542ca0
mov edx, dword [esi + 0x128]
add esp, 0xc
and edx, 0xfbffffff
test eax, eax
mov dword [esi + 0x128], edx
jne 0x5431ec
and edi, 0x80000001
jns 0x543134
dec edi
or edi, 0xfffffffe
inc edi
je case.0x542f4d.5
lea ecx, [ebp + 0xb]
push 1
mov byte [ebp + 0xb], 0
push ecx
jmp 0x54315c
lea edx, [ebp - 8]
push 2
mov byte [ebp - 8], 0xd
mov byte [ebp - 7], 0xa
push edx
jmp 0x54315c
lea eax, [ebp - 8]
push 1
mov byte [ebp - 8], 0xd
push eax
push esi
call fcn.00551100
add esp, 0xc
cmp eax, 0xffffffff
jne case.0x542f4d.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 0x5837a0
push 2
push 0xc0000008
call fcn.00547a40
add esp, 0x10
test dword [esi + 0x128], 0x80000000
je 0x5431ea
mov ecx, dword [esi + 0xa8]
xor edi, edi
push ecx
call dword [sym.imp.KERNEL32.dll_SetEndOfFile]
test eax, eax
jne 0x5431cb
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 0x5431ea
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