Function at 0x46798c
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
mov dword [ebp - 4], edi
mov edi, eax
mov dword [ebp - 8], ebx
mov ebx, ecx
mov dword [ebp - 0xc], esi
mov esi, edx
test edi, edi
je 0x467fc1
movzx eax, byte [edi + 0x178]
and eax, 0x80
mov ecx, dword [edi + 0xe4]
shr eax, 7
movzx edx, byte [edi + 0x179]
mov dword [ebp - 0x18], ecx
and edx, 1
mov dword [ebp - 0x10], eax
xor eax, eax
mov dword [ebp - 0x14], edx
mov ecx, dword [edi + 0x144]
mov dword [edi + 0xc8], eax
mov dword [edi + 0xcc], eax
mov dword [edi + 0xf0], eax
test ebx, ebx
jne 0x467b58
test edi, edi
je 0x467f7a
test byte [edi + 0x175], 4
jne 0x467aaf
mov eax, dword [edi + 0x7c]
test eax, eax
je 0x467ea2
cmp byte [eax + 0x1e], 0
jne 0x467a23
mov esi, 1
jmp 0x467cbb
mov ebx, dword [edi + 0x4c]
lea eax, [ebp - 0x1c]
push 0
sub ebx, dword [edi + 0x48]
push eax
push ebx
push dword [edi + 0x48]
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, eax
test esi, esi
mov eax, dword [edi + 0x38]
jne 0x467a4a
mov esi, 0xffffffff
mov ecx, dword [edi + 0xf8]
push ecx
push 0x20
push eax
and byte [edi + 0x175], 0xfb
lea edx, [eax + ecx]
mov dword [edi + 0x40], 0
mov dword [edi + 0x44], edx
mov dword [edi + 0x3c], eax
call fcn.004a2ae0
add esp, 0xc
mov eax, ebx
mov ecx, dword [edi + 0xc0]
add ebx, ecx
cdq
adc edx, dword [edi + 0xc4]
mov dword [edi + 0xc0], ebx
mov dword [edi + 0xb8], ebx
xor ebx, ebx
mov dword [edi + 0xc4], edx
mov dword [edi + 0xbc], edx
mov dword [edi + 0xa8], ebx
mov dword [edi + 0xac], ebx
jmp 0x467e93
mov ebx, dword [edi + 0x40]
lea eax, [ebp - 0x1c]
push 0
sub ebx, dword [edi + 0x38]
push eax
push ebx
push dword [edi + 0x38]
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov esi, eax
test esi, esi
mov eax, ebx
mov edx, dword [edi + 0x38]
mov ecx, dword [edi + 0xf8]
jne 0x467ade
mov esi, 0xffffffff
add ecx, edx
mov dword [edi + 0x44], ecx
mov ecx, dword [edi + 0xc0]
mov dword [edi + 0x3c], edx
add ecx, ebx
cdq
mov eax, dword [edi + 0xc4]
adc eax, edx
and byte [edi + 0x175], 0xfb
mov dword [edi + 0x40], 0
mov dword [edi + 0xc0], ecx
mov dword [edi + 0xc4], eax
test byte [edi + 0x179], 0x20
je 0x467b39
xor edx, edx
mov dword [edi + 0xb8], ecx
mov dword [edi + 0xbc], eax
mov dword [edi + 0xa8], edx
mov dword [edi + 0xac], edx
jmp 0x467e93
add dword [edi + 0xb8], ebx
adc dword [edi + 0xbc], edx
xor edx, edx
mov dword [edi + 0xa8], edx
mov dword [edi + 0xac], edx
jmp 0x467e93
test edi, edi
je 0x467c18
mov eax, dword [edi + 0x40]
test eax, eax
mov dword [ebp - 0x28], eax
je 0x467c18
cmp esi, dword [ebp - 0x28]
je 0x467c18
mov edx, dword [edi + 0x38]
sub dword [ebp - 0x28], edx
je 0x467c18
push 0
lea eax, [ebp - 0x1c]
push eax
push dword [ebp - 0x28]
push edx
push dword [ebp - 0x18]
mov dword [ebp - 0x24], ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [ebp - 0x24]
test eax, eax
jne 0x467bb8
xor eax, eax
mov esi, 0xffffffff
mov dword [edi + 0xa8], eax
mov dword [edi + 0xac], eax
jmp 0x467e93
mov eax, dword [ebp - 0x28]
cdq
mov dword [ebp - 0x2c], esi
mov esi, dword [edi + 0xc0]
add esi, eax
mov dword [ebp - 0x20], ebx
mov ebx, edx
mov edx, dword [edi + 0xc4]
adc edx, ebx
mov dword [ebp - 0x30], ebx
mov dword [ebp - 0x34], esi
mov dword [edi + 0xc0], esi
mov dword [edi + 0xc4], edx
mov ebx, dword [ebp - 0x20]
mov esi, dword [ebp - 0x2c]
test byte [edi + 0x179], 0x20
je 0x467c06
mov eax, dword [ebp - 0x34]
mov dword [edi + 0xb8], eax
mov dword [edi + 0xbc], edx
jmp 0x467c18
mov eax, dword [ebp - 0x28]
add dword [edi + 0xb8], eax
mov edx, dword [ebp - 0x30]
adc dword [edi + 0xbc], edx
cmp dword [0x4d15a0], 0
je 0x467cce
test ecx, ecx
jne 0x467c33
mov esi, 0xffffffff
jmp 0x467cb3
cmp dword [ebp - 0x10], 0
je 0x467c42
cmp ecx, 0xfffffffa
je 0x467eb7
cmp ecx, 2
je 0x467c4c
cmp ecx, 1
jne 0x467c6c
mov dword [ebp - 0x24], ecx
call fcn.004a62f0
mov ecx, dword [ebp - 0x24]
mov dword [ebp - 0x34], eax
cmp dword [0x4d15a0], 0
je 0x467c99
mov dword [ebp - 0x30], 1
jmp 0x467c76
mov dword [ebp - 0x30], 0
mov dword [ebp - 0x34], eax
cmp dword [ebp - 0x10], 0
je 0x467c93
cmp dword [ebp - 0x14], 0
je 0x467c93
push dword [ebp - 0x34]
mov dword [ebp - 0x24], ecx
call fcn.004a62d0
mov ecx, dword [ebp - 0x24]
add esp, 4
cmp dword [ebp - 0x30], 0
je 0x467cce
push 0
push dword [ebp - 0x34]
push ebx
push esi
call fcn.004a62d0
add esp, 0x10
mov esi, eax
cmp esi, ebx
je 0x467cb3
mov esi, 0xffffffff
test edi, edi
je 0x467e93
xor edx, edx
mov dword [edi + 0xa8], edx
mov dword [edi + 0xac], edx
jmp 0x467e93
test edi, edi
je 0x467d46
test byte [edi + 0x179], 0x40
jne 0x467ce3
mov eax, dword [edi + 0x40]
mov dword [ebp - 0x28], eax
jmp 0x467d2f
test byte [edi + 0x177], 1
je 0x467cf4
mov eax, dword [edi + 0x40]
mov dword [ebp - 0x28], eax
jmp 0x467d2f
mov edx, dword [edi + 0x38]
cmp esi, edx
mov eax, dword [edi + 0x40]
mov dword [ebp - 0x30], edx
mov dword [ebp - 0x28], eax
je 0x467d09
cmp esi, dword [ebp - 0x28]
jne 0x467d3c
mov dword [ebp - 0x20], ebx
mov ebx, dword [edi + 0xf8]
mov edx, dword [edi + 0x3c]
mov eax, dword [ebp - 0x30]
add eax, dword [edi + 0xec]
mov dword [ebp - 0x34], ebx
lea edx, [edx + ebx*2]
mov ebx, dword [ebp - 0x20]
cmp eax, edx
ja 0x467e5f
cmp esi, dword [ebp - 0x28]
jne 0x467d3c
add ebx, dword [ebp - 0x28]
mov esi, dword [edi + 0x38]
sub ebx, esi
mov eax, dword [edi + 0x140]
test eax, eax
jne 0x467d4b
mov eax, 0x20000
cmp ebx, eax
jbe 0x467db3
mov edx, ebx
test edi, edi
je 0x467d5f
mov eax, dword [edi + 0x140]
test eax, eax
jne 0x467d64
mov eax, 0x20000
mov dword [ebp - 0x30], esi
mov dword [ebp - 0x2c], esi
mov dword [ebp - 0x28], edi
mov dword [ebp - 0x34], edx
mov dword [ebp - 0x20], ebx
mov ebx, eax
mov dword [ebp - 0x24], ecx
mov esi, dword [ebp - 0x30]
mov edi, dword [ebp - 0x18]
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
cmp edi, eax
je 0x467f1f
push 0
lea edx, [ebp - 0x1c]
push edx
push ebx
push esi
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
cmp eax, 1
je 0x467ec9
mov ebx, dword [ebp - 0x20]
mov esi, eax
mov ecx, dword [ebp - 0x24]
mov edi, dword [ebp - 0x28]
jmp 0x467de3
mov dword [ebp - 0x24], ecx
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov ecx, dword [ebp - 0x24]
cmp eax, dword [ebp - 0x18]
je 0x467f84
push 0
lea eax, [ebp - 0x1c]
push eax
push ebx
push esi
push dword [ebp - 0x18]
mov dword [ebp - 0x24], ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov ecx, dword [ebp - 0x24]
mov esi, eax
test esi, esi
jne 0x467df5
cmp ecx, 1
je 0x467f64
mov esi, 0xffffffff
test edi, edi
je 0x467e93
mov ecx, dword [edi + 0x38]
mov eax, ebx
add ecx, dword [edi + 0xf8]
mov dword [edi + 0x44], ecx
mov ecx, dword [edi + 0xc0]
cdq
add ecx, ebx
mov eax, dword [edi + 0xc4]
adc eax, edx
and byte [edi + 0x175], 0xfb
mov dword [edi + 0x40], 0
mov dword [edi + 0xc0], ecx
mov dword [edi + 0xc4], eax
test byte [edi + 0x179], 0x20
je 0x467b39
xor edx, edx
mov dword [edi + 0xb8], ecx
mov dword [edi + 0xbc], eax
mov dword [edi + 0xa8], edx
mov dword [edi + 0xac], edx
jmp 0x467e93
mov eax, ebx
add esi, ebx
cdq
add dword [edi + 0xb8], ebx
mov ecx, dword [ebp - 0x34]
mov dword [edi + 0x40], esi
adc dword [edi + 0xbc], edx
xor ebx, ebx
mov esi, 1
or byte [edi + 0x175], 4
add dword [edi + 0x44], ecx
mov dword [edi + 0xa8], ebx
mov dword [edi + 0xac], ebx
mov eax, esi
mov ebx, dword [ebp - 8]
mov esi, dword [ebp - 0xc]
mov edi, dword [ebp - 4]
mov esp, ebp
pop ebp
ret
xor eax, eax
mov esi, 1
mov dword [edi + 0xa8], eax
mov dword [edi + 0xac], eax
jmp 0x467e93
mov eax, dword [ebp - 0x18]
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x30], 1
jmp 0x467c7c
mov edx, dword [ebp - 0x1c]
sub dword [ebp - 0x34], edx
add esi, edx
cmp dword [ebp - 0x28], 0
je 0x467ee4
mov ecx, dword [ebp - 0x28]
mov ecx, dword [ecx + 0x140]
test ecx, ecx
jne 0x467ee9
mov ecx, 0x20000
cmp ecx, dword [ebp - 0x34]
jb 0x467ef7
mov ebx, dword [ebp - 0x34]
test ebx, ebx
jne 0x467efd
jmp 0x467f05
cmp dword [ebp - 0x34], 0
je 0x467f12
test edx, edx
ja 0x467d7e
mov ebx, dword [ebp - 0x20]
mov esi, eax
mov edi, dword [ebp - 0x28]
jmp 0x467df5
mov ebx, dword [ebp - 0x20]
mov esi, eax
mov edi, dword [ebp - 0x28]
jmp 0x467df5
push edi
call dword [sym.imp.KERNEL32.dll_GetFileType]
cmp eax, 2
jne 0x467d8e
push ebx
push esi
push 1
call fcn.00491765
add esp, 0xc
mov edx, eax
cmp edx, 0xffffffff
je 0x467f4c
mov dword [ebp - 0x1c], edx
mov eax, 1
jmp 0x467ecc
push 0
lea edx, [ebp - 0x1c]
push edx
push dword [ebp - 0x20]
push dword [ebp - 0x2c]
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
jmp 0x467d9d
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 6
jne 0x467df0
xor esi, esi
jmp 0x467df5
mov esi, 1
jmp 0x467e93
push dword [ebp - 0x18]
mov dword [ebp - 0x24], ecx
call dword [sym.imp.KERNEL32.dll_GetFileType]
mov ecx, dword [ebp - 0x24]
cmp eax, 2
jne 0x467dca
push ebx
push esi
push 1
mov dword [ebp - 0x24], ecx
call fcn.00491765
mov ecx, dword [ebp - 0x24]
add esp, 0xc
cmp eax, 0xffffffff
je 0x467dca
mov esi, 1
jmp 0x467df5
cmp dword [0x4d15a0], 0
jne 0x467fea
push 0xfffffffffffffff5
call dword [sym.imp.KERNEL32.dll_GetStdHandle]
mov dword [ebp - 0x18], eax
mov eax, dword [0x4d15a0]
mov ecx, 1
mov dword [ebp - 0x10], eax
mov dword [ebp - 0x14], eax
jmp 0x4679eb
call fcn.004a62f0
jmp 0x467fd2