Function at 0x4763e0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
push ebx
mov ebx, ecx
push esi
push edi
xor edi, edi
mov dword [ebp - 0x10], ebx
mov eax, dword [ebx]
mov dword [ebp - 0x14], edi
mov dword [ebp - 0xc], edi
cmp eax, ebx
je 0x476480
mov ecx, dword [eax + 0x10]
lea edx, [eax]
mov eax, dword [eax]
mov dword [ebp - 8], eax
lea esi, [ecx + 2]
nop dword [eax]
mov ax, word [ecx]
add ecx, 2
test ax, ax
jne 0x476410
sub ecx, esi
lea eax, [edx + 8]
mov esi, dword [eax]
add edi, 4
sar ecx, 1
add edi, ecx
mov dword [ebp - 0x14], eax
cmp esi, eax
je 0x476473
mov eax, dword [esi + 0xc]
lea edx, [esi]
mov esi, dword [esi]
xor ecx, ecx
test eax, eax
je 0x476469
mov edx, dword [edx + 8]
lea ebx, [edx + 2]
mov cx, word [edx]
add edx, 2
test cx, cx
jne 0x476443
sub edx, ebx
lea ebx, [eax + 2]
sar edx, 1
mov cx, word [eax]
add eax, 2
test cx, cx
jne 0x476455
sub eax, ebx
sar eax, 1
lea ecx, [eax + 3]
add ecx, edx
add edi, ecx
cmp esi, dword [ebp - 0x14]
jne 0x476430
mov ebx, dword [ebp - 0x10]
mov eax, dword [ebp - 8]
add edi, 2
cmp eax, ebx
jne 0x476400
mov dword [ebp - 0x14], edi
lea esi, [edi + 2]
mov ecx, 2
mov eax, esi
mul ecx
mov ecx, 0xffffffff
cmovb eax, ecx
push eax
call fcn.0047c4da
mov edx, eax
add esp, 4
mov dword [ebp - 4], edx
mov ecx, edx
mov dword [ebp - 8], ecx
test edx, edx
jne 0x4764b5
pop edi
pop esi
lea eax, [edx + 8]
pop ebx
mov esp, ebp
pop ebp
ret
lea eax, [edx + esi*2]
mov dword [ebp - 0x18], eax
mov eax, dword [ebx]
cmp eax, ebx
je 0x476547
mov edi, dword [ebp - 0x18]
push dword [eax + 0x10]
lea esi, [eax]
mov eax, dword [eax]
push str.__s__r_n
mov dword [ebp - 0x18], eax
lea eax, [ebp - 8]
push 0
push 0
push eax
mov eax, edi
sub eax, edx
sar eax, 1
push eax
push ecx
call fcn.00401bf0
lea ebx, [esi + 8]
add esp, 0x1c
mov esi, dword [ebx]
cmp esi, ebx
je 0x47652b
mov ecx, dword [esi + 0xc]
lea eax, [esi]
mov esi, dword [esi]
test ecx, ecx
je 0x476527
push ecx
push dword [eax + 8]
mov ecx, dword [ebp - 8]
lea eax, [ebp - 8]
push str._s_s_r_n
push 0
push 0
push eax
mov eax, edi
sub eax, ecx
sar eax, 1
push eax
push ecx
call fcn.00401bf0
add esp, 0x20
cmp esi, ebx
jne 0x4764f8
mov eax, dword [ebp - 8]
lea ecx, [eax + 4]
mov dword [eax], 0xa000d
mov eax, dword [ebp - 0x18]
mov edx, ecx
mov dword [ebp - 8], ecx
cmp eax, dword [ebp - 0x10]
jne 0x4764c8
mov edi, dword [ebp - 0x14]
lea ebx, [edi + edi]
lea eax, [ebx + 3]
push eax
mov dword [ebp - 0x14], eax
call fcn.0047c4da
mov esi, eax
add esp, 4
test esi, esi
je case.default.0x476572
mov ecx, dword [ebp - 0x10]
mov eax, dword [ecx + 0xc]
cmp eax, 3
ja case.default.0x476572
jmp dword [eax*4 + 0x476660]
mov ebx, dword [ebp - 4]
push 0
push 0
push dword [ebp - 0x14]
push esi
push edi
push ebx
push 0x200
push 0
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
mov dword [ebp - 0xc], edi
jmp 0x4765f8
mov ebx, dword [ebp - 4]
lea eax, [esi + 3]
push 0
push 0
push dword [ebp - 0x14]
push eax
push edi
push ebx
push 0
push 0xfde9
call dword [sym.imp.KERNEL32.dll_WideCharToMultiByte]
add eax, 3
mov word [esi], 0xbbef
mov dword [ebp - 0xc], eax
mov byte [esi + 2], 0xbf
jmp 0x4765f8
push ebx
push dword [ebp - 4]
lea eax, [esi + 2]
push eax
call fcn.00476840
mov word [esi], 0xfffe
jmp 0x4765ef
push ebx
push dword [ebp - 4]
lea eax, [esi + 2]
push eax
call fcn.0047e060
add esp, 0xc
mov word [esi], 0xfeff
lea eax, [ebx + 2]
mov dword [ebp - 0xc], eax
mov ebx, dword [ebp - 4]
mov eax, dword [ebp - 0x10]
push 0
push 0
push 2
push 0
push 0
push 0x40000000
push dword [eax + 8]
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov edi, eax
cmp edi, 0xffffffff
je 0x476636
push 0
lea eax, [ebp - 0x18]
push eax
push dword [ebp - 0xc]
push esi
push edi
call dword [sym.imp.KERNEL32.dll_WriteFile]
push edi
call dword [sym.imp.KERNEL32.dll_CloseHandle]
xor edi, edi
jmp 0x47663e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
cmp esi, ebx
je 0x47664b
push esi
call fcn.004568b0
add esp, 4
push ebx
call fcn.004568b0
add esp, 4
mov eax, edi
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret