Function at 0x429040
Capabilities:
Write file on windows

Disassembly:
push ebp
push edi
push esi
mov esi, edx
push ebx
mov ebx, eax
sub esp, 0x7c
lea edx, [esp + 0x48]
mov dword [esp + 0x24], ecx
call fcn.00427870
test eax, eax
je 0x428074
mov edi, dword [esp + 0x4c]
cmp edi, 0x80
jne 0x427fa2
mov edi, dword [esp + 0x54]
cmp edi, 0x100
jne 0x428030
test esi, esi
je 0x427ef2
mov ebx, dword [esp + 0x90]
test ebx, ebx
je 0x4280f0
mov eax, dword [esp + 0x90]
xor edi, edi
mov dword [esp + 0x30], 0
xor ebp, ebp
sub eax, 1
mov dword [esp + 0x34], eax
jmp 0x427e2d
movzx eax, dl
mov ecx, dword [esp + 0x48]
mov dword [esp + 0x2c], eax
add eax, eax
mov dword [esp + 0x28], eax
test ecx, ecx
je 0x427e80
test dl, dl
js 0x427e80
add ecx, eax
movzx ebx, byte [ecx]
movzx ecx, byte [ecx + 1]
mov eax, ebx
or al, cl
je 0x427e80
mov eax, dword [esp + 0x98]
mov ebp, esi
mov byte [eax + edi*2 - 2], bl
mov byte [eax + edi*2 - 1], cl
cmp dword [esp + 0x90], ebp
jbe 0x427e5b
mov eax, dword [esp + 0x24]
add edi, 1
lea esi, [ebp + 1]
movzx edx, byte [eax + ebp]
test dl, dl
jne 0x427de3
mov eax, dword [esp + 0x98]
mov ebp, esi
mov byte [eax + edi*2 - 2], 0
mov byte [eax + edi*2 - 1], 0
cmp dword [esp + 0x90], ebp
ja 0x427e2d
mov eax, dword [esp + 0x9c]
mov dword [eax], edi
mov eax, dword [esp + 0x30]
test eax, eax
mov eax, 0
cmove eax, dword [esp + 0x98]
add esp, 0x7c
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [esp + 0x28]
add eax, dword [esp + 0x50]
movzx ecx, byte [eax]
movzx eax, byte [eax + 1]
mov ebx, ecx
or bl, al
je 0x427eb0
mov edx, dword [esp + 0x98]
mov ebp, esi
mov byte [edx + edi*2 - 2], cl
mov byte [edx + edi*2 - 1], al
jmp 0x427e24
mov eax, dword [esp + 0x58]
mov dword [esp + 0x28], eax
test eax, eax
je 0x427ec2
cmp dword [esp + 0x34], ebp
ja 0x427f30
mov ecx, dword [esp + 0x94]
test ecx, ecx
je 0x427f10
mov eax, dword [esp + 0x94]
mov ebx, dword [esp + 0x98]
mov ebp, esi
mov dword [esp + 0x30], 1
movzx eax, word [eax]
mov word [ebx + edi*2 - 2], ax
jmp 0x427e24
mov dword [esp + 0x48], 0
mov dword [esp + 0x4c], 0
jmp 0x427db8
mov eax, dword [esp + 0x98]
mov ebp, esi
mov dword [esp + 0x30], 1
mov byte [eax + edi*2 - 2], dl
mov byte [eax + edi*2 - 1], 0xf3
jmp 0x427e24
mov eax, dword [esp + 0x24]
mov ebx, dword [esp + 0x2c]
mov dword [esp + 0x38], edi
xor ecx, ecx
mov edi, dword [esp + 0x28]
mov dword [esp + 0x3c], ebp
movzx eax, byte [eax + esi]
shl ebx, 8
mov byte [esp + 0x28], dl
mov dword [esp + 0x2c], esi
or eax, ebx
mov ebx, dword [esp + 0x5c]
mov ebp, eax
sub ebx, 1
mov edx, ebx
jmp 0x427f6f
test eax, eax
je 0x427f90
lea ebx, [eax - 1]
cmp ecx, ebx
ja 0x427f90
mov eax, ebx
sub eax, ecx
shr eax, 1
add eax, ecx
lea esi, [edi + eax*4]
cmp bp, word [esi]
jb 0x427f64
jbe 0x428109
cmp edx, eax
jbe 0x427f90
lea ecx, [eax + 1]
jmp 0x427f6b
mov edi, dword [esp + 0x38]
movzx edx, byte [esp + 0x28]
mov esi, dword [esp + 0x2c]
jmp 0x427ec2
mov dword [esp], 2
mov esi, dword [fcn.004a1b90]
call esi
mov dword [esp + 0x1c], edi
mov dword [esp + 0x18], ebx
mov dword [esp + 0x14], str.tfs_unistr_from_codepage_internal
mov dword [esp + 0x10], 0x5df
mov dword [esp + 0xc], str.tfs_unistr.c
mov dword [esp + 8], 0x4b8d37
mov dword [esp + 4], str.__s___s:_d___s__Unexpected_CP_d_IBM_graphics_table_size:__Iu
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov dword [esp], 2
call esi
mov dword [esp + 8], 2
mov dword [esp + 0xc], eax
mov dword [esp + 4], 1
mov dword [esp], 0x4b8d27
call sub.msvcrt.dll_fwrite
mov dword [esp], 2
call esi
mov dword [esp], eax
call sub.msvcrt.dll_fflush
add esp, 0x7c
xor eax, eax
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp], 2
mov esi, dword [fcn.004a1b90]
call esi
mov dword [esp + 0x1c], edi
mov dword [esp + 0x18], ebx
mov dword [esp + 0x14], str.tfs_unistr_from_codepage_internal
mov dword [esp + 0x10], 0x5e5
mov dword [esp + 0xc], str.tfs_unistr.c
mov dword [esp + 8], 0x4b8d37
mov dword [esp + 4], str.__s___s:_d___s__Unexpected_CP_d_low_table_size:__Iu
jmp 0x427fe1
mov esi, dword [fcn.004a1b90]
mov dword [esp], 2
call esi
mov dword [esp + 0xc], ebx
mov dword [esp + 8], 0x4b8d00
mov dword [esp + 4], str.__s__Unsupported_code_page:__d
mov dword [esp], eax
call sub.msvcrt.dll_fprintf
mov dword [esp], 2
call esi
mov dword [esp + 8], 2
mov dword [esp + 0xc], eax
mov dword [esp + 4], 1
mov dword [esp], 0x4b8d27
call sub.msvcrt.dll_fwrite
mov dword [esp], 2
call esi
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov eax, dword [esp + 0x9c]
mov dword [eax], 0
xor eax, eax
jmp 0x427e77
mov eax, dword [esp + 0x9c]
mov dword [eax], 0
mov eax, dword [esp + 0x98]
jmp 0x427e77
movzx eax, byte [esi + 2]
movzx edx, byte [esi + 3]
mov edi, dword [esp + 0x38]
mov esi, dword [esp + 0x98]
mov ebp, dword [esp + 0x3c]
mov byte [esi + edi*2 - 2], al
mov byte [esi + edi*2 - 1], dl
add ebp, 2
jmp 0x427e24
push ebx
mov ebx, dword [esp + 0x14]
mov ecx, dword [esp + 0xc]
mov edx, dword [esp + 0x10]
mov eax, dword [esp + 8]
mov dword [esp + 0xc], ebx
mov ebx, dword [esp + 0x1c]
mov dword [esp + 8], edx
mov edx, 1
mov dword [esp + 0x14], ebx
mov ebx, dword [esp + 0x18]
mov dword [esp + 0x10], ebx
pop ebx
jmp 0x427d70