Function at 0x414160
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x58
mov eax, dword [0x4210a8]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x10]
push ebx
movsx eax, al
xor ebx, ebx
add eax, 0xffffffa8
mov dword [ebp - 0x48], str.0123456789abcdef
mov dword [ebp - 0x54], 0
push esi
mov esi, dword [ebp + 0x2c]
mov dword [ebp - 0x58], esi
cmp eax, 0x20
ja case.0x4141a1.89
movzx eax, byte [eax + 0x414380]
jmp dword [eax*4 + 0x414368]
mov edx, dword [ebp + 0xc]
mov ebx, dword [ebp + 8]
mov dword [ebp - 0x4c], 0xa
test edx, edx
jg 0x4141cf
jl 0x4141bf
test ebx, ebx
jae 0x4141cf
neg ebx
mov dword [ebp - 0x54], 0x2d
adc edx, 0
neg edx
jmp 0x414204
cmp dword [ebp + 0x14], 0
je 0x414204
mov dword [ebp - 0x54], 0x2b
jmp 0x414204
mov dword [ebp - 0x4c], 8
jmp 0x4141fe
mov dword [ebp - 0x4c], 0xa
jmp 0x4141fe
mov dword [ebp - 0x48], str.0123456789ABCDEF
mov dword [ebp - 0x4c], 0x10
mov ebx, dword [ebp + 8]
mov edx, dword [ebp + 0xc]
mov eax, ebx
or eax, edx
push edi
jne 0x41421b
cmp dword [ebp + 0x28], eax
je 0x41421b
mov edi, dword [ebp + 0x24]
test edi, edi
jne 0x41421b
xor ebx, ebx
jmp 0x41424c
mov edi, dword [ebp - 0x4c]
xor esi, esi
push 0
push edi
push edx
push ebx
call fcn.00417a00
mov dword [ebp - 0x4c], ebx
mov ebx, eax
mov eax, dword [ebp - 0x48]
mov cl, byte [ecx + eax]
mov byte [ebp + esi - 0x44], cl
mov ecx, ebx
inc esi
or ecx, edx
jne 0x414220
mov edi, dword [ebp + 0x24]
mov dword [ebp - 0x48], esi
mov esi, dword [ebp - 0x58]
mov ebx, dword [ebp - 0x48]
sub edi, ebx
mov eax, 0
mov ecx, 0
cmovs edi, eax
mov eax, dword [ebp + 0x1c]
sub eax, edi
sub eax, ebx
cmovs eax, ecx
mov dword [ebp - 0x4c], eax
cmp dword [ebp + 0x18], ecx
je 0x414272
neg eax
mov dword [ebp - 0x4c], eax
push esi
lea eax, [ebp - 0x4c]
push eax
lea eax, [ebp - 0x54]
push eax
push dword [ebp + 0x20]
call fcn.00414820
add esp, 0x10
test edi, edi
jle 0x4142e8
lea ebx, [ebx]
mov eax, dword [esi + 8]
dec edi
mov dword [ebp + 0x24], edi
test eax, eax
je 0x4142d8
mov edi, dword [esi]
cmp edi, eax
jb 0x4142d5
mov eax, dword [esi + 0xc]
test eax, eax
je 0x4142e1
mov ecx, dword [esi + 4]
sub edi, ecx
cmp byte [esi + 0x14], 0
jne 0x4142d0
test edi, edi
je 0x4142d0
push eax
push edi
push 1
push ecx
call dword [sym.imp.MSVCR120.dll_fwrite]
add dword [esi + 0x10], eax
add esp, 0x10
cmp eax, edi
je 0x4142d0
mov byte [esi + 0x14], 1
mov eax, dword [esi + 4]
mov dword [esi], eax
mov edi, dword [ebp + 0x24]
mov eax, dword [esi]
mov byte [eax], 0x30
inc dword [esi]
jmp 0x4142e4
mov edi, dword [ebp + 0x24]
test edi, edi
jg 0x414290
test ebx, ebx
jle 0x414347
lea esp, [esp]
movsx edx, byte [ebp + ebx - 0x45]
dec ebx
mov eax, dword [esi + 8]
mov dword [ebp - 0x48], edx
test eax, eax
je 0x41433d
mov edi, dword [esi]
cmp edi, eax
jb 0x41433d
mov eax, dword [esi + 0xc]
test eax, eax
je 0x414343
mov ecx, dword [esi + 4]
sub edi, ecx
cmp byte [esi + 0x14], 0
jne 0x414338
test edi, edi
je 0x414338
push eax
push edi
push 1
push ecx
call dword [sym.imp.MSVCR120.dll_fwrite]
add dword [esi + 0x10], eax
add esp, 0x10
mov edx, dword [ebp - 0x48]
cmp eax, edi
je 0x414338
mov byte [esi + 0x14], 1
mov eax, dword [esi + 4]
mov dword [esi], eax
mov eax, dword [esi]
mov byte [eax], dl
inc dword [esi]
test ebx, ebx
jg 0x4142f0
lea eax, [ebp - 0x4c]
push esi
push eax
call fcn.00414970
add esp, 8
pop edi
mov ecx, dword [ebp - 4]
pop esi
xor ecx, ebp
pop ebx
call fcn.004175a2
mov esp, ebp
pop ebp
ret