Function at 0x46f770
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x510343
mov eax, dword fs:[0]
push eax
sub esp, 0xb0
mov eax, dword [0x5467a4]
xor eax, esp
mov dword [esp + 0xa8], eax
push ebx
push esi
push edi
mov eax, dword [0x5467a4]
xor eax, esp
push eax
lea eax, [esp + 0xc0]
mov dword fs:[0], eax
mov edi, dword [ebp + 8]
mov ebx, ecx
cmp byte [ebx + 4], 0
mov dword [esp + 0x18], 0
jne 0x46f947
mov ecx, edi
lea esi, [esp + 0x9c]
call fcn.004495e0
mov dword [esp + 0xc8], 0
cmp byte [ebx + 0x24], 0
jne 0x46f870
cmp dword [esp + 0xb4], 0x10
mov edx, dword [esp + 0xb0]
mov ecx, dword [esp + 0xa0]
mov esi, edx
jae 0x46f80b
lea ecx, [esp + 0xa0]
test ecx, ecx
mov eax, dword [ebx]
je 0x46f836
mov eax, dword [eax]
cmp eax, 0xffffffff
je 0x46f836
push 0
lea edi, [esp + 0x1c]
push edi
push edx
push ecx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x46f836
cmp esi, dword [esp + 0x18]
je 0x46f919
push 0x523008
lea ecx, [esp + 0x84]
call fcn.00406a50
lea eax, [esp + 0x80]
push eax
lea ecx, [esp + 0x34]
push ecx
mov byte [esp + 0xd0], 1
call fcn.0040bb40
push 0x538748
lea edx, [esp + 0x34]
push edx
call fcn.004ed8eb
mov eax, dword [ebx + 0x28]
mov ecx, dword [eax + 4]
mov eax, dword [eax + 0xc]
mov edi, dword [edi + 0x14]
lea edx, [edi + eax]
cmp edx, ecx
mov dword [esp + 0x1c], eax
jb 0x46f8cf
add edi, eax
test edi, edi
mov dword [esp + 0x24], edi
fild dword [esp + 0x24]
jge 0x46f89b
fadd qword [0x52ca60]
fmul qword [0x52cac8]
mov esi, dword [ebx + 0x28]
fnstcw word [esp + 0x16]
movzx eax, word [esp + 0x16]
or eax, 0xc00
mov dword [esp + 0x24], eax
fldcw word [esp + 0x24]
fistp qword [esp + 0x24]
mov edi, dword [esp + 0x24]
fldcw word [esp + 0x16]
call fcn.00401110
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0xb0]
mov esi, dword [ebx + 0x28]
mov edx, dword [esi + 4]
add ecx, eax
cmp ecx, edx
jbe 0x46f8e4
mov ecx, edx
mov dword [esi + 0xc], ecx
cmp dword [esp + 0xb4], 0x10
mov edx, dword [esp + 0xa0]
jae 0x46f8ff
lea edx, [esp + 0xa0]
mov ecx, dword [ebx + 0x28]
mov esi, dword [esp + 0xb0]
mov ecx, dword [ecx + 8]
push esi
push edx
add ecx, eax
push ecx
call fcn.004efdb0
add esp, 0xc
mov dword [esp + 0xc8], 0xffffffff
cmp dword [esp + 0xb4], 0x10
jb 0x46fadd
mov edx, dword [esp + 0xa0]
push edx
call fcn.004e7d7e
add esp, 4
jmp 0x46fadd
push edi
lea esi, [esp + 0x84]
call fcn.00449590
add esp, 4
mov dword [esp + 0xc8], 2
cmp byte [ebx + 0x24], 0
jne 0x46f9f0
mov eax, dword [esp + 0x84]
mov edi, 8
cmp dword [esp + 0x98], edi
jae 0x46f988
lea eax, [esp + 0x84]
mov esi, dword [esp + 0x94]
mov ecx, dword [ebx]
add esi, esi
test eax, eax
je 0x46f9bc
mov ecx, dword [ecx]
cmp ecx, 0xffffffff
je 0x46f9bc
push 0
lea edx, [esp + 0x1c]
push edx
push esi
push eax
push ecx
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x46f9bc
cmp esi, dword [esp + 0x18]
je 0x46fa9d
push 0x523008
lea ecx, [esp + 0x34]
call fcn.00406a50
lea eax, [esp + 0x30]
push eax
lea ecx, [esp + 0x5c]
push ecx
mov byte [esp + 0xd0], 3
call fcn.0040bb40
push 0x538748
lea edx, [esp + 0x5c]
push edx
call fcn.004ed8eb
mov eax, dword [ebx + 0x28]
mov ecx, dword [eax + 4]
mov eax, dword [eax + 0xc]
mov edi, dword [edi + 0x14]
lea edx, [edi + eax]
cmp edx, ecx
mov dword [esp + 0x24], eax
jb 0x46fa4f
add edi, eax
test edi, edi
mov dword [esp + 0x1c], edi
fild dword [esp + 0x1c]
jge 0x46fa1b
fadd qword [0x52ca60]
fmul qword [0x52cac8]
mov esi, dword [ebx + 0x28]
fnstcw word [esp + 0x16]
movzx eax, word [esp + 0x16]
or eax, 0xc00
mov dword [esp + 0x1c], eax
fldcw word [esp + 0x1c]
fistp qword [esp + 0x1c]
mov edi, dword [esp + 0x1c]
fldcw word [esp + 0x16]
call fcn.00401110
mov eax, dword [esp + 0x24]
mov ecx, dword [esp + 0x94]
mov esi, dword [ebx + 0x28]
mov edx, dword [esi + 4]
add ecx, eax
cmp ecx, edx
jbe 0x46fa64
mov ecx, edx
mov dword [esi + 0xc], ecx
mov edx, dword [esp + 0x84]
mov edi, 8
cmp dword [esp + 0x98], edi
jae 0x46fa83
lea edx, [esp + 0x84]
mov ecx, dword [ebx + 0x28]
mov esi, dword [esp + 0x94]
mov ecx, dword [ecx + 8]
push esi
push edx
add ecx, eax
push ecx
call fcn.004efdb0
add esp, 0xc
mov dword [esp + 0xc8], 0xffffffff
cmp dword [esp + 0x98], edi
jb 0x46fac1
mov edx, dword [esp + 0x84]
push edx
call fcn.004e7d7e
add esp, 4
xor eax, eax
mov dword [esp + 0x98], 7
mov dword [esp + 0x94], eax
mov word [esp + 0x84], ax
cmp byte [ebp + 0xc], 0
je 0x46faf6
cmp byte [ebx + 0x24], 0
jne 0x46faf6
push 0
lea eax, [ebx + 8]
push eax
mov ecx, ebx
call fcn.0046f770
mov ecx, dword [esp + 0xc0]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0xa8]
xor ecx, esp
call fcn.004e7d6f
mov esp, ebp
pop ebp
ret 8