Function at 0x47e520
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
mov eax, 0x1002c
call fcn.004b8900
push ebx
push esi
push edi
lea eax, [ebp - 0x10]
mov edi, ecx
push eax
lea eax, [ebp - 0x10028]
mov dword [ebp - 8], edi
push eax
push 0x8000
push dword [ebp + 0xc]
call dword [sym.imp.KERNEL32.dll_GetFullPathNameW]
push 0
xor edx, edx
lea ecx, [ebp - 0x10028]
mov esi, 1
call fcn.004831c0
add esp, 4
test al, al
jne 0x47e63b
push 0
push 0
push esi
push 0
push 0
push 0x40000000
lea eax, [ebp - 0x10028]
push eax
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebx, dword [ebp + 0x10]
mov edi, eax
cmp edi, 0xffffffff
je 0x47e610
mov ecx, ebx
lea edx, [ecx + 2]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x47e597
sub ecx, edx
sar ecx, 1
push 0
lea eax, [ecx*2 + 2]
mov dword [ebp - 4], eax
lea eax, [ebx + ecx*2]
mov ecx, 0x5d
mov dword [ebp - 0xc], eax
mov word [eax], cx
lea eax, [ebp + 0xc]
push eax
push 4
push 0x4df070
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x47e5f9
cmp dword [ebp + 0xc], 4
jne 0x47e5f9
push 0
lea eax, [ebp + 0xc]
push eax
push dword [ebp - 4]
push ebx
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x47e5f9
mov eax, dword [ebp - 4]
cmp dword [ebp + 0xc], eax
je 0x47e5fb
xor esi, esi
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
neg eax
sbb eax, eax
and esi, eax
mov eax, dword [ebp - 0xc]
xor ecx, ecx
mov word [eax], cx
mov edi, dword [ebp - 8]
test esi, esi
je 0x47e6f5
mov eax, dword [ebp + 0x14]
cmp word [eax], 0
je 0x47e640
lea ecx, [ebp - 0x10028]
push ecx
push dword [ebp + 8]
push eax
push ebx
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
jmp 0x47e6e0
mov ebx, dword [ebp + 0x10]
jmp 0x47e613
cmp byte [edi + 1], 0
ja 0x47e64a
xor ecx, ecx
jmp 0x47e68f
mov ecx, dword [edi + 8]
cmp byte [ecx + 1], 0
jne 0x47e676
mov ecx, dword [ecx + 0x10]
test ecx, ecx
je 0x47e676
mov eax, dword [ecx + 8]
test eax, eax
je 0x47e671
cmp eax, 4
jne 0x47e676
mov ecx, dword [ecx]
call fcn.00405c02
mov ecx, eax
jmp 0x47e68f
mov ecx, dword [ecx + 4]
jmp 0x47e68f
mov ecx, dword [0x4eaee8]
lea edx, [ecx + 2]
nop
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x47e680
sub ecx, edx
sar ecx, 1
lea eax, [ecx*2 + 4]
call fcn.004b87f0
mov edi, dword [ebp + 8]
mov ebx, esp
mov edx, ebx
movzx eax, word [edi]
test ax, ax
je 0x47e6cb
mov esi, eax
sub edi, ebx
nop
xor ecx, ecx
movzx eax, si
cmp si, 0xa
cmovne ecx, eax
mov word [edx], cx
add edx, 2
movzx esi, word [edi + edx]
test si, si
jne 0x47e6b0
xor eax, eax
mov dword [edx], eax
lea eax, [ebp - 0x10028]
push eax
push ebx
push dword [ebp + 0x10]
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileSectionW]
mov esi, eax
lea eax, [ebp - 0x10028]
push eax
push 0
push 0
push 0
call dword [sym.imp.KERNEL32.dll_WritePrivateProfileStringW]
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [0x4e59a0]
mov dword [ecx + 0x38], eax
test esi, esi
jne 0x47e742
push 0xa
lea ecx, [ebp - 0x28]
push ecx
push eax
call fcn.004a015d
add esp, 0xc
lea eax, [ebp - 0x28]
mov ecx, 0x4eb110
push dword [0x4eb03c]
push esi
push 9
push 0x4d1e48
push eax
call fcn.004303b0
lea esp, [ebp - 0x10038]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10
mov eax, 1
lea esp, [ebp - 0x10038]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret 0x10