Function at 0x4984ac
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push esi
push edi
push ebx
sub esp, 0x28
mov edi, eax
mov ebx, ecx
mov esi, edx
test edi, edi
je 0x498b3c
mov ecx, dword [edi + 0x104]
mov dword [ebp - 0x18], ecx
movzx ecx, byte [edi + 0x1a8]
movzx edx, byte [edi + 0x1a9]
and ecx, 0x80
and edx, 1
mov dword [ebp - 0x10], edx
mov edx, dword [edi + 0x16c]
shr ecx, 7
mov dword [ebp - 0x14], edx
test esi, esi
je 0x498b1b
test ebx, ebx
je 0x498868
cmp esi, dword [edi + 0x4c]
jb 0x4985db
cmp esi, dword [edi + 0x68]
ja 0x4985db
xor edx, edx
mov dword [edi + 0xe8], edx
mov dword [edi + 0xec], edx
mov dword [edi + 0x110], edx
mov edx, dword [edi + 0x54]
mov dword [ebp - 0x20], edx
test edx, edx
je 0x4985ef
cmp esi, dword [ebp - 0x20]
je 0x4985ef
mov eax, dword [edi + 0x4c]
sub dword [ebp - 0x20], eax
je 0x4985ef
push 0
lea edx, [ebp - 0x1c]
push edx
push dword [ebp - 0x20]
push eax
push dword [ebp - 0x18]
mov dword [ebp - 0x2c], ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [ebp - 0x2c]
test eax, eax
jne 0x49857a
mov ecx, 0xffffffff
test edi, edi
jne 0x4989ee
jmp 0x4989fc
mov eax, dword [ebp - 0x20]
cdq
mov dword [ebp - 0x24], esi
mov esi, dword [edi + 0xe0]
add esi, eax
mov dword [ebp - 0x28], ebx
mov ebx, edx
mov edx, dword [edi + 0xe4]
adc edx, ebx
mov dword [ebp - 0x30], ebx
mov dword [ebp - 0x34], esi
mov dword [edi + 0xe0], esi
mov dword [edi + 0xe4], edx
mov ebx, dword [ebp - 0x28]
mov esi, dword [ebp - 0x24]
test byte [edi + 0x1ac], 4
je 0x4985c8
mov eax, dword [ebp - 0x34]
mov dword [edi + 0xd8], eax
mov dword [edi + 0xdc], edx
jmp 0x4985ef
mov edx, eax
add dword [edi + 0xd8], edx
mov edx, dword [ebp - 0x30]
adc dword [edi + 0xdc], edx
jmp 0x4985ef
xor edx, edx
mov dword [edi + 0xe8], edx
mov dword [edi + 0xec], edx
mov dword [edi + 0x110], edx
cmp dword [0x22072dc], 0
je 0x49868a
cmp dword [ebp - 0x14], 0
je 0x498568
test ecx, ecx
je 0x49862c
cmp dword [ebp - 0x14], 0xfffffffa
je 0x498652
mov edx, dword [ebp - 0x14]
lea edx, [edx - 1]
cmp edx, 1
jbe 0x498637
cmp dword [ebp - 0x10], 0
je 0x49868a
push edx
call fcn.004cb4d0
add esp, 4
jmp 0x49868a
mov edx, dword [ebp - 0x14]
lea edx, [edx - 1]
cmp edx, 1
ja 0x49868a
mov dword [ebp - 0x2c], ecx
call fcn.004cb4f0
mov ecx, dword [ebp - 0x2c]
mov dword [ebp - 0x18], eax
cmp dword [0x22072dc], 0
je 0x498663
test ecx, ecx
je 0x498663
cmp dword [ebp - 0x10], 0
je 0x498663
push dword [ebp - 0x18]
call fcn.004cb4d0
add esp, 4
push 0
push dword [ebp - 0x18]
push ebx
push esi
call fcn.004cb4d0
mov ecx, eax
add esp, 0x10
cmp ecx, ebx
je 0x49867d
mov ecx, 0xffffffff
test edi, edi
jne 0x4989ee
jmp 0x4989fc
mov ecx, 1
test byte [edi + 0x1a9], 0x40
jne 0x4986a0
mov edx, dword [edi + 0x54]
mov dword [ebp - 0x2c], edx
jmp 0x4986e1
test byte [edi + 0x1a7], 1
jne 0x498698
mov eax, dword [edi + 0x4c]
mov edx, dword [edi + 0x54]
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x2c], edx
cmp esi, eax
je 0x4986be
cmp esi, dword [ebp - 0x2c]
jne 0x4986f0
mov dword [ebp - 0x30], ecx
mov eax, dword [edi + 0x118]
mov ecx, dword [edi + 0x50]
mov edx, dword [ebp - 0x34]
add edx, dword [edi + 0x10c]
lea ecx, [ecx + eax*2]
cmp edx, ecx
mov ecx, dword [ebp - 0x30]
ja 0x498838
cmp esi, dword [ebp - 0x2c]
jne 0x4986f0
mov esi, dword [edi + 0x4c]
mov edx, dword [ebp - 0x2c]
sub edx, esi
add ebx, edx
test byte [edi + 0x1a3], 4
je 0x498709
test byte [edi + 0x1a2], 0x40
je 0x498709
or byte [edi + 0x1a5], 8
mov edx, dword [edi + 0x168]
test edx, edx
je 0x49871b
cmp ebx, edx
jbe 0x498783
mov ecx, ebx
jmp 0x49872a
cmp ebx, 0x20000
jbe 0x498783
mov ecx, ebx
mov edx, 0x20000
mov eax, esi
mov dword [ebp - 0x28], ebx
mov ebx, eax
mov dword [ebp - 0x24], esi
mov esi, edx
mov dword [ebp - 0x34], edi
mov edi, ecx
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
cmp eax, dword [ebp - 0x18]
je 0x498a6d
push 0
lea eax, [ebp - 0x1c]
push eax
push esi
push ebx
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp eax, 1
je 0x498a13
test edi, edi
je 0x498a06
cmp eax, 1
jne 0x498a06
mov edx, dword [ebp - 0x1c]
test edx, edx
ja 0x49873b
jmp 0x498a53
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
cmp eax, dword [ebp - 0x18]
je 0x498acf
push 0
lea edx, [ebp - 0x1c]
push edx
push ebx
push esi
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, eax
test ecx, ecx
jne 0x4987ba
cmp dword [ebp - 0x14], 1
je 0x498ab9
mov ecx, 0xffffffff
test edi, edi
je 0x4989ec
mov eax, ebx
cdq
mov esi, dword [edi + 0x4c]
mov eax, edx
mov edx, dword [edi + 0xe0]
add esi, dword [edi + 0x118]
add edx, ebx
mov dword [edi + 0x58], esi
mov esi, dword [edi + 0xe4]
adc esi, eax
and byte [edi + 0x1a5], 0xfb
mov dword [edi + 0x54], 0
mov dword [edi + 0xe0], edx
mov dword [edi + 0xe4], esi
test byte [edi + 0x1ac], 4
je 0x49881f
mov dword [edi + 0xd8], edx
test edi, edi
mov dword [edi + 0xdc], esi
jne 0x4989ee
jmp 0x4989fc
add dword [edi + 0xd8], ebx
adc dword [edi + 0xdc], eax
test edi, edi
jne 0x4989ee
jmp 0x4989fc
mov edx, eax
mov eax, ebx
add dword [edi + 0x58], edx
add esi, ebx
cdq
add dword [edi + 0xd8], ebx
mov dword [edi + 0x54], esi
adc dword [edi + 0xdc], edx
or byte [edi + 0x1a5], 4
mov dword [edi + 0x50], esi
test edi, edi
jne 0x4989ee
jmp 0x4989fc
xor eax, eax
mov dword [edi + 0xe8], eax
mov dword [edi + 0xec], eax
mov dword [edi + 0x110], eax
movzx ebx, byte [edi + 0x1a5]
test bl, 4
je 0x4988fe
push 0
mov ebx, dword [edi + 0x54]
lea eax, [ebp - 0x1c]
sub ebx, dword [edi + 0x4c]
push eax
push ebx
push dword [edi + 0x4c]
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, eax
mov edx, dword [edi + 0x4c]
mov eax, ebx
mov esi, dword [edi + 0x118]
test ecx, ecx
mov dword [edi + 0x50], edx
jne 0x4988ba
mov ecx, 0xffffffff
add esi, edx
cdq
mov eax, edx
mov edx, dword [edi + 0xe0]
add edx, ebx
mov dword [edi + 0x58], esi
mov esi, dword [edi + 0xe4]
adc esi, eax
and byte [edi + 0x1a5], 0xfb
mov dword [edi + 0x54], 0
mov dword [edi + 0xe0], edx
mov dword [edi + 0xe4], esi
test byte [edi + 0x1ac], 4
jne 0x498806
jmp 0x49881f
mov eax, dword [edi + 0x94]
test eax, eax
je 0x498b00
cmp byte [eax + 0x1e], 0
je 0x4989e5
movzx eax, word [edi + 0x18a]
test eax, eax
jg 0x498b09
mov edx, dword [edi + 0x4c]
mov eax, dword [edi + 0x60]
sub eax, edx
mov dword [ebp - 0x34], eax
test eax, eax
jle 0x49895e
push 0
lea eax, [ebp - 0x1c]
push eax
push dword [ebp - 0x34]
push edx
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, eax
test ecx, ecx
mov edx, dword [edi + 0x4c]
movzx ebx, byte [edi + 0x1a5]
jne 0x498963
mov ecx, 0xffffffff
jmp 0x498963
mov ecx, 1
and ebx, 0xfffffffb
mov byte [edi + 0x1a5], bl
mov ebx, dword [edi + 0x118]
push ebx
push 0x20
push edx
add ebx, edx
mov dword [edi + 0x54], 0
mov dword [edi + 0x58], ebx
mov dword [edi + 0x50], edx
mov dword [edi + 0x60], edx
mov dword [ebp - 0x30], ecx
call fcn.004c6960
mov ecx, dword [ebp - 0x30]
add esp, 0xc
mov eax, dword [ebp - 0x34]
mov ebx, dword [edi + 0xe0]
cdq
add ebx, eax
mov esi, dword [edi + 0xe4]
adc esi, edx
mov dword [edi + 0xe0], ebx
mov dword [edi + 0xe4], esi
test byte [edi + 0x1ac], 4
je 0x4989d1
mov dword [edi + 0xd8], ebx
test edi, edi
mov dword [edi + 0xdc], esi
jne 0x4989ee
jmp 0x4989fc
mov ebx, eax
add dword [edi + 0xd8], ebx
adc dword [edi + 0xdc], edx
test edi, edi
jne 0x4989ee
jmp 0x4989fc
mov ecx, 1
test edi, edi
je 0x4989fc
xor edx, edx
mov dword [edi + 0xc8], edx
mov dword [edi + 0xcc], edx
mov eax, ecx
lea esp, [ebp - 0xc]
pop ebx
pop edi
pop esi
pop ebp
ret
mov ebx, dword [ebp - 0x28]
mov ecx, eax
mov edi, dword [ebp - 0x34]
jmp 0x4987a7
mov edx, dword [ebp - 0x1c]
add ebx, edx
sub edi, edx
cmp dword [ebp - 0x34], 0
je 0x498a41
mov ecx, dword [ebp - 0x34]
mov ecx, dword [ecx + 0x168]
test ecx, ecx
je 0x498a41
cmp edi, ecx
ja 0x498a33
mov esi, edi
test edi, edi
je 0x498a60
test edx, edx
ja 0x49873b
jmp 0x498a60
cmp edi, 0x20000
ja 0x498a4b
mov esi, edi
test edi, edi
jne 0x49877a
mov ebx, dword [ebp - 0x28]
mov ecx, eax
mov edi, dword [ebp - 0x34]
jmp 0x4987ba
mov ebx, dword [ebp - 0x28]
mov ecx, eax
mov edi, dword [ebp - 0x34]
jmp 0x4987c2
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 2
jne 0x49874c
push esi
push ebx
push 1
call fcn.004deab2
mov edx, eax
add esp, 0xc
cmp edx, 0xffffffff
je 0x498a9f
mov dword [ebp - 0x1c], edx
mov eax, 1
jmp 0x498a16
push 0
lea eax, [ebp - 0x1c]
push eax
push dword [ebp - 0x28]
push dword [ebp - 0x24]
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x49875d
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 6
jne 0x4987b5
xor ecx, ecx
jmp 0x4987ba
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 2
jne 0x498794
push ebx
push esi
push 1
call fcn.004deab2
add esp, 0xc
cmp eax, 0xffffffff
je 0x498794
mov ecx, 1
jmp 0x4987ba
movzx eax, word [edi + 0x18a]
test eax, eax
mov ecx, 1
test edi, edi
jne 0x4989ee
jmp 0x4989fc
xor edx, edx
mov dword [edi + 0xe8], edx
mov dword [edi + 0xec], edx
mov dword [edi + 0x110], edx
test ebx, ebx
je 0x49887c
jmp 0x498528
cmp dword [0x22072dc], 0
jne 0x498b7d
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov dword [ebp - 0x18], eax
mov ecx, dword [0x22072dc]
mov dword [ebp - 0x10], ecx
test ebx, ebx
je 0x498b09
test ecx, ecx
jne 0x498637
mov dword [ebp - 0x14], 1
cmp ebx, 0x20000
jbe 0x498783
jmp 0x498723
call fcn.004cb4f0
jmp 0x498b4d