Function at 0x42d3a0
Capabilities:
Write file on windows

Disassembly:
sub esp, 0x14
and dword [esp + 4], 0
push ebx
mov ebx, dword [esp + 0x20]
push ebp
push esi
push edi
mov eax, dword [ebx + 4]
test eax, eax
jne 0x42d3b9
mov eax, dword [ebx]
mov edi, dword [esp + 0x28]
mov dword [esp + 0x10], eax
mov esi, dword [edi + 8]
test esi, esi
mov dword [esp + 0x1c], esi
mov dword [esp + 0x28], esi
jg 0x42d3d7
mov eax, esi
jmp 0x42d5f1
test byte [ebx + 8], 8
je 0x42d538
push ebx
push dword [esp + 0x14]
call fcn.0042d1be
push dword [esp + 0x18]
call dword [sym.imp.MSVCRT.dll__fileno]
push eax
call sym.ruby187g.exc_rb_thread_fd_writable
add esp, 0x10
test eax, eax
jne 0x42d409
push ebx
call sym.ruby187g.exc_rb_io_check_closed
pop ecx
mov ebx, dword [sym.imp.KERNEL32.dll_InterlockedExchange]
mov esi, dword [sym.imp.MSVCRT.dll__errno]
mov ebp, sym.ruby187g.exc_rb_trap_immediate
mov eax, dword [esp + 0x28]
cmp eax, 0x400
mov dword [esp + 0x18], eax
jle 0x42d451
cmp dword [sym.ruby187g.exc_rb_thread_critical], 0
jne 0x42d451
call sym.ruby187g.exc_rb_thread_alone
test eax, eax
jne 0x42d451
push dword [esp + 0x2c]
call fcn.0042d5f9
test eax, eax
pop ecx
je 0x42d451
mov dword [esp + 0x18], 0x400
push 1
push ebp
call ebx
push dword [esp + 0x18]
mov dword [esp + 0x24], eax
mov eax, dword [esp + 0x18]
add eax, dword [edi + 0xc]
push eax
push dword [esp + 0x18]
call dword [sym.imp.MSVCRT.dll__fileno]
pop ecx
push eax
call sym.ruby187g.exc_rb_w32_write
add esp, 0xc
mov dword [esp + 0x18], eax
push dword [esp + 0x20]
push ebp
call ebx
call esi
mov eax, dword [eax]
mov dword [esp + 0x20], eax
xor eax, eax
cmp dword [sym.ruby187g.exc_rb_prohibit_interrupt], eax
jne 0x42d4c5
cmp dword [sym.ruby187g.exc_rb_thread_critical], eax
jne 0x42d4c5
cmp dword [sym.ruby187g.exc_rb_thread_pending], eax
jne 0x42d4b6
mov eax, dword [sym.ruby187g.exc_rb_thread_tick]
dec dword [sym.ruby187g.exc_rb_thread_tick]
test eax, eax
jg 0x42d4c5
mov dword [sym.ruby187g.exc_rb_thread_tick], 0x1f4
call sym.ruby187g.exc_rb_thread_schedule
cmp dword [sym.ruby187g.exc_rb_trap_pending], 0
je 0x42d4d3
call sym.ruby187g.exc_rb_trap_exec
call esi
mov ecx, dword [esp + 0x20]
mov dword [eax], ecx
mov eax, dword [esp + 0x18]
cmp eax, dword [esp + 0x28]
je 0x42d52f
test eax, eax
jl 0x42d4f9
add dword [esp + 0x14], eax
sub dword [esp + 0x28], eax
call esi
mov dword [eax], 0xb
push dword [esp + 0x10]
call dword [sym.imp.MSVCRT.dll__fileno]
push eax
call sym.ruby187g.exc_rb_io_wait_writable
pop ecx
test eax, eax
pop ecx
je 0x42d5e6
push dword [esp + 0x2c]
call sym.ruby187g.exc_rb_io_check_closed
mov eax, dword [esp + 0x18]
pop ecx
cmp eax, dword [edi + 8]
jge 0x42d5e6
jmp 0x42d41a
mov eax, dword [esp + 0x1c]
jmp 0x42d5f1
mov ebx, dword [sym.imp.MSVCRT.dll__errno]
call ebx
push dword [esp + 0x10]
and dword [eax], 0
push esi
push 1
push dword [edi + 0xc]
call dword [sym.imp.MSVCRT.dll_fwrite]
mov ebp, eax
add esp, 0x10
sub esi, ebp
test esi, esi
jle 0x42d5eb
mov eax, dword [esp + 0x10]
test byte [eax + 0xc], 0x20
je 0x42d5c2
call ebx
cmp dword [eax], 0
jne 0x42d592
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xe8
jne 0x42d58a
call ebx
mov dword [eax], 0x20
jmp 0x42d592
call ebx
mov dword [eax], 9
push dword [esp + 0x10]
call dword [sym.imp.MSVCRT.dll__fileno]
push eax
call sym.ruby187g.exc_rb_io_wait_writable
pop ecx
test eax, eax
pop ecx
je 0x42d5e6
push dword [esp + 0x2c]
call sym.ruby187g.exc_rb_io_check_closed
push dword [esp + 0x14]
call dword [sym.imp.MSVCRT.dll_clearerr]
cmp ebp, dword [edi + 8]
pop ecx
pop ecx
jge 0x42d5e6
call ebx
and dword [eax], 0
push dword [esp + 0x10]
mov eax, ebp
add eax, dword [edi + 0xc]
push esi
push 1
push eax
call dword [sym.imp.MSVCRT.dll_fwrite]
add esp, 0x10
add ebp, eax
sub esi, eax
jmp 0x42d55a
or eax, 0xffffffff
jmp 0x42d5f1
mov eax, dword [esp + 0x1c]
sub eax, esi
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x14
ret