Function at 0x408230
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x58
mov eax, dword [0x40f1a4]
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.0x408271.89
movzx eax, byte [eax + 0x408450]
jmp dword [eax*4 + 0x408438]
mov edx, dword [ebp + 0xc]
mov ebx, dword [ebp + 8]
mov dword [ebp - 0x4c], 0xa
test edx, edx
jg 0x40829f
jl 0x40828f
test ebx, ebx
jae 0x40829f
neg ebx
mov dword [ebp - 0x54], 0x2d
adc edx, 0
neg edx
jmp 0x4082d4
cmp dword [ebp + 0x14], 0
je 0x4082d4
mov dword [ebp - 0x54], 0x2b
jmp 0x4082d4
mov dword [ebp - 0x4c], 8
jmp 0x4082ce
mov dword [ebp - 0x4c], 0xa
jmp 0x4082ce
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 0x4082eb
cmp dword [ebp + 0x28], eax
je 0x4082eb
mov edi, dword [ebp + 0x24]
test edi, edi
jne 0x4082eb
xor ebx, ebx
jmp 0x40831c
mov edi, dword [ebp - 0x4c]
xor esi, esi
push 0
push edi
push edx
push ebx
call fcn.0040a040
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 0x4082f0
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 0x408342
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.004088f0
add esp, 0x10
test edi, edi
jle 0x4083b8
lea ebx, [ebx]
mov eax, dword [esi + 8]
dec edi
mov dword [ebp + 0x24], edi
test eax, eax
je 0x4083a8
mov edi, dword [esi]
cmp edi, eax
jb 0x4083a5
mov eax, dword [esi + 0xc]
test eax, eax
je 0x4083b1
mov ecx, dword [esi + 4]
sub edi, ecx
cmp byte [esi + 0x14], 0
jne 0x4083a0
test edi, edi
je 0x4083a0
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 0x4083a0
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 0x4083b4
mov edi, dword [ebp + 0x24]
test edi, edi
jg 0x408360
test ebx, ebx
jle 0x408417
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 0x40840d
mov edi, dword [esi]
cmp edi, eax
jb 0x40840d
mov eax, dword [esi + 0xc]
test eax, eax
je 0x408413
mov ecx, dword [esi + 4]
sub edi, ecx
cmp byte [esi + 0x14], 0
jne 0x408408
test edi, edi
je 0x408408
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 0x408408
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 0x4083c0
lea eax, [ebp - 0x4c]
push esi
push eax
call fcn.00408a40
add esp, 8
pop edi
mov ecx, dword [ebp - 4]
pop esi
xor ecx, ebp
pop ebx
call fcn.00409cf2
mov esp, ebp
pop ebp
ret